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

Parents
  • 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.

Reply
  • 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.

Children
No Data
Related