2023-06-04 05:58 AM
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.
2023-06-04 06:07 AM
Hello. Here seems to have same problem:
2023-06-04 07:12 AM
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
2023-06-05 12:18 PM
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?
2023-06-05 12:23 PM
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