How to handle BTM_LPM_STATE_LOW_POWER

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
BeOl_4470266
Level 3
Level 3
25 replies posted 10 replies posted 10 sign-ins

Hello,

I am using a CYW4343W coupled with an STM32L4A6 and am using the BLE capabilities of the radio.

I have defined my own low power system, which enters SLEEP mode or STOP2 mode depending on what peripherals are currently being used.

I have defined functions that are called from platform_mcu_powersave_enable and platform_mcu_powersave_disable which allows me to know when the app would allow to enter STOP mode.

The system works fine until I integrate the BLE stack with my application. I have noticed from the demo that `BTM_LPM_STATE_LOW_POWER` leads to a call to platform_mcu_powersave_enable, but I am struggling to identify the matching call to platform_mcu_powersave_disable. Can anybody point me to where it is, and how this BTM_LPM_STATE_LOW_POWER works?

Has anybody worked with the STOP mode and Wiced, and knows how to handle this situation?

What I notice is that, after a few minutes, there has been more calls to platform_mcu_powersave_enable than there were calls to platform_mcu_powersave_disable which would make it possible to enter STOP mode when one of my thread required not to (using DMA for instance). The BLE stack appears to be what makes this extra call.

Thanks for your help

0 Likes
1 Solution

Hello - Bluetooth stack doesn't directly call any of the platform power save APIs. Mostly the platform power save API call should be in the platform driver code for your MCU (STM32L4A6).  Bluetooth stack for UART only calls wiced_uart_* APIs defined in wiced_platform_common.c file I believe.

Have you investigated your app and platform driver to confirm that they are not calling platform_mcu_powersave_disable call?

View solution in original post

8 Replies