2018-08-13 11:16 AM
I am trying to measure the power consumption for Nucleo-144 board.
Here is my config
Is the config correct? I am trying to disable most of the buses before standby. The system doesn't seems go to standby mode since after the call, I am still able to run from IDE.
Is there anything I am missing here?
Thx
HAL_ADCEx_DisableVoltageRegulator(&hadc1);
// HAL_CAN_RequestSleep(&hcan1);
HAL_CAN_Stop(&hcan1);
LL_SPI_Disable(hspi1.Instance);
LL_SPI_Disable(hspi2.Instance);
LL_USART_Disable(huart1.Instance);
LL_USART_Disable(huart2.Instance);
LL_USART_Disable(huart4.Instance);
__HAL_RCC_SPI1_CLK_DISABLE();
__HAL_RCC_SPI2_CLK_DISABLE();
__HAL_RCC_CAN1_CLK_DISABLE();
__HAL_RCC_USART1_CLK_DISABLE();
__HAL_RCC_USART2_CLK_DISABLE();
__HAL_RCC_UART4_CLK_DISABLE();
__HAL_RCC_I2C1_CLK_DISABLE();
__HAL_RCC_I2C2_CLK_DISABLE();
__HAL_RCC_RTCAPB_CLK_DISABLE();
// Disable all used wakeup sources: WKUP pin
HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN2);
HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN3);
// Clear all related wakeup flags
/* Clear PWR wake up Flag */
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
__GPIOA_CLK_DISABLE();
__GPIOB_CLK_DISABLE();
__GPIOC_CLK_DISABLE();
__GPIOD_CLK_DISABLE();
__GPIOE_CLK_DISABLE();
__PWR_CLK_DISABLE();
SysTick->CTRL=0x00;
// HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN2);
// HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN3);
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
HAL_PWR_EnterSTANDBYMode();
2018-08-13 11:32 AM
It's interesting. Following GPIO clock disable code actually make system not going to standby mode. I am not sure what's happening. Thx
__GPIOA_CLK_DISABLE();
__GPIOB_CLK_DISABLE();
__GPIOC_CLK_DISABLE();
__GPIOD_CLK_DISABLE();
__GPIOE_CLK_DISABLE();
__PWR_CLK_DISABLE();
SysTick->CTRL=0x00;
2018-08-13 11:45 AM
Have you tried using an ammeter across the pins normally occupied by JP5? The IDD Jumper
2018-08-13 12:03 PM
I got 16 mA for both standby and shutdown mode. The value should be much lower. Is the config not right or something else ? Thx
2018-08-13 12:23 PM
Yeah, IDD works as expected, down to 0.38 mA in standby mode. Now I am moving to our own board, seems SPI disable function doesn't seems functional well. Thx
2018-08-14 11:29 AM
I can only go down to 2 mA for the standby mode for our board. I am not sure if there is anything missing.
I am pretty sure the only thing power with 3.3 VL is the MCU. We removed external flash, EEPROM. No other component is powered.
Any thoughts what might be missing?
Thx
2018-08-14 11:57 AM
Not really, I can't commit resources to low-power issues. You should talk with the FAE supporting your design, and perhaps contact the local sales office if your account doesn't have one.
2018-08-14 12:15 PM
One thing I am working on is the GPIO pin before going standby mode. Should I program it to RESET or high impedance or is this matter? Thx
2018-08-14 12:44 PM
One thing I noticed is the UART port. Even I already disable UART, CLOCK, the TX/RX pin still consume power. Not sure what's going on. Thx
LL_USART_Disable(huart1.Instance);
LL_USART_Disable(huart2.Instance);
LL_USART_Disable(huart4.Instance);
__HAL_RCC_SPI1_CLK_DISABLE();
__HAL_RCC_SPI2_CLK_DISABLE();
__HAL_RCC_CAN1_CLK_DISABLE();
__HAL_RCC_USART1_CLK_DISABLE();
__HAL_RCC_USART2_CLK_DISABLE();
__HAL_RCC_UART4_CLK_DISABLE();
// USART1 GPIO Configuration
// PB6 ------> USART1_TX
// PA10 ------> USART1_RX
GPIO_InitStruct.Pin = GPIO_PIN_10;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_6;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_6, GPIO_PIN_RESET);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_10, GPIO_PIN_RESET);
2018-08-16 09:40 AM
Finally figured out the 2 mA was eaten by the JTAG/ST-LINK connection, Removed the JTAG connector will bring the power consumption down to 0.01 mA. Thx