When I had generated code with dual ADC on regular simultaneous mode from STM32CubeMX, the code after compiled couldn't get to work and rised error handler, so I traced the problem, found that there is a multiple mode configure function in ADC init function, but the configure function only works with ADC1, here is the reason. and I will illustarte it below:
- Here is the configure of ADC1 and ADC2
- This is the code in ADC2_Init function:
- The source code of this function, in the read box, the statement will be false:
- Here is the macros:
So, this code in ADC2_Init is meaningless, and bolck the program, I have to delete it everytime after I regenerated the project.
Hopes It's usefull for your guys.