Chapter 4. API Guides
xtensa-esp32s2-elf-gdb -x gdbinit build/blink.elf
5. If previous steps have been done correctly, you will see a similar log concluded with (gdb) prompt:
user-name@computer-name:~/esp/blink$ xtensa-esp32s2-elf-gdb -x gdbinit build/
blink.elf
→
GNU gdb (crosstool-NG crosstool-ng-1.22.0-61-gab8375a) 7.10
Copyright (C) 2015 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.
and "show warranty" for details.
This GDB was configured as "--host=x86_64-build_pc-linux-gnu --target=xtensa-
esp32s2-elf".
→
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 build/blink.elf...done.
0x400d10d8 in esp_vApplicationIdleHook () at /home/user-name/esp/esp-idf/
components/esp32s2/./freertos_hooks.c:52
→
52
asm("waiti 0");
JTAG tap: esp32s2.cpu0 tap/device found: 0x120034e5 (mfg: 0x272
part: 0x2003, ver: 0x1)
→
JTAG tap: esp32s2.slave tap/device found: 0x120034e5 (mfg: 0x272
part: 0x2003, ver: 0x1)
→
esp32s2: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
esp32s2: Core was reset (pwrstat=0x5F, after clear 0x0F).
Target halted. PRO_CPU: PC=0x5000004B (active)
esp32s2: target state: halted
esp32s2: Core was reset (pwrstat=0x1F, after clear 0x0F).
Target halted. PRO_CPU: PC=0x40000400 (active)
esp32s2: target state: halted
Hardware assisted breakpoint 1 at 0x400db717: file /home/user-name/esp/blink/
main/./blink.c, line 43.
→
0x0:
0x00000000
Target halted. PRO_CPU: PC=0x400DB717 (active)
[New Thread 1073428656]
[New Thread 1073413708]
[New Thread 1073431316]
[New Thread 1073410672]
[New Thread 1073408876]
[New Thread 1073432196]
[New Thread 1073411552]
[Switching to Thread 1073411996]
Temporary breakpoint 1, app_main () at /home/user-name/esp/blink/main/./blink.
c:43
→
43
xTaskCreate(&blink_task, "blink_task", 512, NULL, 5, NULL);
(gdb)
Note the third line from bottom that shows debugger halting at breakpoint established in gdbinit file at function
app_main(). Since the processor is halted, the LED should not be blinking. If this is what you see as well, you
are ready to start debugging.
If you are not quite sure how to use GDB, check
Examples.
Espressif Systems
Command Line
example debugging session in section
1391
Submit Document Feedback
Type "show copying"
(Tensilica),␣
(Tensilica),␣
APP_CPU: PC=0x00000000
APP_CPU: PC=0x40000400
APP_CPU: PC=0x400D10D8
Debugging
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?
Questions and answers