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

nRF51422 save to flash when Bluetooth ON

Hi,

I keep looking at different posts and I struggle to understand.

Is it possible to save to flash (nvm) on a nRF51422 with s130 while the Bluetooth is ON and connected to the phone?

In our case, if we save to nvm while connected to Bluetooth, it seems that the devices restarts and this doesn't happen always... which was very difficult for us to identify the issue.

It is possible, can some kindly share some pieces of code?

For us, it is a very problematic issue, because users can cat power externally without pressing the power button on the device which leads to a lot of customer support. Also restarting the device is not really user friendly.

Any help with is very much appreciated.


Best regards

Update: Using nRF51422 with nRF5_SDK_12.3.0_d7731ad and s130 and armgcc project

  • Hi,

    Is it possible to save to flash (nvm) on a nRF51422 with s130 while the Bluetooth is ON and connected to the phone?

    Yes, that is possible. But it may depend on the connection parameters, as flash writes take some time and the SoftDevice needs to be able to schedule the flash writes without causing the connection to drop.

    In our case, if we save to nvm while connected to Bluetooth, it seems that the devices restarts and this doesn't happen always... which was very difficult for us to identify the issue.

    Even if you are not able to schedule a flash write this should not cause the device to reset by itself. I wonder if this causes problems with your application logic, and causes an error handler to reset the device? Have you added some logging or done something else to see exactly what causes your device to be reset?

    It is possible, can some kindly share some pieces of code?

    You can refer to any Bluetooth example that uses bonding to see an example of writing to flash, as the peer manager writes to flash (via FDS) (it could also be a similar older library, depending on which SDK version you are using).

    Can you elaborate on how you try to write to flash?

Related