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

SDK 15.3.0 Flash_fstorage example not working as expected

Hello,

nRF52840-DK

SDK 15.3.0

SoftDevice: s140

IDE: SES

Example: Flash_fstorage_s140_pca10056

I do not read back the expected value in the example. The terminal image also show a read of the entire section of memory. I would expect the results to look something like this:

read hex 0x3E000 4
0xBA 0xDC 0x0F 0xFE

read hex 0x3E100 4
0xDE 0xAD 0xBE 0xEF

read str 0x3F000 12
hello world

Parents Reply Children
  • The reason for this behavior is the following: When flash is erased, all bits in flash is set to '1'. Writing to flash consists of setting the necessary bits to '0'. Setting bits back to '1' can only be done by erasing the flash page.

    If you did not erase the flash, some of them will already be '0', and some new ones will have to be switched. In addition, some bits that should be '1' will also be '0', because it is already written before. Therefore, it will not work as you expect. 

    Please also see this post

    -Amanda H.

Related