Two issues with the OLIMEX debugger

Just need to get confirmation if the two issues I have with the PIO/VSCode is my setup or if it is something I should report in a PR.

My PIO / VSCode setup:
PlatformIO Core, version 5.2.2
Version: 1.61.2 (user setup)
Commit: 6cba118ac49a1b88332f312a8f67186f7f3c1643
Date: 2021-10-19T14:57:20.575Z
Electron: 13.5.1
Chrome: 91.0.4472.164
Node.js: 14.16.0
OS: Windows_NT x64 10.0.19043

default_envs = nodemcu-32s

platform = espressif32
framework = espidf
board = nodemcu-32s
board_upload.flash_size = 4MB
board_upload.maximum_size = 4194304
board_build.partitions = ESP32_OTA_4M.csv
board_build.embed_files = src/cert/ca_cert.pem
monitor_speed = 115200
debug_tool = olimex-arm-usb-ocd-h
debug_speed = 8000
build_flags = -DCORE_DEBUG_LEVEL=5


As described in,
Cannot start debugger
I need to Erase the Flash manually when I change from release to debug mode or I will get the mentioned ‘Failed to launch GDB’ error.

I have also realized that the first time the debugger starts (after erasing the flash) it will halt with the error:

PlatformIO: Initialization completed
PlatformIO: Resume the execution to debug_init_break = thb app_main
PlatformIO: More configuration options → Redirecting...
Warn : address 0x4010ef04 not writable
Error: esp32.cpu0: Failed to write breakpoint instruction (-4)!
Error: esp32.cpu0: Failed to add SW breakpoint!
Error: can’t add breakpoint: unknown reason
Cannot insert breakpoint 2.
Cannot access memory at address 0x4010ef04
Command aborted.

The workaround is to just stop the debugger and make a new ‘Start Debugging’ and the debugger will work as expected.

So, is this worth a PR or is it just to be expected with my setup?

It’s definitely weird that it needs to runs to work properly. Please open an issue in platform-espressif32.

@maxgerhardt Thanks for the feedback!

Will do:
PR created