androiddrew wrote: ↑Fri Jul 30, 2021 1:10 pm
When do I select one option over the other?
As Dave said "Which one to use depends on the programmer being used."
As a quick guide:
- ESP32 / ESP8266 will typically always use a .bin file and esptool will indicate where to program it.
- Many STM32 boards have USB DFU bootloaders, and the programmer software you use will accept either a .dfu (dfu-util, pydfu), or a .hex (STM32CubeProgrammer), or a .bin. (Confusingly, even though the programmer uses DFU (or DFUSe) to talk to the device bootloader, it may support multiple file types).
- DAPLink (e.g. micro:bit) and STLink-based boards can present as a mass storage device, which can be programmed with a .hex file (by dragging the .hex file to the device).
- Debuggers (e.g. GDB) can load .elf files.
It's also worth knowing about the .uf2 file format, which is used for uf2 bootloader (very common on CircuitPython boards, as well as the RP 2040/Pico). It works like a .hex file in that you drag it onto the USB Mass Storage drive, but internally it's a binary format more similar to .dfu).
androiddrew wrote: ↑Fri Jul 30, 2021 1:10 pm
Are there memory implications with using the larger .hex to flash my board over a smaller .bin file?
Like Dave said, they all contain the same data, it's just about whatever your programmer/board needs (and you might have multiple options).
(The one exception is that the .elf contains more information that isn't necessary for runtime)