Large DMA buffer fails for ADC conversion - STM32H7(23ZG)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-24 4: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.
- Labels:
-
FatFS
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-24 4:31 AM
maybe you found the size of transfer limit...
in rm , DMA , registers , ..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-24 4:31 AM
maybe you found the size of transfer limit...
in rm , DMA , registers , ..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-24 4:38 AM
So how would you solve it? Is it a way to go around it or change the limit?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-24 5: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-24 5:10 AM - edited ‎2023-10-24 5: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 .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-24 5: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-24 5:13 AM
Thank you! This looks interesting! I will try!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-24 6:05 AM
Can't make it work, not even with small buffer sizes. Getting 0,0,0... at all measurements.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-24 7:47 AM - edited ‎2023-10-24 7: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)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-13 8:35 AM
Hi, did you found a solution?
I'm with the same problem here.
