cancel
Showing results for 
Search instead for 
Did you mean: 

adc going to error handler

Srinath_03
Associate III

hi, I'm using adc1 and adc2 in multimode dma , normally when i start it is working and reading correctly, when again im calling mx_adc1_init function it is going to error handler, i don't know why, since I'm not deinit and reinit again the peripheral, directly calling the mx_adc1_init. why it is happening like this how to restart the again. since other gpio and fdcan peripherals are working fine with same init if i calling once again.

 

i have tried with hal deinit function also same behaviour only this time other peripherals also not working 

 

can someone suggest how to rectify this issue

3 REPLIES 3
Imen.D
ST Employee

Hello @Srinath_03 

Please share more details as possible to help you solve your issue. If possible to share your code.

Have you used STM32CubeMx to generate your initialization code ?

Have you tried running the ADC example from the Cube firmware?

Which Cube/CubeMX version used? (make sure to use latest release which contains fixes)

Maybe you have an issue with DMA initialization (check if it is called before the ADC initialization).

Note that DMA clock needs to be enabled before configuring the ADCs to use DMA.

 

MX_GPIO_Init();
MX_DMA_Init();
MX_ADC1_Init();
MX_ADC2_Init();

 

 

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

Hi, Thanks for your response

I'm using stm32cubeide for code generation and version 1.6 

 how to enable the dma clock in the code before using dma

since I'm using multimode dma  HAL_ADC_START_MULTIMODE_DMA function only calling for starting adc and dma

running and all fine once I'm calling MX_ADC1_INIT function going to error handler.

thus u have any idea of which are the peripherals can be used again by calling the respective MX_peripheral_init function , without stopping or deiniting the peripheral again .

 

 

 


@Srinath_03 wrote:

 it is going to error handler, i don't know why


So try stepping through that function in the debugger to see why ...