cancel
Showing results for 
Search instead for 
Did you mean: 

BLE Remote using STM32WB55

fo
Associate II

Hello,

I'm working on a BLE Key Fob with 4 buttons operating on a CR2032 coin-cell battery. The goal is that the device sends a "key pressed" data with the status of all the buttons and the battery voltage a short time of period (a couple of seconds), then the device enters in to STOP2 mode, and only wakes up when a key is pressed. The data pack is formatted in BT Home format.

I used the BLE Beacon example. Currently I've managed to read the button states and the supply voltage level, make a BT Home packet, and advertise the data. However, I can't get the MCU to switch to STOP2 mode. With the CFG_LPM_SUPPORTED enabled the current consumption is approx. 100µA with a beacon interval of 1s. There are questions about stopping the advertisement, but there is not a clear answer that I could use in my project. What is the correct approach in order to achieve my requirements?

Thanks in advance.

Best Regards,
Fatih

1 ACCEPTED SOLUTION

Accepted Solutions
fo
Associate II

Hello,

I've solve the issue. The issue was caused by the still active USART1. Calling HAL_UART_MspDeInit(&huart1); before entering STOP2 mode was what needed.

Best regards,
Fatih

View solution in original post

3 REPLIES 3
STTwo-32
ST Employee

Hello @fo 

I recommend having a look at BLE_HeartRate example.

This example uses LP manager which allows you to easily manage different LP modes.

Also, you should have a look at the AN5289.

More details are available on those two discussions:

  1. Solved: How to enter stop2 mode in stm32wb, when the Ble s... - STMicroelectronics Community
  2. How to put the STM32WB55 in STOP2 mode - STMicroelectronics Community

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.

Hello @STTwo-32 ,

Thank you. I managed to stop the advertising using aci_gap_set_non_discoverable(). However, after this point the power consumption is approx. 90µA-100µA.

The following routines have been run after stopping the advertising:

 

LL_C2_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);

/* Disable all used wakeup source */

HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);

/* Suspend SysTick */

HAL_SuspendTick();

/* Enter STOP 2 mode */

HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);

 

The power consumption does not change. The consumption level is the same as between the adverting packets. Th consumption is as in the attached pictures. Basically, 5 packets are being sent, then the STOP2 mode is called. The PWR_EXTSCR.C2DS bit is 1, and C1DS bit is 0 when the device is in STOP2 mode.

The consumption has been measured to 2.5µA using the PWR_STOP2_RTC example. The only difference is that the BLE stack and ADC measurement is involved in our case. Is there anything that I miss?

Best regards,

Fatih

fo
Associate II

Hello,

I've solve the issue. The issue was caused by the still active USART1. Calling HAL_UART_MspDeInit(&huart1); before entering STOP2 mode was what needed.

Best regards,
Fatih