This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Advertising does not stop after calling sd_ble_gap_adv_stop()

I have nRF52 and working with SDK11.

I can start BLE advertising and nRF Connect app will detect everything correctly.

I only have an issue: I want to advertise for 10 seconds and when I call sd_ble_gap_adv_stop() the advertising continue as nRF Connect continues showing my device in the RSSI graph. BLE advertising will stop only when I enter System Off.

I tried setting the advertising timeouts to both 0 (using a timer for stopping after 10 seconds) and 10 seconds. But there is no difference. When I call sd_ble_gap_adv_stop(), the radio module continue transmitting.

Does anyone have a clue about what could the issue be? Thank you.

  • What does sd_ble_gap_adv_stop() return? are you using the advertising module in your project (BLE_ADVERTISING)?

  • sd_ble_gap_adv_stop() returns 0x00000008 (NRF_ERROR_INVALID_STATE). What do you mean with "BLE_ADVERTISING"? In any case I am using the code from the example projects, thus I think I am using the "advertising module".

    I have been running some extra tests and it seems that actually sd_ble_gap_adv_stop() stops the advertising, but the Radio continue transmitting (not sure what and why). However, I would like to be able to have the radio stop transmitting and power if off when stopping advertising.

    I have written a test app that continuously advertise for 10 seconds, then it stops for 2 seconds and then starts again.

    image description

    With Power Profile Kit (picture above) I can see that the advertising last for 10 seconds as expected. Then after 2 seconds gap, it started advertising again as expected. Instead using the nRF Connect app, I can see the 10 seconds advertising sessions, and a kind of gap in between. But I was expecting nothing to be transmitted in between.

    image description

  • Just to confirm that I am using the SDK ble_advertising module (ble_advertising.c/.h).

  • The only time sd_ble_gap_adv_stop() will return NRF_ERROR_INVALID_STATE is when you are not advertising. The advertising is therefore either stopped previously by a advertising timeout in the advertising module, or a previous call to sd_ble_gap_adv_stop() .

    Regarding the photo you posted, you see in the PPK image that in the 2 seconds gap the current consumption is about 2mA, the RADIO uses at-least 6-7 mA when transmitting, so it's impossible that it’s still advertising in that 2 second window.

  • Yeah, that was my understanding as well. But how can the nRF-Connect's RSSI-graph be explained then?

Related