I have been trying with .bin files from both PlatformIO and Arduino to create a firmware that I can use with ESP Web Tools. Both IDEs are able to upload directly to the board just fine.
On PlatformIO I prepare it with:
/tmp/esptool-4.8.dev3/esptool.py --chip esp32c3 merge_bin \
-o esp32c3.bin \
--flash_mode dio \
--flash_freq 80m \
--flash_size 4MB \
0x0000 .pio/build/seeed_xiao_esp32c3/bootloader.bin \
0x8000 .pio/build/seeed_xiao_esp32c3/partitions.bin \
0xe000 ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin \
0x10000 .pio/build/seeed_xiao_esp32c3/firmware.bin
On Arduino I prepare it with something similar to:
/tmp/esptool-4.8.dev3/esptool.py --chip esp32c3 merge_bin \
-o esp32c3.bin \
--flash_mode dio \
--flash_freq 80m \
--flash_size 4MB \
0x0000 /var/folders/jl/35wyjq9s11s42_f8dvsf0j7c0000gn/T/arduino/sketches/DABE31BE92B76264E310C5D6F7227800/hello.ino.bootloader.bin \
0x8000 /var/folders/jl/35wyjq9s11s42_f8dvsf0j7c0000gn/T/arduino/sketches/DABE31BE92B76264E310C5D6F7227800/hello.ino.partitions.bin \
0xe000 .../Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/partitions/boot_app0.bin \
0x10000 /var/folders/jl/35wyjq9s11s42_f8dvsf0j7c0000gn/T/arduino/sketches/DABE31BE92B76264E310C5D6F7227800/hello.ino.bin
Every time I try and flash it, when I monitor I get:
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x7 (TG0WDT_SYS_RST),boot:0x9 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40053f88
invalid header: 0x434c4557
invalid header: 0x434c4557
invalid header: 0x434c4557
invalid header: 0x434c4557
invalid header: 0x434c4557
invalid header: 0x434c4557
invalid header: 0x434c4557
.... <serious number of times> ...
invalid header: 0x434c4557
invalid header: 0x434c4557
invalid header: 0x434c4557
invalid header: 0x434c4557
invalid header: 0x434c4557
invalid header: 0x434c4557
invalid header: 0x434c4557
I appreciate any help anyone can give how might have done this already. Thanks!
Hi there,
Yea, Doesn’t look correct IMO.
Can you post the actual code for arduino compile. use the code tags please , </> above
It’s a process , I can check it I can post back a BIN or HEX or UF2
HTH
GL PJ
@PJ_Glasso Thanks for replying. Mind expanding on what doesn’t look correct? Note that I removed some identifying information from paths.
Sorry but I am not at liberty to post the code but I get the same exact outcome when doing a simple hello world:
#include <Arduino.h>
void setup() {
Serial.begin(921600); while(!Serial); delay(200);
Serial.println(String(millis()) + " Hello from setup: " + String(ESP.getEfuseMac()));
}
void loop() {
Serial.println(String(millis()) + " Hello from loop: " + String(ESP.getEfuseMac()));
delay(1000);
}
Hi there,
LOL, Ok
I used Arduino, Compiled and built, flashed individually the group
then combined them and flashed that , in between I flashed a SD card, Read sketch for validation each time.
Well Works Fine,
Compiler Output
esptool.py v4.5.1
Creating esp32c3 image...
Merged 2 ELF sections
Successfully created esp32c3 image.
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.11/tools/gen_esp32part.exe" -q "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\1B532610C9C03DA361C31EFFAA5A57CB/partitions.csv" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\1B532610C9C03DA361C31EFFAA5A57CB/sketch_mar21a_hello_9600.ino.partitions.bin"
cmd /c if exist "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\1B532610C9C03DA361C31EFFAA5A57CB\\libraries\\Insights" "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.11/tools/gen_insights_package.exe" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\1B532610C9C03DA361C31EFFAA5A57CB" sketch_mar21a_hello_9600.ino "D:\\Arduino_projects\\sketch_mar21a_hello_9600"
cmd /c IF 0==1 COPY /y "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\openocd-esp32\\v0.11.0-esp32-20221026\\share\\openocd\\scripts\\board\\esp32c3-builtin.cfg" "D:\\Arduino_projects\\sketch_mar21a_hello_9600\\debug.cfg"
cmd /c IF 0==1 COPY /y "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.11\\tools\\ide-debug\\esp32c3.json" "D:\\Arduino_projects\\sketch_mar21a_hello_9600\\debug_custom.json"
cmd /c IF 0==1 COPY /y "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.11\\tools\\ide-debug\\svd\\esp32c3.svd" "D:\\Arduino_projects\\sketch_mar21a_hello_9600\\debug.svd"
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\riscv32-esp-elf-gcc\\esp-2021r2-patch5-8.4.0/bin/riscv32-esp-elf-size" -A "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\1B532610C9C03DA361C31EFFAA5A57CB/sketch_mar21a_hello_9600.ino.elf"
Sketch uses 228422 bytes (17%) of program storage space. Maximum is 1310720 bytes.
Global variables use 13552 bytes (4%) of dynamic memory, leaving 314128 bytes for local variables. Maximum is 327680 bytes.
here’s your Serial output (9600) baud BTW.
353 Hello from setup: 150234723153568
353 Hello from loop: 150234723153568
1353 Hello from loop: 150234723153568
2358 Hello from loop: 150234723153568
3358 Hello from loop: 150234723153568
4363 Hello from loop: 150234723153568
5363 Hello from loop: 150234723153568
and here’s the Zip with a Bin
target.zip (141.4 KB)
You can drop that directly on with EspRFTestTool and press reset to get same output as above.
FYI , USB must be plugged in, Your code has (While Serial) So…
HTH
GL PJ
P.S. I followed my own Guide here, maybe you should too.
@PJ_Glasso Thank you for trying to help. In the end it was not related to esptool.py and everything I was doing to build the merged firmware was correct.
The issue was coming from ESP Web Tools trying to upload a firmware that did not exist.
1 Like