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
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
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
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?
Another simpler method
Other options include
None of this is really specific to nRF52840 - the same would apply to any other microcontroller.
Good point Andrew, FDS provides this.
For this reason FDS should be a better choice for this application.