uracoli logo Home - Downloads - Docs - Hardware - Source - News - Blog tiny230 photo

ARM Tools

Das none-eabi ist für sogenannte bare-metal builds (statisch gelinkt,
monolithisches OS/App.) gedacht, während das elf-gcc davon ausgeht, dass
die übersetzte Applikation unter (Linux/)ELF läuft, d.h. von einem OS
geladen wird.

Building Yagarto under Linux

Yagarto builds a bare-metall compiler (everything is statically linked, no embedded OS is used), that is needed for compiling µracoli. The prefix of the cross compile tools is is arm-none-eabi-<tool>.

  • Download build-scripts-20120616.tar.bz2

  • mkdir build; cd build

  • unpack build*bz2

  • cd downloads

  • get the archiv files into this directory

  • Ubuntu .. using explizit bash <script> due to ash link for /bin/sh

 2010  echo $prefix $addon_tools_dir
 2011  ./01-build-expat.sh
 2020  bash 01-build-expat.sh
 2023  echo $CC
 2024  export CC=gcc
 2025  bash 01-build-expat.sh
 2028  bash 02-build-gmp.sh
 2032  bash 03-build-mpfr.sh
 2033  bash 04-build-mpc.sh
 2034  bash 05-build-binutils.sh
 2035  bash 06-build-bootgcc.sh
Issues in script 06-build-bootgcc.sh
checking dynamic linker characteristics... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
make: *** [configure-zlib] Error 1

SAM-BA

SAM-BA = SAM Boot Assistant

Noreg Download: SAM-BA

sudo unzip -d /opt ~/Downloads/sam-ba_2.12.zip

OpenOCD

Build openocd

Note: You need to enable "your" programming adapter
./configure prefix=/opt/openocd-0.6.1 --enable-jlink
make
sudo make install
udev/rules/42-atmel.rules
# Atmel SAM-ICE, SEGGER J-Link ARM
SUBSYSTEM=="usb", SYSFS{idVendor}=="1366", SYSFS{idProduct}=="0101", GROUP="plugdev", MODE="0660"
First Contact
$ openocd  --file Templates/openocd_sam3stick.cfg &
$ telnet localhost 4444
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
> halt
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x81000000 pc: 0x00401638 msp: 0x20003f98
> reset
JTAG tap: sam3.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
>
>
>
> exit
Connection closed by foreign host.
$
Troubleshooting GDB

The initial contact with GDB brought up the following error message:

(arm-gdb)target remote localhost:3333
Remote debugging using localhost:3333
Remote 'g' packet reply is too long: 1484000012008c....................

After googling a bit, the solution of this issue is to apply the patch from http://pastebin.com/rdFF2eZd referenced by Stackoverflow.com:arm-none-eabi-gdb and openocd: Malformed response to offset query, qOffsets?

This patch did help, but for version 0.6.1 it needed to be applied manually:

--- src/target/armv7m.c.orig    2012-10-16 22:30:18.197475309 +0200
+++ src/target/armv7m.c 2012-10-16 22:31:13.361477288 +0200
@@ -267,7 +267,7 @@
        struct armv7m_common *armv7m = target_to_armv7m(target);
        int i;

-       *reg_list_size = 26;
+       *reg_list_size = 17;
        *reg_list = malloc(sizeof(struct reg *) * (*reg_list_size));

        /*
@@ -280,19 +280,19 @@
        for (i = 0; i < 16; i++)
                (*reg_list)[i] = &armv7m->core_cache->reg_list[i];

-       for (i = 16; i < 24; i++)
-               (*reg_list)[i] = &arm_gdb_dummy_fp_reg;
-       (*reg_list)[24] = &arm_gdb_dummy_fps_reg;
+//     for (i = 16; i < 24; i++)
+//             (*reg_list)[i] = &arm_gdb_dummy_fp_reg;
+//     (*reg_list)[24] = &arm_gdb_dummy_fps_reg;

 #ifdef ARMV7_GDB_HACKS
        /* use dummy cpsr reg otherwise gdb may try and set the thumb bit */
-       (*reg_list)[25] = &armv7m_gdb_dummy_cpsr_reg;
+       (*reg_list)[16] = &armv7m_gdb_dummy_cpsr_reg;

        /* ARMV7M is always in thumb mode, try to make GDB understand this
         * if it does not support this arch */
        *((char *)armv7m->arm.pc->value) |= 1;
 #else
-       (*reg_list)[25] = &armv7m->core_cache->reg_list[ARMV7M_xPSR];
+       (*reg_list)[16] = &armv7m->core_cache->reg_list[ARMV7M_xPSR];
 #endif

        return ERROR_OK;

After a "make; sudo make install" the first debug session could be started.

more topics


Last modified: 2017-06-04 Visitor Counter