This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Erasing flash while connection is active?

Hi Aslak, 

In a previous post you said: 

"- You should not erase pages when in a connection. But, if the connection interval is, say 100ms or more, then you should be fine. As I mentioned in the other thread, the important thing is that the LL task gets to execute once after each conn event, and before the next."

If our connection time is the smallest value (I think that is 6ms??) is it still possible for us to erase flash pages? If not, how can we solve this... 

Is there a minimum connection interval that we need to enforce so we will have time to erase a page?? 

Or some other suggested way of how we can erase flash while a connection is maintained...??  Is it possible to dynamically modify the connection interval to 100ms, then erase flash, and then change the connection interval back to 6ms (all without dropping the connection)? 

What is the maximum time a page-erase can take? 

Or do we always have enough time to erase 1 page when our task is called? 

Thanks

Mike

  • Hi Mike,

    I'm no help about the flash-pages, but you can try to change the connection parameters by calling

    extern hciStatus_t HCI_LE_ConnUpdateCmd( uint16 connHandle,
                                             uint16 connIntervalMin,
                                             uint16 connIntervalMax,
                                             uint16 connLatency,
                                             uint16 connTimeout,
                                             uint16 minLen,
                                             uint16 maxLen );

    HTH

    Andre

  • Hi Mike,

    I can't find any explicit measurements. You should perhaps do some quick GPIO + scope measurements to see if the timing holds.

    As Andre says, you can update the connection interval dynamically. From a peripheral you must first send an update parameter request. See for example SimpleBLEPeripheral, and how peripheral.c (GAPRole) is used. Specifically you can use peripheral.c's GAPRole_SendUpdateParam(...) from your application.

    Note that it will take some time to complete. By registering for a callback via GAPRole_RegisterAppCBs(..) you can get notified when the update has occurred.

    Best regards,
    Aslak

  • Hi Aslak,

    thanks for pointing in the right direction of peripheral.c and GAPRole_SendUpdateParam(). I was sure there was another function (beside the HCI_ one), but I couldn't find it for my life :)

    Andre

  • Makes sense.  Thanks - I'll try playing with those APIs, and we'll do some measurements on erase times... 

    Thanks again

    Mike