Associate III
July 6, 2026
Solved
How to implement ADC4
- July 6, 2026
- 1 reply
- 58 views
I set PA6 and PA7 to ADC4_INx in CubeMX and ran CODE GENERATE.

The generated main.c file implements MX_ADC4_Init(), but it doesn't seem to be called from anywhere.
Should I call this somewhere in the main statement?
Also, I tried implementing ADC reading within the main loop, but the return value of HAL_ADC_GetValue() is always 0 (even though it's actually around VDD/2).
I've attached main.c. Could you please tell me the correct implementation method?

