cancel
Showing results for 
Search instead for 
Did you mean: 

Application image integrity on stm32h7 flash

Jpj.1
Associate II

Hi,

I am using stm32h745. I want to check the integrity of flash by checking crc checksum of the code in flash by storing the crc to last 4 bytes of flash. During image integrity check the calculated crc and stored crc need to compare. For this how should I set build settings in properties of STM32CubeIDE??? Could someone please help with this

6 REPLIES 6
Pavel A.
Evangelist III

No change in build settings or properties is required. Just do what you want.

 

Jpj.1
Associate II

How? dont we need to add post build command so as to generate checksum and store to last 4 bytes of flash?

Of course, a post-build command is great for such things. But you've asked about changes in build settings...

The CubeIDE user manual explains the post-build commands.

For the script you can use "sh" with many usual gnu utilities, even on Windows.

 

Jpj.1
Associate II

Can u please share any reference? I tried using command as "C:/Program Files/srecord/bin/srec_cat.exe" "app.hex" -Intel -fill 0xFF 0x08000000 0x080FFFFF -crop 0x08000000 0x080FFFFB -CRC32_Big_Endian 0x080FFFFC -CCITT -o "app.hex" -Intel but doesn't work

What "doesn't work"? Any error message?

This works for me with CubeIDE 1.15.1:

PavelA_0-1727134484208.png

And this:

 

PavelA_1-1727134878233.png

 

Jpj.1
Associate II

locations are not filled with FF, also shows error in crc calculation. Can u please share the command or script to be used. I am using stmcubeide 1.16.0