FTDI Driver for the ESP-PROG doesn't work properly anymore - MacOS Monterey 12.4

Hey there,
I am pretty new to ESP32 programming with PlatformIO. My development machine is a Macbook Pro (2017, Intel chip) running MacOS 12.4 Monterey. I followed this guide to set up my programmer and for the wiring. I am using the ESP-PROG and an Adafruit Huzzah32 Board. In the guide linked above, the author refers to the FTDI-chip website for guidance regarding driver installation.

When I initially performed the steps listed above, I managed to get everything running. I was able to upload programs to the ESP32 and could successfully debug the code. After a coding break of about 2 weeks, I noticed strange behaviour. I was still able to upload code to the ESP32, but the debugging didn’t work properly anymore. In the Serial Monitor I could still read output that looked reasonable. It took long time for the debugger to settle and I received several errors while debugging.

This then led me to the decision that I wanted to reinstall my development environment, which I started by reinstalling the FTDI drivers. Unfortunately, I am very confused by the versioning of the FTDI drivers and how to properly reinstall them. After some testing around with uninstalling and then reinstalling the drivers, I wasn’t able to generate any meaningful output of the ESP32 using the Serial monitor anymore. I basically got many NULL characters (“␀”) as output of the Serial Monitor. Then I decided to reinstall my MacOS, in the hope, that this would restore the MacOS proprietary drivers, so that I could start the installation from square one. After trying to reinstall the drivers, I am unfortunately still not able to get meaningful output from the Serial Monitor, but still several lines of NULL characters.

I assume my problem is that I have a wrong driver installation now and that I ideally need to uninstall the existing drivers, reboot, then install the right drivers, reboot again, and it should work fine. Since I am very confused about the different drivers supplied by FTDI, it would be great if someone could help me to find out how to get a “clean slate” and in a next step, which are the right drivers to use for MacOS Monterey (12.4).

Sorry for the long post, I thought it would be good to include as much information as possible.

Thank you for your help!

Maybe worth mentioning:

The program I’m using is the arduino-blink example code as included as example project in PlatformIO.

My platformio.ini file looks as follows. I have many “port” declarations since there were many changes in the port number during my experimentation described above.

[common]
platform = GitHub - platformio/platform-espressif32: Espressif 32: development platform for PlatformIO
board = esp32dev
framework = arduino
monitor_speed = 115200
; port = /dev/cu.usbserial-3
; port = /dev/cu.usbserial-4
; port = /dev/cu.usbserial-5
; port = /dev/cu.usbserial-141330A
; port = /dev/cu.usbserial-1413300
; port = /dev/cu.usbserial-1413301
; port = /dev/cu.usbserial-1433300
port = /dev/cu.usbserial-1433301
; port = /dev/cu.usbserial-143330@
monitor_port = ${common.port}
upload_port = ${common.port}
upload_speed = 921000
; lib_deps = arduino-libraries/Arduino_JSON@^0.1.0
; lib_deps = bblanchon/ArduinoJson@^6.19.4
build_flags =
; https://docs.espressif.com/projects/esp-idf/en/latest/get-started/get-started-wrover-kit.html#rgb-led
-D LED_BUILTIN=13

[env:Release]
platform = ${common.platform}
board = ${common.board}
framework = ${common.framework}
monitor_port = ${common.monitor_port}
monitor_speed = ${common.monitor_speed}
upload_port = ${common.upload_port}
upload_speed = ${common.upload_speed}
; lib_deps = ${common.lib_deps}
build_flags = ${common.build_flags}

[env:Debug]
platform = ${common.platform}
board = ${common.board}
framework = ${common.framework}
monitor_port = ${common.monitor_port}
monitor_speed = ${common.monitor_speed}
upload_port = ${common.upload_port}
upload_speed = ${common.upload_speed}
debug_tool = esp-prog
debug_init_break = tbreak setup
; lib_deps = ${common.lib_deps}
build_flags = ${common.build_flags}

Without seeing the full error message, it’s difficult to diagnose your problem.

Regarding drivers: DO NOT install any FTDI drivers. MacOS includes Apple drivers for FTDI chips out of the box. You likely have multiple drivers that are in conflict.

To fix your problem, first simplify your platformio.ini file to ensure it does not contain any errors. It currently uses a strange way to inherit settings, and it’s not needed as there is no obvious difference between release and debug version:

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
monitor_port = /dev/cu.usbserial-1433301
upload_port = /dev/cu.usbserial-1433301
upload_speed = 921000
build_flags =
  -D LED_BUILTIN=13
debug_tool = esp-prog
debug_init_break = tbreak setup

Then uninstall any drivers from FTDI. The documentation for the drivers contains uninstall instructions. Once you have uninstalled the FTDI drivers, you should only see two /dev/cu.usb... devices when you plug in the ESP-Prog adapter and not other device. The devices likely have consecutive numbers.

If it still does not work, provide the error message.

2 Likes

Thanks for the fast reply! Good to know that I don’t need to manually install additional drivers! I uninstalled the drivers now as described in the FTDI documentation. Also, I used the platformio.ini file that you provided. After a reboot, my list of devices looks as follows:

  • /dev/cu.usbserial-1433300
  • /dev/cu.usbserial-1433301
  • /dev/cu.usbserial-5
  • /dev/cu.usbserial-4

When using “/dev/cu.usbserial-5”, I can upload code to the ESP32 and read meaningful output from the serial monitor. Interestingly, when using “/dev/cu.usbserial-1433301”, I can read the serial monitor, but not upload any code to the ESP32.

I assume that I still have a fragment of the FTDI drivers somewhere, since I don’t just see two devices, but four. However, since I can upload code now and read the serial monitor when choosing the right device, I assume this is not a big problem.

If I try to debug my code now, the code gets uploaded to the ESP32, but the debugger doesn’t settle. After some time, the loading animation in VSCode stops (see screenshot below). There is no error message or similar when the debugger times out.

My launch.json document looks as follows:

// AUTOMATICALLY GENERATED FILE. PLEASE DO NOT MODIFY IT MANUALLY
//
// PIO Unified Debugger
//
// Documentation: https://docs.platformio.org/page/plus/debugging.html
// Configuration: https://docs.platformio.org/page/projectconf/section_env_debug.html

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "platformio-debug",
            "request": "launch",
            "name": "PIO Debug",
            "executable": "/Users/nicolasschwandner/Documents/PlatformIO/Projects/220519-110805-arduino-blink/.pio/build/esp32dev/firmware.elf",
            "projectEnvName": "esp32dev",
            "toolchainBinDir": "/Users/nicolasschwandner/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch3/bin",
            "internalConsoleOptions": "openOnSessionStart",
            "preLaunchTask": {
                "type": "PlatformIO",
                "task": "Pre-Debug"
            }
        },
        {
            "type": "platformio-debug",
            "request": "launch",
            "name": "PIO Debug (skip Pre-Debug)",
            "executable": "/Users/nicolasschwandner/Documents/PlatformIO/Projects/220519-110805-arduino-blink/.pio/build/esp32dev/firmware.elf",
            "projectEnvName": "esp32dev",
            "toolchainBinDir": "/Users/nicolasschwandner/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch3/bin",
            "internalConsoleOptions": "openOnSessionStart"
        },
        {
            "type": "platformio-debug",
            "request": "launch",
            "name": "PIO Debug (without uploading)",
            "executable": "/Users/nicolasschwandner/Documents/PlatformIO/Projects/220519-110805-arduino-blink/.pio/build/esp32dev/firmware.elf",
            "projectEnvName": "esp32dev",
            "toolchainBinDir": "/Users/nicolasschwandner/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch3/bin",
            "internalConsoleOptions": "openOnSessionStart",
            "loadMode": "manual"
        }
    ]
}

After experimenting for some time, the USB port seems to become unavailable. I’m not sure if that has to do with my debugging attempt. When I unplug and replug the USB cable, I can read the serial monitor again. The error message looks as follows:

> Executing task: platformio device monitor --environment esp32dev <

--- Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at https://bit.ly/pio-monitor-filters
could not open port '/dev/cu.usbserial-5': [Errno 35] Could not exclusively lock port /dev/cu.usbserial-5: [Errno 35] Resource temporarily unavailable
The terminal process "platformio 'device', 'monitor', '--environment', 'esp32dev'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

When I then try to start a debug session after replugging the USB cable, I get an error popup saying:
Failed to launch GDB: .pioinit:11: Error in sourced command file: Remote replied unexpectedly to 'vMustReplyEmpty': timeout (from interpreter-exec console "source .pioinit")
And it offers me to either “Open ‘launch.json’” or cancel.

The output in the debug console looks as follows:

Reading symbols from /Users/nicolasschwandner/Documents/PlatformIO/Projects/220519-110805-arduino-blink/.pio/build/esp32dev/firmware.elf...
PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = esp-prog
PlatformIO: Initializing remote target...
Open On-Chip Debugger  v0.11.0-esp32-20220411 (2022-04-11-08:47)
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.
DEPRECATED! use 'adapter speed' not 'adapter_khz'
adapter speed: 5000 kHz

Info : tcl server disabled
Info : telnet server disabled
Info : clock speed 5000 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Warn : target esp32.cpu0 examination failed
Warn : target esp32.cpu1 examination failed
Info : starting gdb server for esp32.cpu0 on pipe
Info : accepting 'gdb' connection from pipe
Error: Target not examined yet
Error executing event gdb-attach on target esp32.cpu0:

Warn : No symbols for FreeRTOS!
Error: Target not halted
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.
Error: attempted 'gdb' connection rejected
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response
Ignoring packet error, continuing...
.pioinit:11: Error in sourced command file:
Remote replied unexpectedly to 'vMustReplyEmpty': timeout

Any idea, how I can get the debugger running?

Also, a side question that I came up with when trying to debug my code: Do I always have to first upload my code with the arrow icon before starting a debug session, or can I flash my program and start a debugging session with the “PIO Debug” play icon, if everything works as it should?

Thank you for your help! :raised_hands:t3:

To sort out the serial interfaces and drivers, you should only plug in one device at a time and then list the /dev/cu.usb... devices. It sounds as if you have both the development board and the ESP-Prog plugged in at the same time.

Regarding debugging:

This is an indication that the communication between your Macbook and the ESP-Prog is working, but that the communication between ESP-Prog and ESP32 is not.

Typical causes are:

  • Incorrect or poor wiring of GND, TMS, TCK, TDI and/or TDO
  • One the pins GPIO12 to GPIO15 is used for something else than debugging
  • ESP32 is in deep sleep

Thanks for your reply! My setup looks as follows:

I have a USB connection to the ESP-PROG, but the ESP32 board itself is only connected via the programmer and JTAG interface of the ESP-PROG. My device list before plugging in the ESP-PROG looks as follows:

And after plugging in the ESP-PROG:

I assume the fact that one (or rather two) devices too much are detected means that I still have a fragment of an old driver somewhere. Unfortunately, I’m unsure where this one could be, which is why it would be great if there would be a way to get the drivers back to as they are out of the box from Apple. I just went over the uninstall instructions from FTDI again (link), but couldn’t identify any additional steps I can take.

Regarding the ESP-PROG <-> ESP32 communication issue causes:

  • Incorrect or poor wiring of GND, TMS, TCK, TDI and/or TDO
    I double-checked the connections and used a multimeter to confirm proper contact. I didn’t fine any issues while doing this. I followed the tutorial linked above for matching the ESP-PROG pins with the pins of my ESP32 board. In this case, I could only imagine, that there’s an error with the matching in the tutorial, but then I’d be confused that I had it working previously. I’ll insert a picture of the pin matching and the instructions below.
  • One the pins GPIO12 to GPIO15 is used for something else than debugging
    I think it is hard to see on the picture above, but GPIO12 and GPIO15 are only connected to the JTAG interface of the ESP-PROG (15 is the gray cable, 12 is the violet one), so I think this should be no problem.
  • ESP32 is in deep sleep
    The build-in LED is flashing when the board is plugged in, since I uploaded the “arduino-blink” example program. I think the ESP32 shouldn’t be in deep sleep for that reason.

Excerpt from the tutorial I followed:

  1. Voltage connects to any Voltage Input Pin on your ESP32 Development Board. Just remember to match the voltage setting on the ESP-PROG board to the expected Voltage of your chosen Pin. In the image above, that’s 3.3v.
  2. TMS connects to GPIO14 on your ESP32 Development Board.
  3. Ground connects to any GND pin on your ESP32 Development Board.
  4. TCK connects to GPIO13 on your ESP32 Development Board.
  5. Not connected
  6. TDO connects to GPIO15 on your ESP32 Development Board.
  7. Not connected
  8. TDI connects to GPIO12 on your ESP32 Development Board.
  9. Not connected
  10. Not connected

Thanks for your help!

I’m assuming that the error hasn’t changed and is still:

From the first picture it looks as if you don’t provide power to the ESP32 dev board directly but only indirectly through ESP-Prog. I don’t recommend this. The voltage regulator on the ESP-Prog is not designed to feed a second device. So additionally provide power directly.

Regarding the wiring: It sounds ok but I cannot verify at, in particular because your images show two different ESP32 boards. Not that the wiring is only correct for ESP32 and not for ESP32-S2 or ESP32-S3.

I just tried to reproduce the error, which initially was only possible through starting a debug session, letting it time out, and then restarting another debugging session. When I started a debug session now, it produced an error message straight away. The error message is pasted below.

I’m unsure, why the behavior was different now. Could it be because I had another program flashed onto the ESP32 in the meantime, and it now had to flash the program from scratch?

PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = esp-prog
PlatformIO: Initializing remote target...
Open On-Chip Debugger  v0.11.0-esp32-20220411 (2022-04-11-08:47)
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.
DEPRECATED! use 'adapter speed' not 'adapter_khz'
adapter speed: 5000 kHz

Info : tcl server disabled
Info : telnet server disabled
Info : clock speed 5000 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: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
Info : starting gdb server for esp32.cpu0 on pipe
Info : accepting 'gdb' connection from pipe
Info : esp32.cpu0: Target halted, PC=0x40147732, debug_reason=00000000
Info : Set GDB target to 'esp32.cpu0'
Info : esp32.cpu1: Target halted, PC=0x4008C1D1, debug_reason=00000000
Warn : No symbols for FreeRTOS!
Info : esp32.cpu0: Target halted, PC=0x400803C0, debug_reason=00000001
Error: Failed to get flash maps (1073481520)!
Warn : Failed to get flash mappings (-4)!
Info : esp32.cpu0: Target halted, PC=0x400803C0, debug_reason=00000001
Info : esp32.cpu0: Target halted, PC=0x400803C0, debug_reason=00000001
Info : Auto-detected flash bank 'esp32.cpu0.flash' size 1048321 KB
Info : Using flash bank 'esp32.cpu0.flash' size 1048321 KB
Info : esp32.cpu0: Target halted, PC=0x400803C0, debug_reason=00000001
Error: Failed to get flash maps (1073481520)!
Warn : Failed to get flash mappings (-4)!
Info : esp32.cpu0: Target halted, PC=0x400803C0, debug_reason=00000001
Info : Using flash bank 'esp32.cpu0.irom' size 0 KB
Info : esp32.cpu0: Target halted, PC=0x400803C0, debug_reason=00000001
Error: Failed to get flash maps (1073481520)!
Warn : Failed to get flash mappings (-4)!
Info : esp32.cpu0: Target halted, PC=0x400803C0, debug_reason=00000001
Info : Using flash bank 'esp32.cpu0.drom' size 0 KB
Info : New GDB Connection: 1, Target esp32.cpu0, state: halted
0x40147732 in ?? ()
Error: FreeRTOS maximum used priority is unreasonably big, not proceeding: 64
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.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=00000000
Info : esp32.cpu0: Core was reset.
esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
Info : esp32.cpu1: Debug controller was reset.
esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
esp32.cpu1: Core was reset.
Info : esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
Info : esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
Error: Failed to get flash maps (9)!
Warn : Failed to get flash mappings (-4)!
Failed to get flash maps (9)!
Failed to get flash mappings (-4)!
Info : esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
Info : esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
Info : Auto-detected flash bank 'esp32.cpu1.flash' size 0 KB
Info : Using flash bank 'esp32.cpu1.flash' size 0 KB
Auto-detected flash bank 'esp32.cpu1.flash' size 0 KB
Using flash bank 'esp32.cpu1.flash' size 0 KB
** Programming Started **
** Programming Started **
Info : esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
Info : esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
Error: Failed to erase flash (9)!
Error: failed erasing sectors 1 to 5
Failed to erase flash (9)!
failed erasing sectors 1 to 5
embedded:startup.tcl:1162: Error: ** Programming Failed **
in procedure 'program_esp'
in procedure 'program_error' called at file "/Users/nicolasschwandner/.platformio/packages/tool-openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 157
at file "embedded:startup.tcl", line 1162
embedded:startup.tcl:1162: Error: ** Programming Failed **
in procedure 'program_esp'
in procedure 'program_error' called at file "/Users/nicolasschwandner/.platformio/packages/tool-openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 157
at file "embedded:startup.tcl", line 1162
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.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=00000000
Info : esp32.cpu0: Core was reset.
esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
Info : esp32.cpu1: Debug controller was reset.
esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
esp32.cpu1: Core was reset.
Info : esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
** Programming Started **
** Programming Started **
Info : esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
Info : esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
Error: Failed to erase flash (9)!
Error: failed erasing sectors 8 to 8
Failed to erase flash (9)!
failed erasing sectors 8 to 8
embedded:startup.tcl:1162: Error: ** Programming Failed **
in procedure 'program_esp'
in procedure 'program_error' called at file "/Users/nicolasschwandner/.platformio/packages/tool-openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 157
at file "embedded:startup.tcl", line 1162
embedded:startup.tcl:1162: Error: ** Programming Failed **
in procedure 'program_esp'
in procedure 'program_error' called at file "/Users/nicolasschwandner/.platformio/packages/tool-openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 157
at file "embedded:startup.tcl", line 1162
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.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
esp32.cpu0: Debug controller 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=00000000
Info : esp32.cpu0: Core was reset.
esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
Info : esp32.cpu1: Debug controller was reset.
esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
esp32.cpu1: Core was reset.
Info : esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
** Programming Started **
** Programming Started **
Info : esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
Info : esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
Error: Failed to erase flash (9)!
Error: failed erasing sectors 14 to 15
Failed to erase flash (9)!
failed erasing sectors 14 to 15
embedded:startup.tcl:1162: Error: ** Programming Failed **
in procedure 'program_esp'
in procedure 'program_error' called at file "/Users/nicolasschwandner/.platformio/packages/tool-openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 157
at file "embedded:startup.tcl", line 1162
embedded:startup.tcl:1162: Error: ** Programming Failed **
in procedure 'program_esp'
in procedure 'program_error' called at file "/Users/nicolasschwandner/.platformio/packages/tool-openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 157
at file "embedded:startup.tcl", line 1162
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.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
esp32.cpu0: Debug controller 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=00000000
Info : esp32.cpu0: Core was reset.
esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
Info : esp32.cpu1: Debug controller was reset.
esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
esp32.cpu1: Core was reset.
Info : esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
** Programming Started **
** Programming Started **
Info : esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
Info : esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
Error: Failed to erase flash (9)!
Error: failed erasing sectors 16 to 67
Failed to erase flash (9)!
failed erasing sectors 16 to 67
embedded:startup.tcl:1162: Error: ** Programming Failed **
in procedure 'program_esp'
in procedure 'program_error' called at file "/Users/nicolasschwandner/.platformio/packages/tool-openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 157
at file "embedded:startup.tcl", line 1162
embedded:startup.tcl:1162: Error: ** Programming Failed **
in procedure 'program_esp'
in procedure 'program_error' called at file "/Users/nicolasschwandner/.platformio/packages/tool-openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 157
at file "embedded:startup.tcl", line 1162
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.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=00000000
Info : esp32.cpu0: Core was reset.
esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
Info : esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
esp32.cpu1: Debug controller was reset.
esp32.cpu1: Core was reset.
Info : esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
Temporary breakpoint 1 at 0x400d0d4b: file src/Blink.cpp, line 15.
PlatformIO: Initialization completed
PlatformIO: Resume the execution to `debug_init_break = tbreak setup`
PlatformIO: More configuration options -> https://bit.ly/pio-debug
Warn : address 0x400d0d4b 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
Warn : address 0x400d0d62 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
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x400d0d4b
Cannot insert breakpoint 2.
Cannot access memory at address 0x400d0d62

Command aborted.

When trying to reproduce this error another time, the “setup” breakpoint was actually hit, but when I let the program run to hit the next breakpoint, which is located in the loop() function, it didn’t get there (see picture below). There were error messages in the debug console, which I pasted below the picture. It is very strange that the behavior is changing.

Reading symbols from /Users/nicolasschwandner/Documents/PlatformIO/Projects/220519-110805-arduino-blink/.pio/build/esp32dev/firmware.elf...
PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = esp-prog
PlatformIO: Initializing remote target...
Open On-Chip Debugger  v0.11.0-esp32-20220411 (2022-04-11-08:47)
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.
DEPRECATED! use 'adapter speed' not 'adapter_khz'
adapter speed: 5000 kHz

Info : tcl server disabled
Info : telnet server disabled
Info : clock speed 5000 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=0x4000921F, debug_reason=00000000
Info : esp32.cpu1: Target halted, PC=0x400076DD, debug_reason=00000000
Info : starting gdb server for esp32.cpu0 on pipe
Info : accepting 'gdb' connection from pipe
Warn : No symbols for FreeRTOS!
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
Info : Set GDB target to 'esp32.cpu0'
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 196 KB
Info : Flash mapping 1: 0x50020 -> 0x400d0020, 512 KB
Info : esp32.cpu0: Target halted, PC=0x4009260E, 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=0x4009260E, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 196 KB
Info : Flash mapping 1: 0x50020 -> 0x400d0020, 512 KB
Info : Using flash bank 'esp32.cpu0.irom' size 516 KB
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 196 KB
Info : Flash mapping 1: 0x50020 -> 0x400d0020, 512 KB
Info : Using flash bank 'esp32.cpu0.drom' size 200 KB
Info : New GDB Connection: 1, Target esp32.cpu0, state: halted
0x4000921f in ?? ()
Error: FreeRTOS maximum used priority is unreasonably big, not proceeding: 64
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.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=00000000
Info : esp32.cpu0: Core was reset.
esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
Info : esp32.cpu1: Debug controller was reset.
esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
esp32.cpu1: Core was reset.
Info : esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 196 KB
Info : Flash mapping 1: 0x50020 -> 0x400d0020, 512 KB
Flash mapping 0: 0x10020 -> 0x3f400020, 196 KB
Flash mapping 1: 0x50020 -> 0x400d0020, 512 KB
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
Info : Auto-detected flash bank 'esp32.cpu1.flash' size 4096 KB
Info : Using flash bank 'esp32.cpu1.flash' size 4096 KB
Auto-detected flash bank 'esp32.cpu1.flash' size 4096 KB
Using flash bank 'esp32.cpu1.flash' size 4096 KB
** Programming Started **
** Programming Started **
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
Info : PROF: Data transferred in 109.827 ms @ 182.105 KB/s
PROF: Data transferred in 109.827 ms @ 182.105 KB/s
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
** Programming Finished **
** Programming Finished **
** Verify Started **
** Verify Started **
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
** 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.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
esp32.cpu0: Debug controller 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=00000000
Info : esp32.cpu0: Core was reset.
esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
Info : esp32.cpu1: Debug controller was reset.
esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
esp32.cpu1: Core was reset.
Info : esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
** Programming Started **
** Programming Started **
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
Info : PROF: Data transferred in 31.007 ms @ 129.003 KB/s
PROF: Data transferred in 31.007 ms @ 129.003 KB/s
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
** Programming Finished **
** Programming Finished **
** Verify Started **
** Verify Started **
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
** 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.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
esp32.cpu0: Debug controller 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=00000000
Info : esp32.cpu0: Core was reset.
esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
Info : esp32.cpu1: Debug controller was reset.
esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
esp32.cpu1: Core was reset.
Info : esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
** Programming Started **
** Programming Started **
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
Info : PROF: Data transferred in 48.477 ms @ 165.027 KB/s
PROF: Data transferred in 48.477 ms @ 165.027 KB/s
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
** Programming Finished **
** Programming Finished **
** Verify Started **
** Verify Started **
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
** 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.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=00000000
Info : esp32.cpu0: Core was reset.
esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
Info : esp32.cpu1: Debug controller was reset.
esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
esp32.cpu1: Core was reset.
Info : esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
** Programming Started **
** Programming Started **
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
Info : PROF: Data transferred in 1116.02 ms @ 186.377 KB/s
PROF: Data transferred in 1116.02 ms @ 186.377 KB/s
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
** Programming Finished **
** Programming Finished **
** Verify Started **
** Verify Started **
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
** 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.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
esp32.cpu0: Debug controller 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=00000000
Info : esp32.cpu0: Core was reset.
esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
Info : esp32.cpu1: Debug controller was reset.
esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
esp32.cpu1: Core was reset.
Info : esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
Temporary breakpoint 1 at 0x400d0d4b: file src/Blink.cpp, line 15.
PlatformIO: Initialization completed
PlatformIO: Resume the execution to `debug_init_break = tbreak setup`
PlatformIO: More configuration options -> https://bit.ly/pio-debug
Note: automatically using hardware breakpoints for read-only addresses.
Info : esp32.cpu0: Target halted, PC=0x400DB732, debug_reason=00000000
esp32.cpu0: Target halted, PC=0x400DB732, debug_reason=00000000
Info : Set GDB target to 'esp32.cpu0'
Set GDB target to 'esp32.cpu0'
Info : esp32.cpu1: Target halted, PC=0x400D0D4B, debug_reason=00000001
esp32.cpu1: Target halted, PC=0x400D0D4B, debug_reason=00000001
[New Thread 1073468984]
[New Thread 1073469344]
[New Thread 1073458404]
[New Thread 1073463388]
[New Thread 1073456804]
[New Thread 1073468624]
[Switching to Thread 1073449076]

Thread 1 "loopTask" hit Temporary breakpoint 1, setup () at src/Blink.cpp:15
15	  pinMode(LED_BUILTIN, OUTPUT);
Error: esp32.cpu1: DSR (FFFFFFFF) indicates target still busy!
Error: esp32.cpu1: DSR (FFFFFFFF) indicates DIR instruction generated an exception!
Error: esp32.cpu1: DSR (FFFFFFFF) indicates DIR instruction generated an overrun!
esp32.cpu1: DSR (FFFFFFFF) indicates target still busy!
esp32.cpu1: DSR (FFFFFFFF) indicates DIR instruction generated an exception!
esp32.cpu1: DSR (FFFFFFFF) indicates DIR instruction generated an overrun!
Error: esp32.cpu0: DSR (FFFFFFFF) indicates target still busy!
Error: esp32.cpu0: DSR (FFFFFFFF) indicates DIR instruction generated an exception!
Error: esp32.cpu0: DSR (FFFFFFFF) indicates DIR instruction generated an overrun!
esp32.cpu0: DSR (FFFFFFFF) indicates target still busy!
esp32.cpu0: DSR (FFFFFFFF) indicates DIR instruction generated an exception!
esp32.cpu0: DSR (FFFFFFFF) indicates DIR instruction generated an overrun!
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.cpu1: Debug controller was reset.
esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
esp32.cpu1: Core was reset.

Regarding the power supply: I, unfortunately, don’t have much hardware available. Is there a sleek way of doing this? The ESP32 board doesn’t have a USB jack and I also don’t have an external power supply available here. Otherwise, any recommendations for a handy and cheap power supply?

Regarding the wiring: There’s an ESP32-WROOM-32E on the board I’m using. From what I can tell from the Espressif website, this should be the normal one (ESP32 - link).

Debugging seems to be partially working. It’s very difficult to diagnose the problem. What kind of board do you have? Is it a custom board? Are you sure it’s fully working?

I recommend to do two things:

  • Improve the power supply. I’m afraid I don’t have a good idea without know what you have around. You’ll probably find some device where you can tap of 3.3V.
  • Lower the speed of the debug adapter. This should be possible with debug_speed = 500 in platformio.ini.

Thanks a lot for your help! I agree the inconsistency of the problems makes it very hard to diagnose. I am using an Adafruit Huzzah ESP32 breakout board (Overview | Adafruit HUZZAH32 – ESP32 Breakout Board | Adafruit Learning System). I can’t tell with certainty, but I believe the board is working fine.

I tried to improve the power supply by powering the ESP32 board with an external battery that I still had lying around. I disconnected the VCC supply pins connecting the ESP-PROG and the ESP32 board (felt safer to do) while keeping the GND pins connected. I also adjusted the debug speed as you mentioned. I can program the ESP32 board, but debugging still doesn’t work properly.

Since I still seem to have driver fragments somewhere hidden in my system (detecting 4 devices instead of 2), I’ll try to debug from another computer and see how that goes. I will update you on how this went.

I think I found the problem. Pin 13 is connected to TCK of the debugging port, but also to the built-in LED, which I tried to control via my code. I assume that manually pulling this pin to HIGH or LOW messed up the communication of the debug port. If I change the pin number for the built-in LED, I can debug the code without problems.

I thought I was clever to use the built-in LED, so I don’t have to manually add one externally, but it turns out, that I shouldn’t have done that. Thanks for your support @manuelbl