2023-05-21 10:32 AM
I've modified basic HeartRate project to run an ADC inside of the task. However this results in adc always returning 0. Sometimes whole application hangs. However when CFG_LPM_SUPPORTED is set to 0. Everything works fine. I've already created github issiue and suposedly HAL is to blame. Any input would be helpfull.
2023-05-21 10:32 AM
2023-07-21 07:34 AM - edited 2023-07-21 07:46 AM
Hello HKowa.1,
It looks like the HSI clock is not enabled when the application is waking-up up from stop mode.
To confirm, you can either enable the HSI clock in your HAL_ADC_MspInit function (using __HAL_RCC_HSI_ENABLE())
or you can try to use another clock source for the ADC (PeriphClkInitStruct.AdcClockSelection= RCC_ADCCLKSOURCE_SYSCLK;)
Best regards