Skip to main content
manuislet
Associate II
June 4, 2023
Question

Place const at specific flash location

  • June 4, 2023
  • 4 replies
  • 2044 views

Hi everyone,

I am developing a custom bootloader and before flash the new application image, the bootloader must ensure that the image corresponds to the board, so I think a simple way to do it is to store a specific value (constant uint32_t) into a specific flash memory location, so the bootloader can dig into the .Hex file and find it. How can I store a constant in, lets say 0x8030000 flash address?

thanks in advance.

This topic has been closed for replies.

4 replies

Graduate II
June 4, 2023
Tesla DeLorean
Guru
June 4, 2023

Cast a pointer to read

Have a code / version / sequence# in the empty positions in the Vector Table, via startup.s

If staging an image, perhaps package it with a a wrapper / integrity check

Having stuff floating around at specific addresses via Linker AT directives, or similar, tends to be highly non-portable and future limiting

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
manuislet
manuisletAuthor
Associate II
June 5, 2023

Thanks to all for your replies,

@Community member​ what do you think is the best option to verify/check that the firmware the end user is trying to flash was writen by my using only the .hex file?

Tesla DeLorean
Guru
June 5, 2023

Not sure I understand the question.

You could perhaps sign the .HEX file with additional records, say adding a SECP192R1 type signature, or CRC32 or SHA256, you could perhaps salt them so harder to recognized/duplicate.

Each STM32 has a 96-bit Unique ID you could use that to salt the signing, or generate a key

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..