cancel
Showing results for 
Search instead for 
Did you mean: 

Place const at specific flash location

manuislet
Associate II

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.

4 REPLIES 4
JTP1
Lead

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
Up vote any posts that you find helpful, it shows what's working..
manuislet
Associate II

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?

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
Up vote any posts that you find helpful, it shows what's working..