Skip to content

Instantly share code, notes, and snippets.

@acassis
Created June 5, 2017 19:22
Show Gist options
  • Save acassis/9cad6c64785bd988dd452161674013bd to your computer and use it in GitHub Desktop.
Save acassis/9cad6c64785bd988dd452161674013bd to your computer and use it in GitHub Desktop.
$ telnet 127.0.0.1 4444
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Open On-Chip Debugger
> reset halt
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
> exit
Connection closed by foreign host.
alan@pc:/comum/workspace/NuttX/nuttx/nuttx$ cd ..
alan@pc:/comum/workspace/NuttX/nuttx$ cd nuttx
alan@pc:/comum/workspace/NuttX/nuttx/nuttx$ arm-none-eabi-gdb nuttx
GNU gdb (GNU Tools for ARM Embedded Processors) 7.12.0.20161204-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-pc-linux-gnu --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
nuttx: No such file or directory.
(gdb) quit
alan@pc:/comum/workspace/NuttX/nuttx/nuttx$ arm-none-eabi-gdb nuttx.elf
GNU gdb (GNU Tools for ARM Embedded Processors) 7.12.0.20161204-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-pc-linux-gnu --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from nuttx.elf...done.
(gdb) target remote :3333
Remote debugging using :3333
0xfffffffe in ?? ()
(gdb) monitor reset halt
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
(gdb) load
Loading section .text, size 0x1f2a0 lma 0x14000000
Loading section .ARM.exidx, size 0x8 lma 0x1401f2a0
Loading section .data, size 0xec lma 0x1401f2a8
Start address 0x14000138, load size 127892
Transfer rate: 33 KB/sec, 12789 bytes/write.
(gdb) b __start
Breakpoint 1 at 0x1400013e: file chip/lpc43_start.c, line 287.
(gdb) step
Note: automatically using hardware breakpoints for read-only addresses.
^C
Program received signal SIGINT, Interrupt.
__start () at chip/lpc43_start.c:268
268 {
(gdb) si
268 {
(gdb)
268 {
(gdb)
In the OpenOCD side I saw it when executing "step" or "stepi" command:
$ sudo openocd -f interface/stlink-v2.cfg -f target/lpc4330.cfg
Open On-Chip Debugger 0.10.0 (2017-02-12-09:48)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
adapter speed: 500 kHz
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Unable to match requested speed 500 kHz, using 480 kHz
Info : Unable to match requested speed 500 kHz, using 480 kHz
Info : clock speed 480 kHz
Info : STLINK v2 JTAG v17 API v2 SWIM v4 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.274766
Info : lpc4350.m4: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'telnet' connection on tcp/4444
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
Info : dropped 'telnet' connection
Info : accepting 'gdb' connection on tcp/3333
Info : Found flash device 'win w25q64cv' (ID 0x001740ef)
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x10000154 msp: 0xfffffffc
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x10000198 msp: 0xfffffffc
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (3151). Workaround: increase "set remotetimeout" in GDB
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Info : halted: PC: 0x14000138
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment