ESP32 Arduino Framework Debugging Error

I’m using an ESP-Prog and all of the general setup seems to be OK but once it makes a GDB connection I get an error that it can’t find partion.c and then I also get warnings that it can’t write to 2 addresses (0x3f42c000 and 0x3f42d000)

I believe the 2 are related but the long directory where it is looking for the partition file is a mystery for me and I can’t seem to locate where it’s trying to look.

Here’s the section in my platformio.ini:

[env:portaprog_v5]
platform = espressif32@3.0.0
board = esp32dev
framework = arduino
monitor_speed = 115200
debug_tool = esp-prog
debug_init_break = tbreak setup
debug_build_flags = -O0 -ggdb3 -g3
debug_speed = 8000

and here’s the Debug Console Log:

Reading symbols from D:\GitHub\portaprog\.pio\build\portaprog_v5\firmware.elf...
done.
PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = esp-prog
PlatformIO: Initializing remote target...
Open On-Chip Debugger  v0.10.0-esp32-20210721 (2021-07-21-13:35)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz

WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
Info : tcl server disabled
Info : telnet server disabled
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
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: Target halted, PC=0x401603CA, debug_reason=00000001
Info : esp32.cpu0: Detected debug stubs @ 3ffc3604
Info : esp32.cpu1: Target halted, PC=0x400DB334, debug_reason=00000000
Warn : Not full dbg stub table 1 of 2
Warn : Not full dbg stub table 1 of 2
Info : accepting 'gdb' connection from pipe
Warn : No symbols for FreeRTOS!
Info : esp32.cpu0: Target halted, PC=0x400928DA, debug_reason=00000001
Info : Set GDB target to 'esp32.cpu0'
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 174 KB
Info : Flash mapping 1: 0x40018 -> 0x400d0018, 581 KB
Info : esp32.cpu0: Target halted, PC=0x400928DA, 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=0x400928DA, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 174 KB
Info : Flash mapping 1: 0x40018 -> 0x400d0018, 581 KB
Info : Using flash bank 'esp32.cpu0.irom' size 584 KB
Info : esp32.cpu0: Target halted, PC=0x400928DA, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 174 KB
Info : Flash mapping 1: 0x40018 -> 0x400d0018, 581 KB
Info : Using flash bank 'esp32.cpu0.drom' size 176 KB
Info : New GDB Connection: 1, Target esp32.cpu0, state: halted
0x401603ca in load_partitions () at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/spi_flash/partition.c:190
190	/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/spi_flash/partition.c: No such file or directory.
Loading section .flash.rodata, size 0x3c8c8 lma 0x3f400020
Warn : address 0x3f42c000 not writable
Warn : address 0x3f42d000 not writable
.pioinit:12: Error in sourced command file:
Load failed
.pioinit:12: Error in sourced command file:
Load failed

I found in another post that “you need to install the ESP-IDF” which I’ve done but if you’re using the Arduino Framework I’m not sure installing the ESP-IDF is really needed or not.

When I tried pio debug on the CLI it complained that I had 2 PIO cores so I successfully uninstalled one of those and I’m running PlatformIO 6.1.6a4

Now I’m seeing a load failed error but searching around hasn’t led to any fixes for this.

Reading symbols from D:\GitHub\portaprog\.pio\build\portaprog_v5\firmware.elf...
done.
PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = esp-prog
PlatformIO: Initializing remote target...
Open On-Chip Debugger  v0.10.0-esp32-20210721 (2021-07-21-13:35)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz

WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
Info : tcl server disabled
Info : telnet server disabled
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
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: Target halted, PC=0x4016049E, debug_reason=00000001
Info : esp32.cpu0: Detected debug stubs @ 3ffc3604
Info : esp32.cpu1: Target halted, PC=0x4016049E, debug_reason=00000000
Warn : Not full dbg stub table 1 of 2
Warn : Not full dbg stub table 1 of 2
Info : accepting 'gdb' connection from pipe
Warn : No symbols for FreeRTOS!
Info : esp32.cpu0: Target halted, PC=0x400928DA, debug_reason=00000001
Info : Set GDB target to 'esp32.cpu0'
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 173 KB
Info : Flash mapping 1: 0x40018 -> 0x400d0018, 582 KB
Info : esp32.cpu0: Target halted, PC=0x400928DA, 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=0x400928DA, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 173 KB
Info : Flash mapping 1: 0x40018 -> 0x400d0018, 582 KB
Info : Using flash bank 'esp32.cpu0.irom' size 584 KB
Info : esp32.cpu0: Target halted, PC=0x400928DA, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 173 KB
Info : Flash mapping 1: 0x40018 -> 0x400d0018, 582 KB
Info : Using flash bank 'esp32.cpu0.drom' size 176 KB
Info : New GDB Connection: 1, Target esp32.cpu0, state: halted
0x4016049e in coex_arbit_deinit ()
Loading section .flash.rodata, size 0x3c4f4 lma 0x3f400020
Warn : address 0x3f42c000 not writable
Warn : address 0x3f42d000 not writable
.pioinit:12: Error in sourced command file:
Load failed
.pioinit:12: Error in sourced command file:
Load failed