ESP32 - QIO flash configuration vs software breakpoints

ptihanyi
Posts: 1
Joined: Mon May 06, 2024 8:11 pm

ESP32 - QIO flash configuration vs software breakpoints

Postby ptihanyi » Mon May 06, 2024 8:20 pm

Hello!

I use ESP-PROG JTAG programmer for ESP32-WROOM module (ESP32-DevkitC) and noticed an unusual phenomenon:
If I set the module flash configuration to QIO, I cannot create a software breakpoint.
In addition, several error messages appear when connecting OpenOCD in this case:

Code: Select all

Warn : Failed to get flash maps (-6)!
Warn : Application image is invalid! Check configured binary flash offset 'appimage_offset'.
Warn : Failed to get flash mappings (-4)!
The two hardware breakpoints work perfectly, however, when creating a third - software - breakpoint, the following message appears:

Code: Select all

Error: esp32.cpu0: Failed to get flash bank (-4)!
Error: [esp32.cpu0] can't add breakpoint: unknown reason
Error: No flash at address 0x400d540e
If I reset the flash configuration to DIO, everything is OK; and OpenOCD errors also disappear.
By the way, the uploaded program works perfectly even with QIO mode, only debugging is problematic.

To reproduce the behavior I copied the base 'blink' project and switched the flash to QIO.
Of course, I don't use the extra GPIOs used by QIO for anything.

Complete OpenOCD log:

Code: Select all

21:53:58: Starting C:\esp\tools\openocd-esp32\v0.12.0-esp32-20240318\openocd-esp32\bin\openocd.exe -c "gdb_port 3333" -s C:/esp/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/share/openocd/scripts -f C:/esp/tools/openocd-esp32/v0.12.0-esp32-20240318/openocd-esp32/share/openocd/scripts/board/esp32-wrover-kit-1.8v.cfg...
21:53:58: Debugging C:\esp\Projects\spi-dma-test\bld\ESP_IDF_ESP32-Debug\blink.elf ...
Open On-Chip Debugger v0.12.0-esp32-20240318 (2024-03-18-18:26)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
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 : [esp32.cpu0] Examination succeed
Info : [esp32.cpu1] Examination succeed
Info : starting gdb server for esp32.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
Info : [esp32.cpu0] Debug controller was reset.
Info : [esp32.cpu0] Core was reset.
Info : [esp32.cpu1] Debug controller was reset.
Info : [esp32.cpu1] Core was reset.
Info : [esp32.cpu0] Target halted, PC=0x400845E6, debug_reason=00000000
Info : [esp32.cpu0] Reset cause (1) - (Power on reset)
Info : [esp32.cpu1] Target halted, PC=0x400845E6, debug_reason=00000000
Info : [esp32.cpu1] Reset cause (14) - (CPU1 reset by CPU0)
could not convert 'main' from the host encoding (CP1252) to UTF-32.
This normally should not happen, please file a bug report.Info : accepting 'gdb' connection on tcp/3333
Info : [esp32.cpu0] Target halted, PC=0x400845E6, debug_reason=00000000
Info : Set GDB target to 'esp32.cpu0'
Info : [esp32.cpu1] Target halted, PC=0x400845E6, debug_reason=00000000
Warn : No symbols for FreeRTOS!
Info : [esp32.cpu0] Target halted, PC=0x400BE65A, debug_reason=00000001
Warn : Failed to get flash maps (-6)!
Warn : Application image is invalid! Check configured binary flash offset 'appimage_offset'.
Warn : Failed to get flash mappings (-4)!
Info : [esp32.cpu0] Target halted, PC=0x400BE65A, debug_reason=00000001
Info : [esp32.cpu0] Target halted, PC=0x400BE65A, debug_reason=00000001
Info : Auto-detected flash bank 'esp32.cpu0.flash' size 4096 KB
Info : Using flash bank 'esp32.cpu0.flash' size 4096 KB
Info : [esp32.cpu0] Target halted, PC=0x400BE65A, debug_reason=00000001
Warn : Failed to get flash maps (-6)!
Warn : Application image is invalid! Check configured binary flash offset 'appimage_offset'.
Warn : Failed to get flash mappings (-4)!
Info : [esp32.cpu0] Target halted, PC=0x400BE65A, debug_reason=00000001
Info : Using flash bank 'esp32.cpu0.irom' size 0 KB
Info : [esp32.cpu0] Target halted, PC=0x400BE65A, debug_reason=00000001
Warn : Failed to get flash maps (-6)!
Warn : Application image is invalid! Check configured binary flash offset 'appimage_offset'.
Warn : Failed to get flash mappings (-4)!
Info : [esp32.cpu0] Target halted, PC=0x400BE65A, debug_reason=00000001
Info : Using flash bank 'esp32.cpu0.drom' size 0 KB
Info : New GDB Connection: 1, Target esp32.cpu0, state: halted
Warn : Prefer GDB command "target extended-remote :3333" instead of "target remote :3333"
Info : Detected FreeRTOS version: (10.5.1)
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)[esp32.cpu0] requesting target halt and executing a soft resetInfo : 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 : [esp32.cpu0] requesting target halt and executing a soft reset
Info : [esp32.cpu0] Debug controller was reset.
[esp32.cpu0] Debug controller was reset.Info : [esp32.cpu0] Core was reset.
[esp32.cpu0] Core was reset.Info : [esp32.cpu0] Target halted, PC=0x500000CF, debug_reason=00000000
[esp32.cpu0] Target halted, PC=0x500000CF, debug_reason=00000000Info : [esp32.cpu0] Reset cause (3) - (Software core reset)
[esp32.cpu0] Reset cause (3) - (Software core reset)Info : [esp32.cpu1] requesting target halt and executing a soft reset
[esp32.cpu1] requesting target halt and executing a soft resetInfo : [esp32.cpu0] Core was reset.
[esp32.cpu0] Core was reset.Info : [esp32.cpu0] Target halted, PC=0x40000400, debug_reason=00000000
Info : [esp32.cpu1] Debug controller was reset.
Info : [esp32.cpu1] Core was reset.
Info : [esp32.cpu1] Target halted, PC=0x40000400, debug_reason=00000000
Info : [esp32.cpu1] Reset cause (14) - (CPU1 reset by CPU0)
[esp32.cpu0] Target halted, PC=0x40000400, debug_reason=00000000[esp32.cpu1] Debug controller was reset.[esp32.cpu1] Core was reset.[esp32.cpu1] Target halted, PC=0x40000400, debug_reason=00000000[esp32.cpu1] Reset cause (14) - (CPU1 reset by CPU0)Info : [esp32.cpu0] Reset cause (3) - (Software core reset)
[esp32.cpu0] Reset cause (3) - (Software core reset)force hard breakpoints
force hard breakpointsInfo : [esp32.cpu0] Target halted, PC=0x400D53DF, debug_reason=00000001
[esp32.cpu0] Target halted, PC=0x400D53DF, debug_reason=00000001Info : Set GDB target to 'esp32.cpu0'
Set GDB target to 'esp32.cpu0'Info : [esp32.cpu1] Target halted, PC=0x400845E6, debug_reason=00000000
[esp32.cpu1] Target halted, PC=0x400845E6, debug_reason=00000000Info : Detected FreeRTOS version: (10.5.1)
Info : [esp32.cpu0] Target halted, PC=0x400845E6, debug_reason=00000000
[esp32.cpu0] Target halted, PC=0x400845E6, debug_reason=00000000Info : Set GDB target to 'esp32.cpu0'
Set GDB target to 'esp32.cpu0'Info : [esp32.cpu1] Target halted, PC=0x400845E6, debug_reason=00000000
[esp32.cpu1] Target halted, PC=0x400845E6, debug_reason=00000000Info : [esp32.cpu0] Target halted, PC=0x400D540B, debug_reason=00000001
[esp32.cpu0] Target halted, PC=0x400D540B, debug_reason=00000001Info : Set GDB target to 'esp32.cpu0'
Set GDB target to 'esp32.cpu0'Info : [esp32.cpu1] Target halted, PC=0x400845E6, debug_reason=00000000
[esp32.cpu1] Target halted, PC=0x400845E6, debug_reason=00000000Info : [esp32.cpu0] Target halted, PC=0x400D540E, debug_reason=00000001
[esp32.cpu0] Target halted, PC=0x400D540E, debug_reason=00000001Info : Set GDB target to 'esp32.cpu0'
Set GDB target to 'esp32.cpu0'Info : [esp32.cpu1] Target halted, PC=0x400845E6, debug_reason=00000000
[esp32.cpu1] Target halted, PC=0x400845E6, debug_reason=00000000Info : [esp32.cpu0] Target halted, PC=0x400D540B, debug_reason=00000001
[esp32.cpu0] Target halted, PC=0x400D540B, debug_reason=00000001Info : Set GDB target to 'esp32.cpu0'
Set GDB target to 'esp32.cpu0'Info : [esp32.cpu1] Target halted, PC=0x400845E6, debug_reason=00000000
[esp32.cpu1] Target halted, PC=0x400845E6, debug_reason=00000000Info : [esp32.cpu0] Target halted, PC=0x400D540E, debug_reason=00000001
[esp32.cpu0] Target halted, PC=0x400D540E, debug_reason=00000001Info : Set GDB target to 'esp32.cpu0'
Set GDB target to 'esp32.cpu0'Info : [esp32.cpu1] Target halted, PC=0x400845E6, debug_reason=00000000
[esp32.cpu1] Target halted, PC=0x400845E6, debug_reason=00000000Info : [esp32.cpu0] Target halted, PC=0x400D540B, debug_reason=00000001
[esp32.cpu0] Target halted, PC=0x400D540B, debug_reason=00000001Info : Set GDB target to 'esp32.cpu0'
Set GDB target to 'esp32.cpu0'Info : [esp32.cpu1] Target halted, PC=0x400845E6, debug_reason=00000000
[esp32.cpu1] Target halted, PC=0x400845E6, debug_reason=00000000Info : [esp32.cpu0] Target halted, PC=0x400D540E, debug_reason=00000001
[esp32.cpu0] Target halted, PC=0x400D540E, debug_reason=00000001Info : Set GDB target to 'esp32.cpu0'
Set GDB target to 'esp32.cpu0'Info : [esp32.cpu1] Target halted, PC=0x400845E6, debug_reason=00000000
[esp32.cpu1] Target halted, PC=0x400845E6, debug_reason=00000000Error: No flash at address 0x400d540e
Error: esp32.cpu0: Failed to get flash bank (-4)!
Error: [esp32.cpu0] can't add breakpoint: unknown reason
Error: No flash at address 0x400d540e
Error: esp32.cpu0: Failed to get flash bank (-4)!
Error: [esp32.cpu0] can't add breakpoint: unknown reason
Many thanks for any suggestion!

ESP-erhankur
Posts: 8
Joined: Fri Jan 08, 2021 10:37 pm

Re: ESP32 - QIO flash configuration vs software breakpoints

Postby ESP-erhankur » Tue May 07, 2024 11:39 pm


Who is online

Users browsing this forum: Baidu [Spider] and 296 guests