Re:Debugging bare-metal STM32 from the seventh level of hell
by jpieper on Monday August 08, 2022 @05:07AM
(#32383586)
Actually, if you look at the firmware at the time, the proper procedure was followed as far as I can tell. All of the necessary bits were set and checked with the appropriate delays where required.
https://github.com/mjbots/moteus/blob/dcb900c92ffd5d5c8f5405...
Notably, the datasheet is largely silent on interactions between different ADCs during initialization.
ADEN bit on g4:
"Note: The software is allowed to set ADEN only when all bits of ADC_CR registers are 0 (ADCAL = 0, JADSTART = 0, ADSTART = 0, ADSTP = 0, ADDIS = 0 and ADEN = 0) except for bit ADVREGEN which must be 1 (and the software must have wait for the startup time of the voltage regulator"
No errata needed, it's clearly stated that you cannot just set ADEN without waiting for certain other conditions.