Skip to main content
CARHERO
Associate II
May 2, 2019 2:34 AM UTC
Solved

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

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?

This topic has been closed for replies.
troky
trokyBest answer
Associate
May 2, 2019 12:25 PM UTC

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

0690X000008BBaZQAW.png

8 replies

troky
trokyBest answer
Associate
May 2, 2019 12:25 PM UTC

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

0690X000008BBaZQAW.png

Explorer
Oct 6, 2024 10:32 PM UTC

Thank you.

CARHERO
CARHEROAuthor
Associate II
May 3, 2019 5:50 AM UTC

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
Aug 27, 2019 10:55 PM UTC

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
Sep 2, 2019 2:13 PM UTC

Did you generate with STM32 Project?

I think there may have wrong project setting.

DPISA.1
Visitor II
Jan 29, 2020 2:09 PM UTC

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
Sep 3, 2020 6:32 AM UTC

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
Sep 3, 2020 10:45 AM UTC

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)