Reading analog values in STM32DUINO

Hi,

I have a need to read some ADC values in a SimpleFOC app. The Arduino AnalogRead take too much time and interfere with FOC operation, so I’d like to use the HAL.

Board: NUCLEO64-STM32G474RE
Platform: PlatformIO with vscode

a) I tried the code here on a fresh project, fresh board:

But it hung at the first call to HAL_ADC_ConfigChannel:

sConfig.Channel = ADC_CHANNEL_0;
sConfig.Rank = 1;
sConfig.SamplingTime = ADC_SAMPLINGTIME;
HAL_ADC_ConfigChannel(&hadc, &sConfig); <<<<< HANG HERE

b) Is there any way to leverage the current shunt code, which I assume also uses STM32DUINO. I am NOT using current shunt for my projects.

Thanks in advance, Steve