cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB eddystone and sleep

PPrei
Associate II

I would like to use STM32WB (NUCLEO-WB55) with eddystone and sleep periodically.

I find examples about beacon and about power low mode but it's not easy merge them.

I'm looking for an example.

Thank you

Paolo Preioni

12 REPLIES 12
FilipKremen
ST Employee

Please read this Wiki page below for more information about sequencer.

Utility:Sequencer - stm32mcu

For the low power manager please visit section 4.6 in AN.

How to build wireless applications with STM32WB MCUs - Application note

I'm attaching the Beacon example with stop mode enabled.

Please let me know if it works on your side, you can see the current consumption of this application below.

Also, before measurement please remove JP2 and everything from JP5.

beaconstop.png

Best regards,

Filip Kremen

Thak you @FilipKremen.

I understand what the example code you provided does. But that's not what I want to do.
I want the microcontroller to go to sleep for a certain amount of time (a few dozen minutes) after performing certain operations (acquisition of quantities, updating the EddystoneTLM_InitStruct structure for transmission with the Eddystone TLM protocol). To put the microcontroller to sleep, I use the following sequence:

HAL_LPTIM_Counter_Start_IT(&hlptim1, hlptim_prescaler);

HAL_SuspendTick();
HAL_NVIC_DisableIRQ(RTC_WKUP_IRQn);
HAL_NVIC_DisableIRQ(IPCC_C1_RX_IRQn);
HAL_NVIC_DisableIRQ(IPCC_C1_TX_IRQn);
HAL_NVIC_DisableIRQ(HSEM_IRQn);
HAL_PWREx_EnterSTOP2Mode(PWR_SLEEPENTRY_WFI);

Upon waking up:

HAL_LPTIM_Counter_Stop_IT(&hlptim1);
HAL_NVIC_EnableIRQ(IPCC_C1_RX_IRQn);
HAL_NVIC_EnableIRQ(IPCC_C1_TX_IRQn);
HAL_NVIC_EnableIRQ(HSEM_IRQn);
HAL_InitTick(TICK_INT_PRIORITY);
HAL_ResumeTick();

Everything works correctly: data transmission, the microcontroller in sleep, and waking up.
The problem is that even when the microcontroller is in sleep, I can still detect some transmission activity from my device using the sniffer (I haven't been able to identify what type of transmission it is).

This is a big problem because I'm consuming power (due to this activity) even when the microcontroller is asleep. Apparently, part of the firmware (stack) residing on CPU2 continues to send BLE packets. How can I stop this activity?

FilipKremen
ST Employee

Hello,

stop mode 2 is the deepest mode when RF can be still active. For your case, the standby mode could be more suitable. As I mentioned before, it's not necessary to do anything about entering low power mode, the sequencer will automatically enter the chosen low power mode. Please read this document for more information.

How to build wireless applications with STM32WB MCUs - Application note

I also recommend reading this topic as it could be very helpful for your application. (You can find there an example with standby mode)

Solved: Problem with entering standby mode in STM32WB55 wh... - STMicroelectronics Community

Best regards,

Filip Kremen