Skip to main content
Visitor II
September 20, 2024
Question

Application image integrity on stm32h7 flash

  • September 20, 2024
  • 4 replies
  • 1271 views

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

    This topic has been closed for replies.

    4 replies

    Super User
    September 20, 2024

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

     

    Jpj.1Author
    Visitor II
    September 23, 2024

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

    Super User
    September 23, 2024

    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.1Author
    Visitor II
    September 23, 2024

    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

    Super User
    September 23, 2024

    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.1Author
    Visitor II
    September 24, 2024

    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