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

nrf52840 led save status

Hi guys,

i have an important request:

i have to enable/disable a led with nrf52840 and save its status in internal memory.

is possible?

Thanks

Parents
  • Hi

    If you want to store something permanently you can use the internal flash to store data. 

    Two modules are provided in the SDK for accessing flash, namely fstorage and FDS. For a simple use case such as this I believe fstorage would be the best bet. 

    Examples for both can be found in the SDK:

    \nRF5_SDK_15.2.0_9412b96\examples\peripheral\flash_fstorage
    \nRF5_SDK_15.2.0_9412b96\examples\peripheral\flash_fds

    Please note that if you write and erase the same page in flash over and over it will eventually wear out. To prevent this you either have to use some kind of wear leveling algorithm to write to different parts of the flash rather than the same address over and over. 

    Another simpler method is to write to internal RAM most of the time, and only push the status to flash at a regular slower interval. 

    Best regards
    Torbjørn

  • use some kind of wear leveling

    FDS does that for you - doesn't it?

Reply Children
Related