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

How can i write 10kB of data to internal flash?

Hi,

I use nRF51822 with 256k flash and external sensor, and i want to write the data i receive from it via SPI to internal flash?

After the data received i want to send it to iOS application with s110 uart_app.

How can i do it?

P.S. I tried pstorage option but it always give me one page of 0x400 bytes. How to move to next page?

Thanks

intFlash - Copy.c intFlash - Copy.h

  • Where is your pstorage callback function. You first know that update is successful when you get a pstorage_callback_success event. My guess is the you reset the device before the pstorage update operation is complete. The pstorage update function is in fact combination of several flash operation, including 2x pstorage clear operations and pstorage clear takes around 22ms each. There are some flash storage examples here, including pstorage example where pstorage callback handler is implemented. It is in fact the same example as posted on this thread for SDK 11.0.0

    Your question is in fact very good and it would be relevant to make a new thread for it in order for others to find the question and answer.

  • I already had a pstorage callback function. But when I use printing in callback function I just receive callback of pstorage_load function, I don't know why I can't see callback of pstorage_store and pstorage_update.

    I sure the device does not reset before storing or updating complete, because after this test pstorage code it run into bluetooth app (with a blinking led for indicator) and I reset board by pressing the "IF BOOT/RESET" button on board so I think there is enough time for pstorage_store and pstorage_update function.

    I will try my code on your example project.

    Thanks

  • @Thanh Doung Please add a new question and link to this one if it is relevant.

Related