2021-06-25 06:11 AM - edited 2023-11-14 10:14 AM
Hello st community,
I'm trying to use the BlueNRG-355 in deepstop mode without timer, to wake it up with an I/O. I used function from Power Save Modes project from the Navigator
HAL_PWR_MNGR_Request(POWER_SAVE_LEVEL_STOP_NOTIMER...);
It does not enter any sleep mode, in the function, it jumps over this condition :
/* BLE Stack allows to enable the power save */ if (BLE_STACK_SleepCheck() != POWER_SAVE_LEVEL_RUNNING)
In the reference manual RM0479 5.4.2 :
The conditions to enter the DEEPSTOP mode are:
Also tried to call
__WFI(); WAKEUP->BLUE_SLEEP_REQUEST_MODE = WAKEUP_BLUE_SLEEP_REQUEST_MODE_FORCE_SLEEPING; LL_APB2_DisableClock(LL_APB2_PERIPH_MRBLE); LL_PWR_LowPowerMode(LL_PWR_MODE_DEEPSTOP);
without success.
/****** EDIT ******/
I re-tried to put the BlueNRG in POWER_SAVE_LEVEL_STOP_WITH_TIMER or POWER_SAVE_LEVEL_STOP_NOTIMER.
From what I understood and playing with Micro_PowerManager example project, the HAL_PWR_MNGR_Request function handles the conditions mentionned above.
I added print in this function to know which part prevents from switching to power save mode :
Enable Power Save Request : STOP_WITH_TIMER (VTIMER)
final_level : 2, app_powerSave_level : 3, level : 2
final_level : 2, vtimer_powerSave_level : 2
final_level : 1, pka_level : 1
Power save level negotiated: CPU_HALT
So PKA limits to power save level 1 (CPU_HALT)
From the pka_manager_bluenrg_lp source file :
uint8_t PKAMGR_PowerSaveLevelCheck(uint8_t x){
if(PKAMGR_SleepCheck()==PKAMGR_SUCCESS)
{
return POWER_SAVE_LEVEL_STOP_NOTIMER;
}
else // PKA on going
{
return POWER_SAVE_LEVEL_CPU_HALT;
}
}
I don't use it but I also tried to init the PKA manager with PKAMGR_Init() and call PKAMGR_Unlock().
So the question is : How to get the PKAMGR_SUCCESS or if i go deeper, how to get the pka internal state to PKAMGR_STATE_IDLE ?
Thanks for any tips,
Andy.
Solved! Go to Solution.
2024-02-09 06:17 AM
2021-09-16 04:52 AM
I solved this issue initiating BLE_Stack, VTimers, and run HAL_VTIMER_Tick() BLE_STACK_Tick() NVMDB_Tick() in main.
All of this if you use BLE_Stack library, but if you don’t the problem disappears.
BLE_STACK_SleepCheck() is a WEAK function, and in bluenrg_lp_stack.h there is a function with the same name.
I don’t know what is the exact issue but I solved it this way
2023-11-14 10:31 AM
Hello,
post updated
2024-02-09 06:17 AM