Get esptool.py arguments

Hey everybody,

is there a way to print out which arguments PlatformIO uses to invoke esptool? Reason: I’m having trouble to flash the binary with any other tool. I suspect that there is some underhood magic/ bootloader flashing happening at the beginning (0x00001000, 0x00008000, 0x0000e000) before the real binary is written (0x00010000+):

Auto-detected: /dev/ttyUSB0
Uploading .pio/build/az-delivery-devkit-v4/firmware.bin
esptool.py v3.3
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP32-D0WD-V3 (revision 3)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 78:21:84:bc:1a:ac
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x00103fff...
Compressed 17088 bytes to 11848...
Writing at 0x00001000... (100 %)
Wrote 17088 bytes (11848 compressed) at 0x00001000 in 0.6 seconds (effective 213.7 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 128...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.1 seconds (effective 309.0 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.2 seconds (effective 409.6 kbit/s)...
Hash of data verified.
Compressed 999088 bytes to 630011...
Writing at 0x00010000... (2 %)
Writing at 0x0001bb73... (5 %)
Writing at 0x000276e8... (7 %)
Writing at 0x0003167b... (10 %)
Writing at 0x000406be... (12 %)
Writing at 0x000460a9... (15 %)
...

How can I reproduce exactly the same in the CLI?

I only found this but it was not helpful.

Thanks,
Bernhard.

Project task → Advanced → Verbose Upload.

1 Like

Thanks for the reply! Unfortunately that’s what I was referring with my link above. That’s just way to spammy. Anything I could look for? Search for "upload did not yield anything…

Use the “Build” task first, then the “Verbose Upload” task. Still – the very last lines of the verbose upload command do contain the upload command.

Sweet! FYI for the others:

"/home/bernhard/.platformio/penv/bin/python" "/home/bernhard/.platformio/packages/tool-esptoolpy/esptool.py" --chip esp32 --port "/dev/ttyUSB0" --baud 460800 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size 4MB 0x1000 /home/bernhard/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/bin/bootloader_dio_40m.bin 0x8000 /home/bernhard/Desktop/wd/BierBot-Brick-ESP32/.pio/build/az-delivery-devkit-v4/partitions.bin 0xe000 /home/bernhard/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin 0x10000 .pio/build/az-delivery-devkit-v4/firmware.bin

So there is a bootloader being flashed! :slight_smile: Is there a way to package all of that into a single binary that I can give to others? Pragmatic way would be to download it from the ESP32…

Edit: Actually, that’s suggested here: ESP32: How to create one, solid firmware package that will include bootloader, etc. in a single file?