cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB Custom Board issue with Low Power Mode(CFG_LPM_SUPPORTED)

세박.1
Associate II

Hi,

I would like to refer to the P-NUCLEO-WB55 example BLE_Custom and apply it to the stm32wb30 custom board.

I have succeeded in operating BLE_Custom in LPM mode on NUCLEO-WB55 by referring to the following questions.

Stm32WB custom BLE example issue with low power

Based on this example, I modified the following code to operate LPM mode on STM32WB30.

//stm32_lpm_if.c
//static void ExitLowPower(void)
 
/* USER CODE BEGIN ExitLowPower_1 */
    LL_RCC_HSE_Enable( );
    __HAL_FLASH_SET_LATENCY(FLASH_LATENCY_1);
    while(!LL_RCC_HSE_IsReady( ));
    LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_HSE);
    while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSE);
/* USER CODE END ExitLowPower_1 */
//app_ble.c
//void APP_BLE_Init(void)
 
  /* USER CODE BEGIN APP_BLE_Init_4 */
#if (L2CAP_REQUEST_NEW_CONN_PARAM != 0)
  UTIL_SEQ_RegTask(1<<CFG_TASK_CONN_UPDATE_REG_ID, UTIL_SEQ_RFU, Connection_Interval_Update_Req);
#endif /* L2CAP_REQUEST_NEW_CONN_PARAM != 0 */
  /* USER CODE END APP_BLE_Init_4 */
//app_entry.c
//void MX_APPE_Init(void)
 
/* USER CODE BEGIN APPE_Init_1 */
  APPD_Init();
  UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_DISABLE);
/* USER CODE END APPE_Init_1 */

If CFG_LPM_SUPPORTED is enabled in the .IOC file, only ~1mA power consumption occurs and advertising does not occur.

Debugging via UART is not available.

Can anyone confirm if this is also possible on custom boards other than the stm32wbx5 series?

Sorry for using the translator. thank you

1 ACCEPTED SOLUTION

Accepted Solutions
KDJEM.1
ST Employee

Hi @세박.1,

To fix it the issue: the instruction *(.MB_MEM2); should be replace by *(MB_MEM2); (extra dot removed).

Could you please refer to this thread Pay attention: Issue in STM32CubeIDE linker template file causes BLE projects don't work as expected

Thank you.

Kaouthar

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.

View solution in original post

3 REPLIES 3
세박.1
Associate II

The following code is modified and works. But I don't know why it works.

//STM32WB30CEUXA_FLASH.ld
 
   /* used by the startup to initialize .MB_MEM2 data */
   _siMB_MEM2 = LOADADDR(.MB_MEM2);
  .MB_MEM2 (NOLOAD)		  : { _sMB_MEM2 = . ; *(.MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED AT> FLASH

I wrote it wrong. after changing the IOC file to STM32WB30 using MX, the code runs and works.

KDJEM.1
ST Employee

Hi @세박.1,

To fix it the issue: the instruction *(.MB_MEM2); should be replace by *(MB_MEM2); (extra dot removed).

Could you please refer to this thread Pay attention: Issue in STM32CubeIDE linker template file causes BLE projects don't work as expected

Thank you.

Kaouthar

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.