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

High power consumption after disconnect

Hi,

I've just hit a strange issue with SDK 12.1 on nRF52832.

Usually on BLE_GAP_EVT_DISCONNECTED, sd_ble_gap_adv_start gets called to start advertising and everything's great.

However, if I don't call sd_ble_gap_adv_start, advertising stops (as you'd expect) but the CPU seems to get left on - drawing 3-4mA of power!

Do you have any idea what could be causing this, and how to fix it?

Some of my users want to be able to disconnect and stop the device advertising so when used in HID mode the computer doesn't keep connecting. Then when a button is pressed it'll wake and get connected to. This all works fine, however the 'low power' mode ends up drawing 3mA!

Parents
  • Found it... I think I'd been distracted by the fact that my devkit was using an early chip, which had some erratas and was exhibiting different behaviour to the production devices.

    The actual issue seemed to be that I called ble_nus_string_send from SWI1_IRQHandler if I had data to send. While there was a check for the connection status, the global connection state variable wasn't volatile, and I think what was happening was ble_nus_string_send was getting called during the disconnect.

    Something about that and not enabling the advertising got it into a situation where it wasn't able to sleep properly.

Reply
  • Found it... I think I'd been distracted by the fact that my devkit was using an early chip, which had some erratas and was exhibiting different behaviour to the production devices.

    The actual issue seemed to be that I called ble_nus_string_send from SWI1_IRQHandler if I had data to send. While there was a check for the connection status, the global connection state variable wasn't volatile, and I think what was happening was ble_nus_string_send was getting called during the disconnect.

    Something about that and not enabling the advertising got it into a situation where it wasn't able to sleep properly.

Children
No Data
Related