I want to move my development to Platform IO on linux from Arduino on Windows for a new complex project. I have built and downloaded an image to “firebeetle32” ESP32 board in Arduino IDE on windows (dead simple “blink the LED” in 1 main.cc file). No issues. I wanted to learn Platform IO using this simple setup. I started by installing VSCode-PlatformIO on my new Pi5. Set everything up, ran the build, no issues. However, I cannot get the program uploaded to the ESP32 test board. There is a problem with the image or upload via Platform IO. When I run esptool directly on the Pi using the Arduino combined image at offset 0, everything works fine. So I have eliminated the Pi and underlying linux causing problems. Yet, just using Platform IO, it doesn’t work.
Below are the key items from the logs of the download and the output of the ESP32 failure. There is nothing special I am trying to do, everything should be default. As I said, when I use esptool directly and upload the Arduino combined binary at offset 0, everything works…
Platform IO ini file:
[env:firebeetle32]
platform = espressif32
board = firebeetle32
framework = arduino
monitor_speed = 115200
upload_speed = 115200
…
Hash of data verified.
Compressed 269376 bytes to 149404…
Writing at 0x00010000… (10 %)
Writing at 0x0001c484… (20 %)
Writing at 0x00024a7e… (30 %)
Writing at 0x00029d00… (40 %)
Writing at 0x0002f273… (50 %)
Writing at 0x000347e6… (60 %)
Writing at 0x0003d47e… (70 %)
Writing at 0x00046285… (80 %)
Writing at 0x0004b812… (90 %)
Writing at 0x00051093… (100 %)
Wrote 269376 bytes (149404 compressed) at 0x00010000 in 13.2 seconds (effective 163.1 kbit/s)…
Hash of data verified.
Leaving…
Hard resetting via RTS pin…
========================================================= [SUCCESS] Took 23.98 seconds =========================================================
*
CONSOLE OUTPUT
Rebooting…
ets Jun 8 2016 00:22:57
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:13232
load:0x40080400,len:3028
entry 0x400805e4
E (148) spi_flash: Detected size(4096k) smaller than the size in the binary image header(16384k). Probe failed.
assert failed: do_core_init startup.c:328 (flash_ret == ESP_OK)
Backtrace: 0x4008344d:0x3ffe3ab0 0x400880e1:0x3ffe3ad0 0x4008d021:0x3ffe3af0 0x400da2d2:0x3ffe3c20 0x40082b79:0x3ffe3c50 0x40079306:0x3ffe3c90 |<-CORRUPTED
ELF file SHA256: ccebb76b7ef1222b
E (171) esp_core_dump_flash: Core dump flash config is corrupted! CRC=0x7bd5c66f instead of 0x0
Rebooting…