This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Best way to update a 32-bit word in flash - SDK13.1

Hi,

I want to store the CRC of the current firmware in the flash, for DFU purposes. Almost all of the threads I've seen so far reference the pstorage API but it's no longer supported since SDK12. There are the new experimental fstorage and FDS APIs but they seem overkill for what I'm trying to do.

Besides that, I want to update the firmware version in the bootloader, so I don't want to increase its size too much by adding a whole other component that I need just for a single operation.

Right now, I'm just writing the CRC to the start address of the APP DATA region, and, if I want to update it in a later DFU, I need to erase the whole page because in order to update it. I don't know what other data I might want to store there eventually, but in case I had some, I think that what I should do is backup all the data in that page and then write it back with the updated value.

That approach seems really inefficient to me, so I guess there should be another way.

Let me know if you have any suggestions.

Parents Reply Children
No Data
Related