Chapter 4. API Guides
a global variable int i above definition of function blink_task. Then add i++ inside while(1) of this
function to get i incremented on each blink.
Exit debugger, so it is not confused with new code, build and flash the code to the ESP and restart debugger. There
is no need to restart OpenOCD.
Once application is halted, enter a breakpoint in the line where you put i++.
In next step, in the window with "Breakpoints", click the "Expressions"tab. If this tab is not visible, then add it
by going to the top menu Window > Show View > Expressions. Then click "Add new expression"and enter i.
Resume program execution by pressing F8. Each time the program is halted you will see i value being incremented.
Fig. 36: Watching program variable "i"
To modify i enter a new number in "Value"column. After pressing "Resume (F8)"the program will keep
incrementing i starting from the new entered number.
Setting conditional breakpoints
Here comes more interesting part. You may set a breakpoint to halt the program
execution, if certain condition is satisfied. Right click on the breakpoint to open a context menu and select " Breakpoint
Properties". Change the selection under "Type:"to "Hardware"and enter a "Condition:"like i == 2.
If current value of i is less than 2 (change it if required) and program is resumed, it will blink LED in a loop until
condition i == 2 gets true and then finally halt.
Command Line
Verify if your target is ready and loaded with
get-started/blink
example. Configure and start
debugger following steps in section
Command
Line. Pick up where target was left by debugger, i.e. having the
application halted at breakpoint established at app_main():
Espressif Systems
1402
Release v4.4
Submit Document Feedback
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?
Questions and answers