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

Unable to use Pstorage in my code

To @Hung Bui. Hello sir. I am new to NRF51 microcontrolers and I am trying to use Pstorage in my written code. I have noticed this post of your's: image description

I am using nrf51422 and and edited ble_app_uart example as my main code. I do not remember from which SDK I have taken it.

I have downloaded, compiled your code. Edited it a little bit and tried to debugg. The code writes, reads and deletes bytes at starting address 0x0003f420. I have tried to use the same functions in my code, unfortunately it does not write. Function READ reads all bytes as 0xFF as expected because nothing is written there. Moreover, the code somehow strangely sets flash write start address at 0x0003f820 despite I have just copied everything. The settings are being kept the same.

Should I stay with using the same functions? Maybe, you could refer to somewhere how to use pstorage library because I was not lucky trying to implement other examples found in the forum aswell.

these are the functions from your code: image description image description image description

Here is how I use those functions in main code. It works in your project. image description

Related