Something wrong when I try to make the BLE go to sleep

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

cross mob
Anonymous
Not applicable

     I develop ble with BCM920736TAG_Q32 and WICED-Smart-SDK-2.2.1

 

     I add some code in the create function below:

void xxx_create(void)

{

     ......

  devlpm_init();

  devlpm_enableWakeFrom(DEV_LPM_WAKE_SOURCE_QUAD);

  devlpm_registerForLowPowerQueries(application_time_to_sleep_callback, 0);

  devlpm_registerForEarlyWakeNotification(application_time_wakeup_callback,NULL);

  }


the application_time_to_sleep_callback function is:

UINT32 application_time_to_sleep_callback(LowPowerModePollType type, UINT32 context)

{

  switch(type)

  {

  case LOW_POWER_MODE_POLL_TYPE_SLEEP:

           ble_trace0("LOW_POWER_MODE_POLL_TYPE_SLEEP");

            return ~0;

  case LOW_POWER_MODE_POLL_TYPE_POWER_OFF:

           ble_trace0("LOW_POWER_MODE_POLL_TYPE_POWER_OFF");

            return 1;

  default:

            return ~0;

  }

}

and the application_time_wakeup_callback function:

INT32 application_time_wakeup_callback(void* arg)

{

  BACKEY_TRACE("WAKING UP!");

  return 0;

}

when I run the program, the log keep showing:

19:20:58 - LOW_POWER_MODE_POLL_TYPE_SLEEP

19:20:58 - LOW_POWER_MODE_POLL_TYPE_SLEEP

19:20:58 - LOW_POWER_MODE_POLL_TYPE_SLEEP

19:20:58 - LOW_POWER_MODE_POLL_TYPE_SLEEP

19:20:58 - LOW_POWER_MODE_POLL_TYPE_SLEEP

19:20:58 - LOW_POWER_MODE_POLL_TYPE_SLEEP

19:20:58 - LOW_POWER_MODE_POLL_TYPE_SLEEP

19:20:58 - LOW_POWER_MODE_POLL_TYPE_SLEEP

19:20:58 - LOW_POWER_MODE_POLL_TYPE_SLEEP

19:20:58 - LOW_POWER_MODE_POLL_TYPE_SLEEP

19:20:58 - LOW_POWER_MODE_POLL_TYPE_SLEEP

19:20:58 - LOW_POWER_MODE_POLL_TYPE_SLEEP

19:20:58 - LOW_POWER_MODE_POLL_TYPE_SLEEP

19:20:58 - LOW_POWER_MODE_POLL_TYPE_SLEEP

When a puart interrupt comes, it stops showing  LOW_POWER_MODE_POLL_TYPE_SLEEP

and never show it again! Does it means the chip never sleep? If the chip sleep, why it keep printing

LOW_POWER_MODE_POLL_TYPE_SLEEP but not just print once? If it waked up, why application_time_wakeup_callback

do not run?

Because something difficult in my device, I just can not measure the current.

0 Likes
2 Replies
BoonT_56
Employee
Employee
500 likes received 250 likes received 100 likes received

Let me know if the below helps...

BCM20736S Sleep Example Firmware

And do upgrade to SDK ver 2.2.2.

0 Likes
BoonT_56
Employee
Employee
500 likes received 250 likes received 100 likes received

Is this still an issue?

naturesphere

0 Likes