2024-04-11 02:56 AM - edited 2024-04-11 02:58 AM
I everyone ,
I'm working on a STM32WB35
I've build a small custom server app with just a simple batt level service it works and advertise perfectly if I don't enable LPM as soon as I enable LPM it don't advertise anymore
it looks as if CPU2 and RF are down too as default BLE app disable OFF lpm mode it goes only in STOP LPR mode
on my custom pcb I have no LSE so I rely on HSE when running and MSI or HSI when in stop or off
when comparing with BLE HeartSensor reference exemple I dont understand how it keeps advertising when in STOP mode
my main concern is on BLE HeartSensor exemple when going in stop mode it calls
static void EnterLowPower(void)
{
/**
* This function is called from CRITICAL SECTION
*/
while(LL_HSEM_1StepLock(HSEM, CFG_HW_RCC_SEMID));
if (! LL_HSEM_1StepLock(HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID))
{
if(LL_PWR_IsActiveFlag_C2DS() || LL_PWR_IsActiveFlag_C2SB())
{
/* Release ENTRY_STOP_MODE semaphore */
LL_HSEM_ReleaseLock(HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID, 0);
Switch_On_HSI();
__HAL_FLASH_SET_LATENCY(FLASH_LATENCY_0);
}
}
else
{
Switch_On_HSI();
__HAL_FLASH_SET_LATENCY(FLASH_LATENCY_0);
}
/* Release RCC semaphore */
LL_HSEM_ReleaseLock(HSEM, CFG_HW_RCC_SEMID, 0);
return;
}
but when switching to HSI sysclk should fall at 16Khz and CPU2 clock too
may be it explain why I can't get advertising when CM4 is STOP in my custom APP but it dont explain why it works on HEARTSensor exemple
thank's for any help or info or idea !!
Solved! Go to Solution.
2024-05-28 08:45 AM
Can you add more details about your confusion so i can clarify more about it.
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-05-15 08:47 AM
Hello @oga
Could you try the following steps:
Ensure that the BLE stack is initialized.
Use the LPM manager.
Configure the M4 core to enter STOP2 mode.
Handle wake-up events.
Refer to example code.
Consider the impact of interrupts.
Review the power mode transitions.
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-05-16 12:49 AM
Hello STTow-32
thank's for your reply
Ensure that the BLE stack is initialized.
yes it is in fact if I don't let go in stop mode every thing is working
Use the LPM manager.
yes that's what I'm doing I've put some debug tags in enter/exit lpm modes functions
Configure the M4 core to enter STOP2 mode.
I've try all modes Stop 0/1&2
Handle wake-up events.
I should be waked up by RF event
Refer to example code.
I have and it looks pretty straight forward
I'm trying to fall into RF interrupt but
My best bet is that : due to pcb size I've no LSE quartz that impose to use HSE/1024 for RF clock
but HSE is not available in STOP2
when looking in ref manual I have 2 interrogations
The functionality in Stop mode (including wakeup) is supported only when the clock is
LSE. When HSE/1024 is selected as RF system wakeup source HSEON bit must be
set by the application.
The RF system clock is derived (selected by hardware) from one of the two following
sources:
– HSI16 clock
– HSE clock
The functionality in Stop mode is supported only when the clock is HSI16 is selected as
wakeup clock by STOPWUCK.
I dont understand well (sorry I'm not native english speaker) it says that RF wake up in stop mode is only working when clock is LSE and just behind it looks to say that it can be HSE/1024 or HSI16
and when looking into datasheet we can read on p36/37
HSE (32 MHz) automatically used when RF activity is needed by the RF subsystem
I feel a bit confused
2024-05-28 08:45 AM
Can you add more details about your confusion so i can clarify more about it.
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-07-01 05:51 AM
sorry for late reply
I've solved this issue regarding LSE vs HSE for RF wakeup
my confusion was is it possible to be waked up by RF if shutting down HSE or setting RF WKUP on LSE
but know I have another issue regarding LPM & BLE (I will open a new topic)