cancel
Showing results for 
Search instead for 
Did you mean: 

Large DMA buffer fails for ADC conversion - STM32H7(23ZG)

elso
Associate III

Hi, I have a problem. I want to store 262144 (256KB) bytes of data in a buffer from the integrated ADC on STM32H723ZG. However it fails when the buffer is too large. I started at an buffer size of 4096 elements (uint8_t) and doubled until 65536 where it failed (only output is 0, 0, 0...). I am using a circular buffer with continuous conversion on the DMA.

Can anybody help me to find out what the cause of this problem is, and how to fix it? The total capacity on the RAM_D1 is 320KB, so 256KB should be enough... 

Thanks for all the help I get! 

1 ACCEPTED SOLUTION

Accepted Solutions
AScha.3
Chief II

maybe you found the size of transfer limit...

AScha3_0-1698146980184.png

in rm , DMA , registers , ..

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

View solution in original post

8 REPLIES 8
AScha.3
Chief II

maybe you found the size of transfer limit...

AScha3_0-1698146980184.png

in rm , DMA , registers , ..

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

So how would you solve it? Is it a way to go around it or change the limit?

Pavel A.
Evangelist III

>until 65536 where it failed

This is an interesting number 🙂  Some ST drivers indeed have 16-bit typed counters/sizes. Read the sources. Don't ignore compiler warnings. 

the limit is fix, "number of data" is a 16 b register.

you just want 8 bit from adc ? so set source to byte,

but if you using the cache and set destination to word (32 b), you could get 64k x4 = 256k byte.

AScha3_0-1698149402612.png

(if it count the destination /32b tranfers - i dont know , just try it ! )

if not - try the MDMA .

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

Works at 65535, but everything above makes the DMA transfer fail (>=65536). Seems like the limit is at 16-bit 🙂 Will have to find a workaround!

Maybe waiting for the:

HAL_ADC_ConvHalfCpltCallback(ADC_HandleTypeDef* hadc)

and

HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc)

To do memory transfers of half the buffer at the time to another buffer.

Thank you! This looks interesting! I will try!

Can't make it work, not even with small buffer sizes. Getting 0,0,0... at all measurements.

if not - try the MDMA .   blocks x blocksize -- should give a lot.

 

(but i never tried - so i cannot say : this is the solution)

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