Using GDB

It’s possible to get GDB working on all cores.

Activate GDB server for all cores

Warning: Code must be loaded on the core you want to debug. Warning: Core must me started before debugging. Notice: GDB server is already started for core 0.

$ telnet 127.0.0.1 4444
> core.<core_number> arp_examine
> exit

Where <core_number> is the number of the core between 1 and 3.

Start GDB on your PC

Warning: arm-none-eabi-gdb (the one from the GNU ARM toolchain) should be in your path

$ arm-none-eabi-gdb
(gdb) target  extended-remote :<port_number>

Where port_number is:

  • 3333 for core0;

  • 3334 for core1;

  • 3335 for core2;

  • 3336 for core3.

Using GDB

GDB could be use as ususal.

Getting GDB

The GCC ARM toolchain containing gdb could be downloaded here

Example1 : Load an ELF file and execute it on core0

  1. Start your board on SPI or SPACEWIRE

  2. Start openocd

  3. Start GDB

  4. Connect to your target using “target” command

  5. Use “file” command with the elf file you want to load

  6. Use “load” command with the elf file you want to load

  7. Use “info registers” command to see current value of the core registers

  8. Press “c” to start execution

  9. Press “ctrl+c” to break the execution

$ arm-none-eabi-gdb
(gdb) target extended-remote :3333
0x000028ba in ?? ()
(gdb) file bsp_demo.elf
Reading symbols from bsp_demo.elf...
(gdb) load bsp_demo.elf
Loading section .start, size 0x2e8 lma 0x100000
Loading section .text, size 0xa708 lma 0x1002e8
Loading section .rodata, size 0x58c lma 0x10a9f0
Loading section .ARM.exidx, size 0x8 lma 0x10af7c
Loading section .data, size 0x1500 lma 0x10af88
Start address 0x00100000, load size 50308
Transfer rate: 412 KB/sec, 7186 bytes/write.
(gdb) info registers
r0             0x300010            3145744
r1             0x90009             589833
r2             0xd707000           225472512
r3             0x0                 0
r4             0x1101              4353
r5             0x0                 0
r6             0xcd                205
r7             0x0                 0
r8             0x0                 0
r9             0x0                 0
r10            0x0                 0
r11            0x0                 0
r12            0x300de8            3149288
sp             0x31c738            0x31c738
lr             0x288b              0x288b
pc             0x100000            0x100000 <main>
cpsr           0x800001da          2147484122
fpscr          0x0                 0
(gdb) continue
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x00000088 in ?? ()
(gdb)  quit

© NanoXplore 2022