This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to retain flash memory?

Hi,

I need to write data in to flash memory of the nRF51822 device.

I have tried to write data. When i checked memory address where i wrote data i could find that the data has been written.I viewed the memory in debug mode.

When i try to restart the debug the data is not available there.It shows FF in that location.

I tried to check it in the running mode also..The memory write is success i think, But the data is not retaining.How can i fix it?

I have attached the file which is used to write in to flash.

Thanks, Shiju C G

main.c

Edit: format, one sentence question.

Parents
  • Try to write in another flash page. Your program already using pstorage in bond manager and if your program using only one pstorage module for bond manager (PSTORAGE_MAX_APPLICATIONS == 1) then pstorage data start address will be exactly (NRF_FICR->CODESIZE - 2) and it'll use (NRF_FICR->CODESIZE - 1) as well so maybe bond manager clear this pages in which you write your data.

    Try (NRF_FICR->CODESIZE - 3) or (NRF_FICR->CODESIZE - 4) page

Reply
  • Try to write in another flash page. Your program already using pstorage in bond manager and if your program using only one pstorage module for bond manager (PSTORAGE_MAX_APPLICATIONS == 1) then pstorage data start address will be exactly (NRF_FICR->CODESIZE - 2) and it'll use (NRF_FICR->CODESIZE - 1) as well so maybe bond manager clear this pages in which you write your data.

    Try (NRF_FICR->CODESIZE - 3) or (NRF_FICR->CODESIZE - 4) page

Children
No Data
Related