2022-01-20 11:11 AM
I'm using STM32L412KBUx on NUCLEO-L412KB, STM32CubeIDE, Version: 1.8.0.
Design:
Problem: After waking, the ADC does not seem to be running. The contents of the memory that holds the ADC readings just stay at their old values.
To enter STOP2, I'm using this:
HAL_SuspendTick();
__disable_irq();
__DSB();
__ISB();
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFE);
// sleeping until wakeup event...
To wake:
SystemClock_Config();
HAL_ResumeTick();
/* Exit with interrupts enabled. */
__enable_irq();
I suspect I need to do something to restart the ADC clock.
I tried adding this before the STOP2 entry code above:
if (HAL_OK != HAL_ADC_Stop_DMA(&hadc1))
Error_Handler();
and this following the exit code:
if (HAL_OK != HAL_ADC_Start_DMA(&hadc1, (void *)&raw_recs, ADC_RAW_REC_LEN))
Error_Handler();
but it doesn't seem to make any difference.
Do I need to call something like HAL_RCCEx_PeriphCLKConfig, or perhaps HAL_RCCEx_WakeUpStopCLKConfig?
Solved! Go to Solution.
2022-01-20 02:59 PM
Oh, never mind, I had a dumb logic error in my code. The ADC is indeed running.
2022-01-20 02:59 PM
Oh, never mind, I had a dumb logic error in my code. The ADC is indeed running.