2020-06-25 09:14 PM
My application has a few hundred bytes of data that need to be stored in flash. It won’t change often, but will be changed. I’d like to reserve an address range. I know how to read/write flash. Not sure how to decide where to put the data. Any mechanism for this?
2020-06-25 09:22 PM
Typically this is done by using the last page of flash to store nonvolatile data. To do so, reduce the size of the flash in the linker script so that it doesnt contain this page. Then, in your application, erase that page and write/rewrite data as needed. You can’t erase less than a page of flash, so you need to reserve it all, even in you only need a small portion.
2020-06-26 01:50 AM
Reserve two pages, so when page one is full when various variables have been overwritten and replaced you can transfer to the other page without needing for a lot of intermediate RAM.