2023-10-24 04:22 AM
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!
Solved! Go to Solution.
2023-10-24 04:31 AM
maybe you found the size of transfer limit...
in rm , DMA , registers , ..
2023-10-24 04:31 AM
maybe you found the size of transfer limit...
in rm , DMA , registers , ..
2023-10-24 04:38 AM
So how would you solve it? Is it a way to go around it or change the limit?
2023-10-24 05:06 AM
>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.
2023-10-24 05:10 AM - edited 2023-10-24 05:17 AM
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.
(if it count the destination /32b tranfers - i dont know , just try it ! )
if not - try the MDMA .
2023-10-24 05:12 AM
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.
2023-10-24 05:13 AM
Thank you! This looks interesting! I will try!
2023-10-24 06:05 AM
Can't make it work, not even with small buffer sizes. Getting 0,0,0... at all measurements.
2023-10-24 07:47 AM - edited 2023-10-24 07:48 AM
if not - try the MDMA . blocks x blocksize -- should give a lot.
(but i never tried - so i cannot say : this is the solution)
2024-10-13 08:35 AM
Hi, did you found a solution?
I'm with the same problem here.