Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32


Project doesn't generate .bin file

After upgrading to STM32CubeMX 4.26 I found, that System Workbench project generated by CubeMX, doesn’t produce .bin file during build. Output directory contains .elf and .hex file. In previous versions there was also .bin file. Probably this is some STM32CubeMX problem. However, having such STM32 Workbench project, I want to know, how it works.

In old version the following information was printed during build:
arm-none-eabi-objcopy -O binary “rcu.elf” “rcu.bin”
Now it prints:
arm-none-eabi-objcopy -O ihex “rcu.elf” “rcu.hex”

I have two questions:
1. How does it work when I press Run or Debug button? Does it burn huge .elf file to the device flash memory? For the same project, bin file size is 90 KB, elf file size is 2900 KB.
2. How to change the project settings, to produce .bin file?

Update. To produce .bin file, I need to change the project by the following way:
Project - Properties - C++ Build - Settings - Buidl Steps - Post-build steps. Replace:
arm-none-eabi-objcopy -O ihex “${BuildArtifactFileBaseName}.elf” “${BuildArtifactFileBaseName}.hex” && arm-none-eabi-size “${BuildArtifactFileName}”
with:
arm-none-eabi-objcopy -O ihex “${BuildArtifactFileBaseName}.elf” “${BuildArtifactFileBaseName}.hex” && arm-none-eabi-size “${BuildArtifactFileName}” && arm-none-eabi-objcopy -O binary “${BuildArtifactFileBaseName}.elf” “${BuildArtifactFileBaseName}.bin”

So, I need an answer to the question #1: how does it work internally, when I press Run or Debug button? Maybe it produces .bin file on the fly and burns it to device?

Tunisia

Hi,

For question 2, you already found the solution.

Now, to answer the first question you need to know that neither the hex nor the bin are used in System Workbench to program (burn) the application.

In fact internally System Workbench - as it is gcc based - uses gdb and openocd to program and debug your application.
Thus means that :
- System Workbench passes the elf file to gdb
- gdb reads the debug informations to grants code comprehension
and extracts the loadable sections (same as in the bin file)
then passes these sections to openocd to burn them.

To conclude, the elf does not contains only the burnable image but others information (such as debug info).
And only the loadable sections are programmed, which is equivalent to program the bin, or hex file.

TIP : even the bin, and hex files have different sizes because the content is represented in different ways (+ hex contains adresses, but the bin does not)

Regards,
Tarek

Tarek, thank you for this explanation.

In System WorkBench
Update. To produce .bin file, I need to change the project by the following way:
Project - Properties - C++ Build - Settings - Buidl Steps - Post-build steps. Replace:
arm-none-eabi-objcopy -O ihex “${BuildArtifactFileBaseName}.elf” “${BuildArtifactFileBaseName}.hex” && arm-none-eabi-size “${BuildArtifactFileName}”
with:
arm-none-eabi-objcopy -O ihex “${BuildArtifactFileBaseName}.elf” “${BuildArtifactFileBaseName}.hex” && arm-none-eabi-size “${BuildArtifactFileName}” && arm-none-eabi-objcopy -O binary “${BuildArtifactFileBaseName}.elf” “${BuildArtifactFileBaseName}.bin”

I am getting following errors :

make --no-print-directory post-build
Generating BIN and Printing size information:
arm-none-eabi-objcopy -O ihex “STM_Fork_Module.elf” “STM_Fork_Module.hex”
arm-none-eabi-objcopy: ‘“STM_Fork_Module.elf”’: No such file
make1: *** post-build Error 1
make: *** STM_Fork_Module.elf Error 2
make: Target `all’ not remade because of errors.

Hi,

Try removing the quotes in the command:

arm-none-eabi-objcopy -O ihex ${BuildArtifactFileBaseName}.elf ${BuildArtifactFileBaseName}.hex && arm-none-eabi-size ${BuildArtifactFileName} && arm-none-eabi-objcopy -O binary ${BuildArtifactFileBaseName}.elf ${BuildArtifactFileBaseName}.bin


Regards,
Kevin.