Page 1 of 1

Storing persistent values on flash

Posted: Sun Sep 04, 2016 6:22 pm
by ramon2015
I know there are some reserved flash blocks for storing devide ID, sigfox sequence, AT registers,,,
I would like to save some key paremeters for my application presistently and I would like some advice.

I have had a look at the TD_FLASH and there are a lot of different functions to operate the flash. I just want to know which is the appropiate one because I do not want to mess up with the rest of data (ID, sequence,...) already stored in flash. I guess this is handled internally, but I just want to make sure.

As far as I know there are 2 512B-blocks for ID and the rest of parameters. Will my custom data be flashed inside these blocks or will use other separate blocks?

Is there any note where the flash process is detailed or any example to follow?

Regards, Ramon.

Re: Storing persistent values on flash

Posted: Mon Nov 28, 2016 3:56 pm
by mstempin
Hi Ramon,

The Sigfox sequence number is stored in the last 512-byte sector at the end of the Flash Memory.

It is preceded by at least 1 sector (definable using the CONFIG_TD_FLASH_USER_PAGE link-time constant, defined in "lib\libtdcore\inc\td_config_variables.h') of Flash variable data, accessible througth TD_Flash_xxx() function, please check the example "examples\core\flash_variables\src\flash_variables.c".

This is where the AT settings are stored (inside a single Flash variable).

Sigfox ID and key are stored in the "User Page" @0x0FE00000, don't touche it if you don't want to loose your ID and key! This area is untouched when Flashing a firmware, unless you use a toll that is not aware of this particularity.