AnsweredAssumed Answered

stm32f373 sdadc with dma -> sporadic transfer errors

Question asked by soerensen.jan.001 on Sep 7, 2016

Hi,

I use the sdadc1 to measure 4 voltages in continous mode, single ended, injected, dma circular transfer to an array[4]. Apart from a huge offset error I don't know where it comes from, I see that either the SDADC is not always scanning the 4 channels correctly or the DMA controller is not always filling the array correctly. I test with a voltage on only one of the 4 Inputs. After x minutes the voltage appears in a different location of the array, which means there is a sequence error somewhere. And it is wandering....

A[0] : 12V

A[1]: 0V

A[2]: 0V

A[3]: 0V

after a few seconds up to a minute the 12V will appear at A[3], then at A[2], then at A[1], then at A[0], then at A[3]... and so on.

I see this in the watch window of uVision. I guess that the tool should be ok.

Where does it come from?

How to prevent it?

I thought about changing the DMA transfer to normal and set up the DMA in the DMA Interrupt for the next group scan. My worry is if this is fast enough...

Somehow it's an unsafe system if a sequence error can not be detected/corrected, because in reality it's difficult to check if the voltages are still correct or mixed up. Better would be a forced addressing so an error is only for one group scan and then corrected.

Can anybody help me?

Ps: Code is from CubeMx 4.15.0. Then there is an error in the initializing for several injected Inputs as only the highest channel is set in the sdadc register. Before starting the sdadc I overwrite that Register to enable the scanning of all 4 channels.

Outcomes