📘 Export hex and binary file (firmware) from STM32CubeIDE
By default settings in the STM32CubeIDE the hex and bin files are not generated, when project is build. But, if you need this files to use as the firmware file it's easily to turn on generating hexadecimal and binary file of project output.
➡ Step-by-step Instruction
1) Find you project in Project Explorer or just find real location.
2) Highlight project name (left click) and press Shift + Alt + W, then choose System Explorer:
3) In project directory open Debug folder, here is several output files, but HEX or BIN not present:
4) Open any project file and make active (by mouse click in file content), then go to Project -> Properties:
5) Go to C/C++ Build -> Settings -> MCU Post build outputs and enable following outputs:
- Convert to binary file (-O binary)
- Convert to Intel Hex file (-O ihex)
Then press Apply and Close.
6) Now you have the build project again (right click on project name -> Build Project):
7) If above there are no code errors (when build project), in the output folder Debug the required files is available:
- ✅ .bin
- ✅ .hex
In fact, the .bin and .hex files could be created from .eIf file, so modern programming software STM32CubeProgrammer could deal with elf directly ?.