I have a strange problem with my custom PCB. It has worked flawlessly for some weeks, but a few days ago the problems started. At first, I couldn’t upload code to my ESP32 anymore the Error messages I got were different each time:
- A fatal error occurred: Invalid SLIP escape (0xdb, 0xEE)
- A fatal error occurred: Failed to write compressed data to flash after seq 18 (result was 8000)
- A fatal error occurred: Invalid head of packet (0xE0)
After I restarted my computer, it worked again for some time. Today the problems reoccurred.
I already tried many things:
- Changed USB cable
- Used the Arduino IDE
- Reduced upload speed
- Added upload_flags = --no-stub
- Used a different FT232RL
The ESP32 I used is the ESP32-WROOM-32E(M113EH2800PH3Q0) / ESP32-D0WD-V3.
If I google “Chip is ESP32 in Secure Download Mode” I encounter articles about Flash encryption, is it possible that I somehow bricked my ESP32?
Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
-----------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (3.4.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 3.10006.210326 (1.0.6)
- tool-esptoolpy 1.30100.210531 (3.1.0)
- tool-mkspiffs 2.230.0 (2.30)
- toolchain-xtensa32 2.50200.97 (5.2.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 31 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ESP Async WebServer> 1.2.3
| |-- <AsyncTCP> 1.1.1
| |-- <FS> 1.0
| |-- <WiFi> 1.0
| |-- <ArduinoJson> 6.18.5
|-- <ArduinoJson> 6.18.5
|-- <SPIFFS> 1.0
| |-- <FS> 1.0
|-- <WiFi> 1.0
Building in release mode
Retrieving maximum program size .pio\build\esp32dev\firmware.elf
Checking size .pio\build\esp32dev\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [= ] 13.3% (used 43492 bytes from 327680 bytes)
Flash: [======== ] 77.0% (used 1009550 bytes from 1310720 bytes)
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: COM5
Uploading .pio\build\esp32dev\firmware.bin
esptool.py v3.1
Serial port COM5
Connecting.....
Chip is ESP32 in Secure Download Mode
Changing baud rate to 460800
A fatal error occurred: Invalid head of packet (0x80)
*** [upload] Error 2
======================================= [FAILED] Took 4.54 seconds =======================================
The terminal process "C:\Users\Maximilan\.platformio\penv\Scripts\platformio.exe 'run', '--target', 'upload'" terminated with exit code: 1.