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 two short videos (registration required) highlighting:

System Workbench for STM32

Bootloader CRC check

My M0 bootloader works. I can upload my file and execute it. The next step is a CRC check of the uploaded .bin file.
The easy part is the bootloader checking the uploaded file. Next,

- How to automatic generate a CRC in the BIN file?

- It is possible to generate a crc with an external tool but i need the crc value on a fixed place in the bin file so the external tool can overwrite that value. I tried to make a section in the linker script to reservate a part of flash for the crc variable but no idea how to do that.

I’d recommend using the open-source utility “srec_cat” to embed a CRC into your object file. It’s also capable of doing a lot of other things related to manipulating object code files.


I recently wrote a bootloader for a project I worked on recently, and I had do come up with a way to do exactly what you describe - insert a CRC of the image into a fixed location within the object code file. I used srec_cat to accomplish this.

You will want to run the srec_cat utility as part of your post-build process. I’d suggest making a small shell script (batch file) that runs the srec_cat program, and run the script/batch containing all the utilities you want to run (including srec_cat) as your post-build step.

Learning how to use the SRecord utilities can be a bit dauting. They can do a lot of nice things related to manipulating object code files, but this flexibility comes at the expense of ease of use. Fortunately, the author does provide comprehensive documentation.

I can provide some assistance in using srec_cat and setting up a post-build script to do this if you need it.

Thanks looks good. I guess you add the srec_cat to the build steps? What is your command there? Does the srec_cat glues the crc to the end of the file?
It can be handy to place a const struct on a fixed position in the flash, any idea how to do that?

C:\Ac6\workspace\Project_M0_BL_App\Debug>srec_cat Project_M0_BL_App.bin -crc32-b-e 0x8013C20

srec_cat: Project_M0_BL_App.bin: 1: warning: ignoring garbage lines
srec_cat: Project_M0_BL_App.bin: 4: file contains no data