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 #1413 background imageLoading...
Page #1413 background image
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 Expressionstab. If this tab is not visible, then add it
by going to the top menu Window > Show View > Expressions. Then click Add new expressionand 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 Valuecolumn. 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 satised. Right click on the breakpoint to open a context menu and selectBreakpoint
Properties. Change the selection under Type:to Hardwareand 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
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