No such file or directory: /Users/mac/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/bin/bootloader__40m.bin'

When I try to Upload using Platformio in VS Code on MacOS Big Sur I’m getting the following error:

esptool write_flash: error: argument <address> <filename>: [Errno 2] No such file or directory: '/Users/mac/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/bin/bootloader__40m.bin'
*** [upload] Error 2

The project works on Windows 11. Platformi INI parameters:

platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream
framework = arduino

This branch is outdated beyond belief, please don’t use it. The latest regular release (5.1.0) (Releases · platformio/platform-espressif32 · GitHub) has support for the latest released Arduino-ESP32 v2.0.4, so if you want to use that, jsut set platform = espressif32.

@maxgerhardt After I changed it it worked fine.

platform =  https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream
platform_packages =
   framework-arduinoespressif32@https://github.com/espressif/arduino-esp32.git#2.0.3

Now I have the following problem with uploading. Please take a look log below:

Configuring upload protocol...
AVAILABLE: esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esptool
Looking for upload port...
Auto-detected: /dev/cu.usbserial-1120
Uploading .pio/build/HUBER_M1_L1/firmware.bin
esptool.py v3.1
Serial port /dev/cu.usbserial-1120
Connecting....
Chip is ESP32-D0WD-V3 (revision 3)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
WARNING: Detected crystal freq 41.24MHz is quite different to normalized freq 40MHz. Unsupported crystal in use?
Crystal is 40MHz
MAC: 34:94:54:bb:2b:50
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...

A fatal error occurred: Timed out waiting for packet header
*** [upload] Error 2
============= [FAILED] Took 15.32 seconds =============

Again, I absolutely cannot recommend doing that, this branch is a whopping 112 commits behind master (Branches · platformio/platform-espressif32 · GitHub) and may use others lots of outdated version, like esptool.py, causing the error you have now.

@maxgerhardt Tested also with

platform = espressif32
platform_packages =
   framework-arduinoespressif32@https://github.com/espressif/arduino-esp32.git#2.0.3

Same error as above in a process of flashing.

Try setting upload_speed = 115200 in the platformio.ini.

With 115200 it works. Thank you.