analogdevicesinc / msdk

Software Development Kit for Analog Device's MAX-series microcontrollers
Apache License 2.0
60 stars 75 forks source link

Not restarting advertisement after stopped. FreeRTOS tickless #936

Closed EdwinFairchild closed 1 month ago

EdwinFairchild commented 4 months ago

Resuming advertising is not working once they are stopped. If you comment out line 230 and 239, essentially remove the if statement and thus the call to PalBbGetTimestamp , and keep the if statements contents then it works just fine. I think it may be related to accessing the dbb but the PalBbGetTimestamp guards against that in the phy by checking palBbEnableCnt

https://github.com/analogdevicesinc/msdk/blob/47ac9e535d29921286969f6e486b673ee6ff9d56/Examples/MAX32665/Bluetooth/BLE_FreeRTOS/freertos_tickless.c#L228-L240

Steps to reproduce:

EricB-ADI commented 2 months ago

Removing the if statement basically causes it to never go to sleep.

EricB-ADI commented 2 months ago

BB was not being correctly disabled and enabled/restored.