How to periodically turn on and off the BLE advertising on the STM32WB?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-13 1:15 PM
I want to be able to run on battery and turn on the BLE to advertise for 5 minutes then stop. After some time, I want to be able to turn on advertising again. I'm able to initially start the advertising and start the timer to stop advertising. However, I can't seem to find a way to wakeup CPU2 to start advertising again.
I'm using the function to start a 5 minute timer to stop the advertising:
HW_TS_Start(BleApplicationContext.Advertising_mgr_timer_Id, gAdvertisingConnectionTimeout);
Once the timer expires it calls Adv_Cancel() which stops the advertising, aci_gap_set_non_discoverable(). Since the Sequencer is IDLE, it sends the CPU2 into Stop2 mode.
What are the steps to get it out of the Stop2 mode and start advertising again?
Solved! Go to Solution.
- Labels:
-
BLE
-
STM32WB series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-18 6:09 AM
Hello,
You can start a timer when you stop the advertising in order to be able to restart advertising after a timeout. You can also use a button or other event to get out of Stop2.
Best Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-18 6:09 AM
Hello,
You can start a timer when you stop the advertising in order to be able to restart advertising after a timeout. You can also use a button or other event to get out of Stop2.
Best Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-19 6:53 AM
Thank you! This worked after calling HW_TS_Start() to start a timer. In this timer callback function I have it starting up the advertising again by calling APP_BLE_StartAdv(). At first I was trying to wakeup Core2 by calling LL_C2_PWR_WakeUp_BLE() but it wasn't working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-22 8:09 AM
Hey Remy!
Do you have an example how to achieve this?
I'm facing somewhat the same situation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-03 6:12 AM
Have you managed to do it ?
I am facing the same problem, I want to relaunch the advertising with a button push. I saw in my code that adv_cancel() does exist but not APP_BLE_StartAdv()
