2021-05-10 10:03 AM
I am using the Cube IDE to put the STM32H723VET into standby (which to my knowledge is the lowest power consumption). The code below is what I use, I just want to make sure this is doing things correctly and I haven't missed any settings or anything I haven't stopped. It does go to sleep and wake up but the current is higher than I think it should be. Trying to rule out something easy before I dig into Hardware!!
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU); //clear WU flag
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN4); //enable WU pin
HAL_SuspendTick();
HAL_PWR_EnterSTANDBYMode();
2021-05-11 08:10 AM
Hello Andrew_henseleit,
I was checking your code relating to PWR_STANDBY_RTC example available in STM32H7Cube software package and it looks fine to me. What current consumption are you measuring? In the code example I have mentioned there is note about making sure not to miss any wake up event with recommended sequence:
But if you are using just now wake up source this probably not apply to you. Let me know about about the measurements you are getting.
2021-05-11 08:17 AM
With our custom HW it runs nominal at 148mA but the sleep drops to 10mA. Its impossible for me to pull out just the power for the processor. I did notice AN5014 mentioned multi core needed for standby. I have updated the Standby in the HAL to match this statement and plan to test tomorrow.
2021-05-15 03:16 PM
Set DBGMCU_CR = 0; before entering standby mode and physically disconnect the debug probe.
2021-05-17 06:06 AM
The above line did not do anything to my sleep current. It appears that the issue lies somewhere in my system clock. If I sleep before that then everything is good. Clock settings attached, I do not use the RTC and have 2 external oscillators.
void SystemClock_Config(void)
{
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
/** Supply configuration update enable
*/
HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY);
/** Configure the main internal regulator output voltage
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE0);
while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {}
/** Initializes the RCC Oscillators according to the specified parameters
* in the RCC_OscInitTypeDef structure.
*/
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLM = 3;
RCC_OscInitStruct.PLL.PLLN = 68;
RCC_OscInitStruct.PLL.PLLP = 1;
RCC_OscInitStruct.PLL.PLLQ = 4;
RCC_OscInitStruct.PLL.PLLR = 2;
RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_3;
RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOWIDE;
RCC_OscInitStruct.PLL.PLLFRACN = 6144;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
Error_Handler();
}
/** Initializes the CPU, AHB and APB buses clocks
*/
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2
|RCC_CLOCKTYPE_D3PCLK1|RCC_CLOCKTYPE_D1PCLK1;
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1;
RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV2;
RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV2;
RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV2;
RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2;
RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV2;
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3) != HAL_OK)
{
Error_Handler();
}
}
2021-05-17 09:32 AM
Update #2. When I changed my wakeup pin polarity to LOW instead of HIGH, my micro goes into standby at 0.5mA. This still seems high to me, its supposed be a few microamps per the datasheet right?
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU); //clear WU flag
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN4_LOW); //enable WU pin
HAL_SuspendTick();
HAL_PWR_EnterSTANDBYMode();
2021-05-17 09:34 AM
I am measuring total system current. I now have a board with just a processor on it to isolate the issue. The lowest I can seem to get with 1 wakeup source (WAKEUP_PIN4_LOW) is 0.5mA. It does wake up but that seems too high still.
2021-05-18 07:06 AM
Update #3. I have taken out all code, I have set the everything off, all I have connected is an external oscillator and the power supplies needed to turn the chip on. Still only goes to 110uA. I don't believe my supplies are taking up 108uA or Q current. This is literally the only code in the project. What could I still possibly be doing wrong here??
HAL_Delay(5000);
HAL_Delay(5000);
HAL_Delay(5000);
HAL_Delay(5000);
HAL_Delay(5000);
//GO TO SLEEP HERE
//HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN4); //disable wakeup pin
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU); //clear WU flag
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
//HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN4_LOW); //enable WU pin
HAL_DisableDBGStandbyMode();
HAL_DisableDomain3DBGStandbyMode();
HAL_PWR_DisableBkUpAccess();
HAL_PWR_DisablePVD();
HAL_SuspendTick();
HAL_PWR_EnterSTANDBYMode();