PlatformIO Community

No such file or directory found, looking for folder that doesn't exist

Hey guys,
Long time lurker. I’m running into an issue when uploading to an ESP32 via ESP-PROG. I’m able to upload just fine via USB. When using the ESP-PROG I get the following error:

C:\Users\Colton Miller.platformio\python3\python.exe: can’t open file ‘C:\Users\Colton’: [Errno 2] No such file or directory

You can see it’s looking for "Users\Colton " which doesn’t exist. I’ve reinstalled VS, PlatformIO, and Python, still the same result.

Additionally I narrowed it down to including “upload_protocol = esp-prog” in plaformio.ini creating the issue.

Any help is much appreciated!
Thanks!

With what platformio.ini is that?

[env:esp32doit-devkit-v1]

platform = espressif32
board = esp32doit-devkit-v1
framework = arduino
lib_deps = adafruit/Adafruit NeoPixel@^1.10.5
monitor_speed = 115200
debug_speed = 500
debug_tool = esp-prog
upload_protocol = esp-prog

Open a CLI and execute pkg update -g -p espressif32. Does the problem persist?

Same result but lead to a more specific error:
C:\Users\Colton Miller.platformio\python3\python.exe: can’t open file ‘C:\Users\Colton’: [Errno 2] No such file or directory
*** [.pio\build\esp32doit-devkit-v1\patched_bootloader.bin] Error 2

Then there is an issue with path escaping somewhere – report this to Issues · platformio/platform-espressif32 · GitHub.

In the meantime, the only “fix” is redirecting the core directory to a path with no spaces.

[platformio]
core_dir = C:\pio

Add that at the top of the platformio.ini and create the folder C:\pio beforehand and give access to regular user in the windows file permission tab.

Thank you! That resolved the issue!

Now I’m able to upload to the ESP32 via ESP-PROG. It says it was successful but I’m getting no action from the board and the ESP-PROG does not flash green when uploading.

Thank you for all of the help!

What code are you running?

A basic Hello World.

I’ve narrowed it down (I think) to serial comm issue. I’ve been through the schematics and checked each connection but nothing stuck out. Here is the error readout I’m getting now:

"
** Programming Started **
Error: timed out while waiting for target halted
Error: xtensa_wait_algorithm: not halted 0, pc 0x4000c2f3, ps 0x60e23
Error: Failed to wait algorithm (-302)!
Error: Algorithm run failed (-302)!
Error: Target is already running an algorithm
Error: Failed to start algorithm (-4)!
Error: Target is already running an algorithm
Error: Failed to start algorithm (-4)!
** Programming Finished in 41133 ms **
** Verify Started **
Error: Target is already running an algorithm
Error: Failed to start algorithm (-4)!
Error: **** Verification failure! ****
Error: target_hash 7cf29e…000
Error: file_hash: f3f523…3ddc45
embedded:startup.tcl:1184: Error: ** Verify Failed **
in procedure ‘program_esp’
in procedure ‘program_error’ called at file “C:/pio/packages/tool-openocd-esp32/share/openocd/scripts/target/esp_common.cfg”, line 149
at file “embedded:startup.tcl”, line 1184
*** [upload] Error 1
"

If I go to erase anything on the flash I get:
"
A fatal error occurred: Failed to connect to ESP32: No serial data received.
For troubleshooting steps visit: Troubleshooting - ESP32 - — esptool.py latest documentation
*** [erase] Error 2
"

Albeit while erasing the green LED on the ESP-PROG is flashing.

Thanks for the help. -Colton

I think erase flash is hardcoded to invoke esptool.py, not use the JTAG adapter.

You can try to connect the serial port of the esp-prog to the ESP32 and flash it regularly via serial again.

It was a bad USB cable causing the secondary issue. Just when you think you have it figured out haha! Thank you for all of the help, it’s working like a charm now.

1 Like