Hello,
I am using ESP-WROVER-KIT to debug my ESP32 projects. I’ve already put this thing to work with a simpler code, like blink example. Everything debugs just fine with it.
However, when I’m trying to debug another code, wich uses WiFi features of ESP32, it doesn’t work properly. The code compiles and is flashed to ESP, then the Debug Tool initialize, but after it, the debug session does not follow my code. It does not stop at void setup() neither at any breakpoints I try to insert.
If I Pause, Call Stack fills with adress with Unknown Source and I get the message on console:
Program received signal
SIGINT, Interrupt.
0x40009034 in ?? ()
If I Step Out, I get the message:
Error: esp32: Failed to read insn (-4)!
Error: esp32: Failed to add SW BP!
Error: can't add breakpoint: resource not available
I tried to insert gdb_breakpoint_override hard on .platformio\packages\tool-openocd-esp32\share\openocd\scripts\target\esp32.cfg . By doing that, it doesn’t give me any errors, but it doesn’t work as well.
Here is the Debug Console:
Reading symbols from c:/Users/Deividi/Documents/PlatformIO/Projects/esp-conectado/.pio/build/esp32dev/firmware.elf…
done.
PlatformIO Unified Debugger → hhttp://bit.ly/pio-debug
PlatformIO: Initializing remote target…
Open On-Chip Debugger v0.10.0-esp32-20190313 (2019-03-13-09:57)
Licensed under GNU GPL v2
For bug reports, read
hhttp://openocd.org/doc/doxygen/bugs.html
none separate
adapter speed: 20000 kHz
Info : Configured 2 cores
esp32 interrupt mask on
Info : tcl server disabled
Info : telnet server disabled
Info : ftdi: if you experience problems at higher adapter clocks, try the command “ftdi_tdo_sample_edge falling”
Info : clock speed 20000 kHz
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : accepting ‘gdb’ connection from pipe
Error: No symbols for FreeRTOS
Info : Target halted. PRO_CPU: PC=0x40009087 (active) APP_CPU: PC=0x400076DD
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x400076DD
Info : Flash mapping 0: 0x10020 → 0x3f400020, 239 KB
Info : Flash mapping 1: 0x50018 → 0x400d0018, 760 KB
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x400076DD
Info : Auto-detected flash size 4096 KB
Info : Using flash size 4096 KB
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x400076DD
Info : Flash mapping 0: 0x10020 → 0x3f400020, 239 KB
Info : Flash mapping 1: 0x50018 → 0x400d0018, 760 KB
Info : Using flash size 764 KB
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x400076DD
Info : Flash mapping 0: 0x10020 → 0x3f400020, 239 KB
Info : Flash mapping 1: 0x50018 → 0x400d0018, 760 KB
Info : Using flash size 240 KB
0x40009087 in ?? ()
Temporary breakpoint 1 at 0x400e2388: file src\main.cpp, line 312.
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
Info : esp32: Core 0 was reset (pwrstat=0x1F, after clear 0x0F).
Info : esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F).
Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
esp32: Core 0 was reset (pwrstat=0x1F, after clear 0x0F).
esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
** Programming Started **
auto erase enabled
** Programming Started **
auto erase enabled
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
wrote 20480 bytes from file C:/Users/Deividi/.platformio/packages/framework-arduinoespressif32/tools/sdk/bin/bootloader_dio_40m.bin in 0.985057s (20.303 KiB/s)
wrote 20480 bytes from file C:/Users/Deividi/.platformio/packages/framework-arduinoespressif32/tools/sdk/bin/bootloader_dio_40m.bin in 0.985057s (20.303 KiB/s)
** Programming Finished **
** Verify Started **
** Programming Finished **
** Verify Started **
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
read 16848 bytes from file C:/Users/Deividi/.platformio/packages/framework-arduinoespressif32/tools/sdk/bin/bootloader_dio_40m.bin and flash bank 0 at offset 0x00001000 in 0.303018s (54.298 KiB/s)
contents match
** Verified OK **
read 16848 bytes from file C:/Users/Deividi/.platformio/packages/framework-arduinoespressif32/tools/sdk/bin/bootloader_dio_40m.bin and flash bank 0 at offset 0x00001000 in 0.303018s (54.298 KiB/s)
contents match
** Verified OK **
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
Info : esp32: Core 0 was reset (pwrstat=0x1F, after clear 0x0F).
Info : esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core 0 was reset (pwrstat=0x1F, after clear 0x0F).
Info : esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
** Programming Started **
auto erase enabled
** Programming Started **
auto erase enabled
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
wrote 4096 bytes from file c:/Users/Deividi/Documents/PlatformIO/Projects/esp-conectado/.pio/build/esp32dev/partitions.bin in 0.594033s (6.734 KiB/s)
wrote 4096 bytes from file c:/Users/Deividi/Documents/PlatformIO/Projects/esp-conectado/.pio/build/esp32dev/partitions.bin in 0.594033s (6.734 KiB/s)
** Programming Finished **
** Verify Started **
** Programming Finished **
** Verify Started **
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
read 3072 bytes from file c:/Users/Deividi/Documents/PlatformIO/Projects/esp-conectado/.pio/build/esp32dev/partitions.bin and flash bank 0 at offset 0x00008000 in 0.237014s (12.657 KiB/s)
contents match
** Verified OK **
read 3072 bytes from file c:/Users/Deividi/Documents/PlatformIO/Projects/esp-conectado/.pio/build/esp32dev/partitions.bin and flash bank 0 at offset 0x00008000 in 0.237014s (12.657 KiB/s)
contents match
** Verified OK **
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
Info : esp32: Core 0 was reset (pwrstat=0x1F, after clear 0x0F).
Info : esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core 0 was reset (pwrstat=0x1F, after clear 0x0F).
esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
** Programming Started **
auto erase enabled
Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
** Programming Started **
auto erase enabled
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
wrote 8192 bytes from file C:/Users/Deividi/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin in 0.679039s (11.781 KiB/s)
wrote 8192 bytes from file C:/Users/Deividi/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin in 0.679039s (11.781 KiB/s)
** Programming Finished **
** Programming Finished **
** Verify Started **
** Verify Started **
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
read 8192 bytes from file C:/Users/Deividi/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin and flash bank 0 at offset 0x0000e000 in 0.529031s (15.122 KiB/s)
contents match
read 8192 bytes from file C:/Users/Deividi/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin and flash bank 0 at offset 0x0000e000 in 0.529031s (15.122 KiB/s)
contents match
** Verified OK **
** Verified OK **
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
Info : esp32: Core 0 was reset (pwrstat=0x1F, after clear 0x0F).
Info : esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core 0 was reset (pwrstat=0x1F, after clear 0x0F).
esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
** Programming Started **
auto erase enabled
** Programming Started **
auto erase enabled
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
wrote 1122304 bytes from file c:/Users/Deividi/Documents/PlatformIO/Projects/esp-conectado/.pio/build/esp32dev/firmware.bin in 10.819619s (101.297 KiB/s)
wrote 1122304 bytes from file c:/Users/Deividi/Documents/PlatformIO/Projects/esp-conectado/.pio/build/esp32dev/firmware.bin in 10.819619s (101.297 KiB/s)
** Programming Finished **
** Verify Started **
** Programming Finished **
** Verify Started **
Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400
read 1118800 bytes from file c:/Users/Deividi/Documents/PlatformIO/Projects/esp-conectado/.pio/build/esp32dev/firmware.bin and flash bank 0 at offset 0x00010000 in 3.886223s (281.141 KiB/s)
contents match
** Verified OK **
read 1118800 bytes from file c:/Users/Deividi/Documents/PlatformIO/Projects/esp-conectado/.pio/build/esp32dev/firmware.bin and flash bank 0 at offset 0x00010000 in 3.886223s (281.141 KiB/s)
contents match
** Verified OK **
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
Info : esp32: Core 0 was reset (pwrstat=0x1F, after clear 0x0F).
Info : esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F).
Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
Info : esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core 0 was reset (pwrstat=0x1F, after clear 0x0F).
esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
PlatformIO: Initialization completed
PlatformIO: Resume the execution todebug_init_break = tbreak setup
PlatformIO: More configuration options → Redirecting...
Note: automatically using hardware breakpoints for read-only addresses.
Cannot execute this command while the target is running.
Use the “interrupt” command to stop the target
and then try again.
Info : Target halted. PRO_CPU: PC=0x40009034 (active) APP_CPU: PC=0x400076E2
Target halted. PRO_CPU: PC=0x40009034 (active) APP_CPU: PC=0x400076E2
Program received signal
SIGINT, Interrupt.
0x40009034 in ?? ()
Error: esp32: Failed to read insn (-4)!
Error: esp32: Failed to add SW BP!
Error: can’t add breakpoint: resource not available