cancel
Showing results for 
Search instead for 
Did you mean: 

Sensortile standby high consumption

RMous
Associate

I am working on a project using the sensortile. When the MCU is not in use, it enters a standby mode. I measured a current of 4.5 mA in standby mode. What could be the cause of such a high consumption in standby mode?

3 REPLIES 3
Mohamed Aymen HZAMI
ST Employee

Hello Rony,

Can you please share your code!

Best Regards,

Mohamed Aymen.

RMous
Associate

Hello,

I am using the Sensortile, it's a development kit based on STM32L476.

I am running a simple code to test the stand by mode :

int main( void )

{

 uint32_t msTick, msTickPrev = 0;

 /* STM32L4xx HAL library initialization:

 - Configure the Flash prefetch, instruction and Data caches

 - Configure the Systick to generate an interrupt each 1 msec

 - Set NVIC Group Priority to 4

 - Global MSP (MCU Support Package) initialization

 */

 HAL_Init();

 /* Configure the system clock */

 SystemClock_Config();

 __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU); //clear wake up bit

 HAL_DBGMCU_DisableDBGStandbyMode(); //disable debug in standby

   /* Initialize LED */

   BSP_LED_Init(LED1);

   BSP_LED_Off(LED1);

#ifdef NOT_DEBUGGING

   /* Initialize LEDSWD: Cannot be used during debug because it overrides SWDCLK pin configuration */

   BSP_LED_Init(LEDSWD);

   BSP_LED_Off(LEDSWD);

#endif

 /* Initialize RTC */

 RTC_Config();

 RTC_TimeStampConfig();

 /* enable USB power on Pwrctrl CR2 register */

 HAL_PWREx_EnableVddUSB();

 if(SendOverUSB) /* Configure the USB */

 {

   /*** USB CDC Configuration ***/

   /* Init Device Library */

   USBD_Init(&USBD_Device, &VCP_Desc, 0);

   /* Add Supported Class */

   USBD_RegisterClass(&USBD_Device, USBD_CDC_CLASS);

   /* Add Interface callbacks for AUDIO and CDC Class */

   USBD_CDC_RegisterInterface(&USBD_Device, &USBD_CDC_fops);

   /* Start Device Process */

   USBD_Start(&USBD_Device);

 }

 else /* Configure the SDCard */

 {

   DATALOG_SD_Init();

 }

 HAL_Delay(200);

 HAL_RTCEx_WakeUpTimerIRQHandler(&RtcHandle);

 HAL_RTCEx_DeactivateWakeUpTimer(&RtcHandle);

 /* Configure and disable all the Chip Select pins */

 Sensor_IO_SPI_CS_Init_All();

 /* Initialize and Disable the available sensors */

 initializeAllSensors();

 disableAllSensors();

 while (1)

 {

   /* Get sysTick value and check if it's time to execute the task */

   msTick = HAL_GetTick();

   if(msTick % DATA_PERIOD_MS == 0 && msTickPrev != msTick)

       {

         msTickPrev = msTick;

     HAL_RTCEx_SetWakeUpTimer_IT(&RtcHandle,6,RTC_WAKEUPCLOCK_CK_SPRE_16BITS);

     HAL_PWR_EnterSTANDBYMode();

       }

   }

     

  

}

with DATA_PERIOD_MS=6000

So the MCU will enter standby mode for 6 seconds and then wake up for 6 econds..

Thank you

Rony Moussa

Mohamed Aymen HZAMI
ST Employee

Hello Rony,

Before entering in Standby mode try to put all GPIOs in analog state in order to minimize the power consumption.

Best Regards,

Mohamed Aymen.