EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #1418 background imageLoading...
Page #1418 background image
Chapter 4. API Guides
(continued from previous page)
(gdb)
You will be also able to see that LED is changing the state only if you resume program execution by entering c.
To examine how many breakpoints are set and where, use command info break:
(gdb) info break
Num Type Disp Enb Address What
2 breakpoint keep y 0x400db6f6 in blink_task at /home/user-name/esp/
,blink/main/./blink.c:33
breakpoint already hit 1 time
3 breakpoint keep y 0x400db704 in blink_task at /home/user-name/esp/
,blink/main/./blink.c:36
breakpoint already hit 1 time
(gdb)
Please note that breakpoint numbers (listed under Num) start with 2. This is because first breakpoint has been
already established at function app_main() by running command thb app_main on debugger launch. As it
was a temporary breakpoint, it has been automatically deleted and now is not listed anymore.
To remove breakpoints enter delete N command (in short d N), where N is the breakpoint number:
(gdb) delete 1
No breakpoint number 1.
(gdb) delete 2
(gdb)
Read more about breakpoints under Breakpoints and watchpoints available and What else should I know about break-
points?
Halting and resuming the application When debugging, you may resume application and enter code waiting for
some event or staying in infinite loop without any break points defined. In such case, to go back to debugging mode,
you can break program execution manually by entering Ctrl+C.
To check it delete all breakpoints and enter c to resume application. Then enter Ctrl+C. Application will be halted
at some random point and LED will stop blinking. Debugger will print the following:
(gdb) c
Continuing.
^CTarget halted. PRO_CPU: PC=0x400D0C00 APP_CPU: PC=0x400D0C00 (active)
[New Thread 1073433352]
Program received signal SIGINT, Interrupt.
[Switching to Thread 1073413512]
0x400d0c00 in esp_vApplicationIdleHook () at /home/user-name/esp/esp-idf/
,components/esp32s2/./freertos_hooks.c:52
52 asm("waiti 0");
(gdb)
In particular case above, the application has been halted in line 52 of code in file freertos_hooks.c. Now you
can resume it again by enter c or do some debugging as discussed below.
Note: In MSYS2 shell Ctrl+C does not halt the target but exists debugger. To resolve this issue consider debugging
with Eclipse or check a workaround under http://www.mingw.org/wiki/Workaround_for_GDB_Ctrl_C_Interrupt.
Stepping through the code It is also possible to step through the code using step and next commands (in short
s and n). The difference is that step is entering inside subroutines calls, while next steps over the call, treating it
as a single source line.
Espressif Systems 1407
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish