Skip to main content
Itamar Eliakim
Associate II
Solved

STM32G474 Multiple ADC DMA crash

Hey.

I am trying to run ADC DMA sampling on multiple buses/channels, running in parallel to a few FreeRTOS tasks.

The following initialization causes unstable behavior and device halt upon boot:

 

HAL_ADC_Start_DMA(&hadc1, (uint32_t*)adc1_buf, 3);
HAL_ADC_Start_DMA(&hadc2, (uint32_t*)adc2_buf, 2);
HAL_ADC_Start_DMA(&hadc3, (uint32_t*)adc3_buf, 5);
HAL_ADC_Start_DMA(&hadc5, (uint32_t*)adc5_buf, 2);

 

 

 

Everything works perfectly if I comment out one line (any of them), and unstable/halts if I initialize all 4 streams.

 

Any idea?

 

 

Thanks.

Itamar

This topic has been closed for replies.
TDK
TDKBest answer

Perhaps the sum of those calls stresses the system too much, either overwhelming the DMA with requests or the CPU with interrupts. What sample rates are we talking about here? What happens if you reduce those by a factor of 10?

"If you feel a post has answered your question, please click ""Accept as Solution""."

2 replies

TDK
TDKBest answer

Perhaps the sum of those calls stresses the system too much, either overwhelming the DMA with requests or the CPU with interrupts. What sample rates are we talking about here? What happens if you reduce those by a factor of 10?

"If you feel a post has answered your question, please click ""Accept as Solution""."
Itamar Eliakim
Associate II

Wonderful. Thanks @TDK!
That was it :) Drastically increased the clock divider on all ADCs, and changed NVIC priority, everything now works properly.