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

Advertising start while flash operation pending

Hi While browsing the new files in the SDK 8.0.0 i had a look in the new ble_advertising module. In the start advertising function the pstorage access is checked if it's busy. If a operation is pending the advertising is started later after storage operation is completed. Why is this necessairy? Is this a recommended behavior? Is it a workaround for a bug?

As i'm not testing the pstorage activity when starting the advertising i'm wondering if i'm doing something wrong...

Regards Adrian

  • Hi, if your application is not using any flash read write activity then you can rid off the storage calls from your application. in case if your application needs pstorage calls, you can use it, as pstorage is event based so it is been taken care by the soft device. The pstorage activity can take place while adv is on. But make sure your queue to process request do not overflow or should not have same priority requests, otherwise it will never get processed hence enter into hard fault.

  • Hi Adrian,

    The check for pending flash operation was implemented to avoid the issue that when a connect request from a central arrives at the same time when a flash operation is ongoing (especially when erasing, which takes up to 23ms) on the peripheral, this may result in a link loss after that.

    So for the safe side, when you do a flash operation, try to stop advertising, call pstorage operation, and then start the advertising again.

Related