2018-05-09 03:44 AM
Hi All,
I am working on STM32H743 MCU's DMA.
I was doing DMA transfer on the SRAM address space 0x30000000 (data transfer of 16K). I was visualizing a situation where i put this (0x30000000) address of the sram on the function (let say fft_process(uin32_t *buff)) which does some processing.
Calling Function:
fft_process( (uin32_t)0x30000000);
Let suppose if there is a last byte left to DMA and i fell in a situation ( A BUG ) where i invoke
fft_process( (uin32_t)0x30000000) before the last transfer then what are the problem pops up ?
Is it good to stacked ( here i did on the function fft_process) DMAable memory address (0x30000000) while DMA transfer is going on ?
2018-05-13 02:53 PM
Better to do DMA with a double length buffer, and the process the two halves (ping / pong) in the HT and TC interrupts, so each buffer is stable and complete during processing.
2018-05-22 11:07 PM
Thanks and Indeed true !!
My question was
'Is it good to stacked ( here i did on the function fft_process) DMAable memory address (0x30000000) while DMA transfer is going on ?'
2018-05-23 12:39 AM
I found that once the DMA function is initiated, you must exclude that ram area from tampering.
If you need to further DMA extra data, then you must use a different RAM area.
Just like
Turvey.Clive.002
suggested, I use long buffers.These days the processors have plenty of RAM, so for each Tx DMA, I usually use a static buffer of 1k but up to 4K.for the console serial port.
2018-05-31 11:53 PM
'Is it good to stacked..'
Sorry, really don't understand what you're asking there. I don't think running fft_process() on a live buffer is advisable.
You can race the buffer fill vs processing if you understand the algorithm, ie that it acts on the buffer in a linear fashion, and that processing can't reach the fill point before the data.