2025-02-05 08:09 PM
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
2025-02-06 12:15 AM - edited 2025-02-06 12:15 AM
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();
2025-02-06 08:27 PM
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 .
2025-02-07 03:13 AM
@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 ...