How to make bin file using Platformio IDE?

Hello !

I am trying to make .bin files from my usual .cpp files and I have no idea how to do that.

I am trying to implement Firmware Update by uploading a .bin file.

I have never used PIO Commands. I’ve only used CTRL+ALT+B and CTRL+ALT+U.

platform =
board = esp32-evb
framework = arduino
board_build.flash_mode = qio
upload_port = /dev/ttyUSB0
monitor_port = /dev/ttyUSB0
monitor_speed = 115200
upload_speed = 115200
build_flags = -DCORE_DEBUG_LEVEL=5

lib_deps =

PlatformIO already generates .bin files as part of the compile process… if you browse to the .pioenvs / .pio/build / name-of-env folder of your project, you’ll find firmware.bin.

Alternately, it’s mentioned as one of the last few lines of the build process, and you should get a message about being able to Ctrl + Click on the path to navigate to it… which will at least find the file for you in the sidebar.


1 Like

I found the firmware.bin inside /project_name/.pioenvs/esp32-evb

But I don’t get a message about it when I build.

This is all I get:

Processing esp32-evb (framework: arduino; platform:; board: esp32-evb)
Verbose mode can be enabled via `-v, --verbose` option
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)
Library Dependency Finder ->
Collected 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ESP Async WebServer> 1.2.2 #b0c6144
|   |-- <AsyncTCP> 1.1.0 #d1f28ff
|   |-- <WiFi> 1.0
|   |-- <FS> 1.0
|-- <AsyncTCP> 1.1.0 #d1f28ff
|-- <WiFi> 1.0
|-- <SPIFFS> 1.0
|   |-- <FS> 1.0
Retrieving maximum program size .pioenvs/esp32-evb/firmware.elf
Checking size .pioenvs/esp32-evb/firmware.elf
Memory Usage ->
DATA:    [=         ]  11.9% (used 38968 bytes from 327680 bytes)
PROGRAM: [======    ]  62.1% (used 813682 bytes from 1310720 bytes)
============================================================================== [SUCCESS] Took 1.92 seconds ==============================================================================

Terminal will be reused by tasks, press any key to close it.

You get WAAAAY more info than me.

Yeah… just ran it again… and didn’t get it. It’s because it was a from scratch build. If I clean the build files out it’ll take a while to rebuild everything, and will show it. Could probably add a extra_script to show that… but it’s easy enough to find the file if needed.

1 Like

Yep. It makes the firmware.bin only if you’ve actually changed something to the code.

Great. Thanks !

1 Like