Skip to main content
CARHERO
Associate II
May 2, 2019
Solved

How to generate *.bin file after building with CubeIDE?

  • May 2, 2019
  • 7 replies
  • 34938 views

0690X000008B9YlQAK.pngHello Cube IDE team

I am using STM32F427ZG MCU board with STM32CubeIDE

But I have trouble to generate *.bin file after building with CubeIDE.

I think it support *.elf file only for now.

If below command can be added into makefile, then *.bin file can be generated by CubeIDE

arm-none-eabi-objcopy -O binary STM32F427ZG.elf STM32F427ZG.bin

I modified this file to generate *.bin file but every time building the IDE project, makefile was re-generated automatically by IDE so i couldn't test it.

Could you update it to generate *.bin or *.hex file?

Best answer by troky

Go to project properties: C/C++ Bulild->Settings->Tool Settings->MCU Post Build outputs

0690X000008BBaZQAW.png

7 replies

troky
trokyBest answer
Associate
May 2, 2019

Go to project properties: C/C++ Bulild->Settings->Tool Settings->MCU Post Build outputs

0690X000008BBaZQAW.png

Explorer
October 6, 2024

Thank you.

CARHERO
CARHEROAuthor
Associate II
May 3, 2019

Thank you troky

After selecting "Convert to binary file" and "Convert to Hex file" option in the Tool Settings, *.bin and *.hex files are generated successfully.

CLee.0
Associate III
August 27, 2019

Problem: I had the same issue and tried the above solution, however C/C++ Bulild->Settings->Tool Settings does not show an option '->MCU Post Build outputs' so I cannot select the Conversions as shown above. (See screen shot)

How to make the ->MCU Post Build outputs option appear in the first place?

Thanks.

CARHERO
CARHEROAuthor
Associate II
September 2, 2019

Did you generate with STM32 Project?

I think there may have wrong project setting.

DPISA.1
Visitor II
January 29, 2020

Make sure you choose project properties NOT from FILE-PROPERTIES but first right-click on the STM32Project from Project Explorer. Then choose Properties.

This should work.

Jack3
Senior
September 3, 2020

I use STM32CubeIDE 1.4.2, and made the selections as indicated above, but no bin wile will be generated after rebuilding the project.

The project had been imported from a TrueStudio 9.3.0 project, previously.

What can I do to generate the bin file?

CARHERO
CARHEROAuthor
Associate II
September 3, 2020

0693W000003QfL4QAK.pngI tested it with v1.4.2 and got the *.hex and *.bin correctly.

You should get the below console log like below if *.hex and *.bin file is selected to be generated

19:40:48 **** Incremental Build of configuration Debug for project STM32F427ZI ****

make -j8 all 

arm-none-eabi-size  STM32F427ZI.elf 

arm-none-eabi-objcopy -O ihex STM32F427ZI.elf "STM32F427ZI.hex"

arm-none-eabi-objcopy -O binary STM32F427ZI.elf "STM32F427ZI.bin"

  text  data  bss  dec  hex filename

  7128  112 12336 19576  4c78 STM32F427ZI.elf

Finished building: default.size.stdout

Finished building: STM32F427ZI.hex

Finished building: STM32F427ZI.bin

19:40:49 Build Finished. 0 errors, 0 warnings. (took 1s.2ms)