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

Flash write with SDK 4.4.2 + S110 5.2.1

Hello everyone,

I have inherited a project from my coworker. It uses NRF51822 QFAAH0, SDK 4.4.2 and S110 5.2.1. My device is scheduled to: advertise, collect the data from a sensor.

Now I would like to store sensor data in flash then transfer them via BLE if there is a connection. As I have searched in this forum: fstorage, pstorage are preferred (to avoid conflicts between flash writing and BLE communcation). However, due to some reasons, I still have to use SDK 4.4.2 and S110 5.2.1 instead of other SDKs and Softdevices which support fstorage and pstorage functions.

My question is:

  1. In my case (SDK 4.4.2 and S110 5.2.1), how can I store data in flash?
  2. Could someone explain the use of flash_word/page_write function? I saw it is used in ble_bondmngr.c but I can't find and document about it. This may be a solution for me. If yes,
  3. Can I define a fixed area in my flash for storing data? BLE may use some spaces in flash for storing its own bonding and attribute information. And I don't want them to be stored in my data area.

Thank you for spending time.

Best regards.

Parents
  • Now my fixed boards are incompatible with SDK and SD version. They are NRF51822 QFAAH0, and using SDK 4.4.2 and SD110 5.2.1. Until now I didn't find any big problem. Maybe my application is not so complicated so they are still working fine. There are some small problems such as some SD functions didn't work (maybe). At that time I just suspected that my code was not perfect.

    Back to my question, instead of using latest SDK/SD, can I still use flash_word/page_write functions (as in flashwrite_example folder in SDK 4.4.2 folder)? This example wrote data to flash without considering the BT communication. Therefore, in my case, do I need to disable the SD before writing and then enable it again after writing or just wait until the BT communication is disconnected? BT communication also write some data in flash so how can I manage that data area? I don't want it to be stored in my data area.

Reply
  • Now my fixed boards are incompatible with SDK and SD version. They are NRF51822 QFAAH0, and using SDK 4.4.2 and SD110 5.2.1. Until now I didn't find any big problem. Maybe my application is not so complicated so they are still working fine. There are some small problems such as some SD functions didn't work (maybe). At that time I just suspected that my code was not perfect.

    Back to my question, instead of using latest SDK/SD, can I still use flash_word/page_write functions (as in flashwrite_example folder in SDK 4.4.2 folder)? This example wrote data to flash without considering the BT communication. Therefore, in my case, do I need to disable the SD before writing and then enable it again after writing or just wait until the BT communication is disconnected? BT communication also write some data in flash so how can I manage that data area? I don't want it to be stored in my data area.

Children
No Data
Related