STM32H7 HAL ADC with DMA Init ends in Error_Handler (CubeMX)
- November 12, 2019
- 3 replies
- 1653 views
Hello,
I am using an STM32H743VIH6 in a custom board. The MCU is running with 3,3V.
I generated code for the MCU with CubeMX and configured the clock, ADC1 and the DMA.
Attached the generated main.c file. Inside the fuction " MX_ADC1_Init" the Error_handler is called. Debugging shows me that "LL_ADC_REG_IsConversionOngoing(hadc->Instance)" is true, so the HAL goes to
/* Update ADC state machine to error */
SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL);
tmp_hal_status = HAL_ERROR;and to the "Error_handler". I do not understand why there should be a conversion ongoing, it is still the initialization. I tested all my code on an Nucleo STM32H743ZI and all works fine. I also compared line for line of the generated CubeMX Code for the Nucleo and the custom board and except of the GPIO names/pins the initialization is the same.
I also tested a second PCB of the custom board to verify that it is not an broken MCU due to ESD or handling.
Any ideas why the initialization of the ADC fails?
CubeMX Version is 5.4.0 STM32H7 MCU package is 1.5.0
Thanks.
Kind Regards,
Markus