Espressif ESP32-S2 Programming Manual page 1419

Table of Contents

Advertisement

Chapter 4. API Guides
To demonstrate this functionality, using command break and delete discussed in previous paragraph, make sure
that you have only one breakpoint defined at line 36 of blink.c:
(gdb) info break
Num
Type
3
breakpoint
blink/main/./blink.c:36
breakpoint already hit 1 time
(gdb)
Resume program by entering c and let it halt:
(gdb) c
Continuing.
Target halted. PRO_CPU: PC=0x400DB754 (active)
Breakpoint 3, blink_task (pvParameter=0x0) at /home/user-name/esp/blink/main/./
blink.c:36
36
gpio_set_level(BLINK_GPIO, 1);
(gdb)
Then enter n couple of times to see how debugger is stepping one program line at a time:
(gdb) n
Target halted. PRO_CPU: PC=0x400DB756 (active)
Target halted. PRO_CPU: PC=0x400DB758 (active)
Target halted. PRO_CPU: PC=0x400DC04C (active)
Target halted. PRO_CPU: PC=0x400DB75B (active)
37
vTaskDelay(1000 / portTICK_PERIOD_MS);
(gdb) n
Target halted. PRO_CPU: PC=0x400DB75E (active)
Target halted. PRO_CPU: PC=0x400846FC (active)
Target halted. PRO_CPU: PC=0x400DB761 (active)
Target halted. PRO_CPU: PC=0x400DB746 (active)
33
gpio_set_level(BLINK_GPIO, 0);
(gdb)
If you enter s instead, then debugger will step inside subroutine calls:
(gdb) s
Target halted. PRO_CPU: PC=0x400DB748 (active)
Target halted. PRO_CPU: PC=0x400DB74B (active)
Target halted. PRO_CPU: PC=0x400DC04C (active)
Target halted. PRO_CPU: PC=0x400DC04F (active)
gpio_set_level (gpio_num=GPIO_NUM_4, level=0) at /home/user-name/esp/esp-idf/
components/driver/./gpio.c:183
183
GPIO_CHECK(GPIO_IS_VALID_OUTPUT_GPIO(gpio_num), "GPIO output gpio_num error
", ESP_ERR_INVALID_ARG);
(gdb)
In this particular case debugger stepped inside gpio_set_level(BLINK_GPIO, 0) and effectively moved to
gpio.c driver code.
Why stepping with "next"does not bypass subroutine calls?
See
Checking and setting memory
parameters you may vary the format and count of memory locations displayed. Run help x to see more details.
Companion command to x is set that let you write values to the memory.
We will demonstrate how x and set work by reading from and writing to the memory location 0x3FF44004
labeled as GPIO_OUT_REG used to set and clear individual GPIO's.
Espressif Systems
Disp Enb Address
keep y
0x400db704 in blink_task at /home/user-name/esp/
Displaying the contents of memory is done with command x. With additional
1408
Submit Document Feedback
What
APP_CPU: PC=0x400D1128
APP_CPU: PC=0x400D1128
APP_CPU: PC=0x400D1128
APP_CPU: PC=0x400D1128
APP_CPU: PC=0x400D1128
APP_CPU: PC=0x400D1128
APP_CPU: PC=0x400D1128
APP_CPU: PC=0x400D1128
APP_CPU: PC=0x400D1128
APP_CPU: PC=0x400D1128
APP_CPU: PC=0x400D1128
APP_CPU: PC=0x400D1128
APP_CPU: PC=0x400D1128
for potential limitation of using next command.
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Table of Contents

Save PDF