cancel
Showing results for 
Search instead for 
Did you mean: 

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

CARHERO
Associate III

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?

1 ACCEPTED SOLUTION

Accepted Solutions
troky
Associate

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

0690X000008BBaZQAW.png

View solution in original post

8 REPLIES 8
troky
Associate

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

0690X000008BBaZQAW.png

CARHERO
Associate III

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

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
Associate III

Did you generate with STM32 Project?

I think there may have wrong project setting.

DPISA.1
Associate

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 II

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
Associate III

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)

Thank you.