2014-02-14 09:01 AM
Hi All,
reading the reference manual of the STM32, I have a question related to a transfer peripheral to memory using DMA, direct mode ( no FIFO )In section 9.3.12, Direct Mode paragraph, i found:Direct modeBy default, the FIFOoperates
in direct mode (DMDIS bit in the DMA_SxFCR is reset) and the FIFO threshold level is not used. This mode is useful when the system requires an immediate and single transfer to or from the memory after each DMA request.
When the DMA is configured in direct mode (FIFO
disabled
), to transfer data in memory-toperipheral mode, the DMA preloads one data from the memory to the internal FIFO toensure an immediate data transfer as soon as a DMA request is triggered by a peripheral.
To avoid
saturating the FIFO
, itis recommended to configure the corresponding stream witha high priority.My question is: even if the FIFO threshold is not used, is the FIFO still active? To say with other words: if the peripheral is sending bytes at a very high speed, it can happen that I lost a byte or the FIFO helps me to store the previous bytes? Thank you very much,Antonio #dma-fifo #fifo #direct-mode #dma
2014-02-19 07:21 AM
2014-02-19 07:46 AM
The model is STM32F205. With very high speed I mean a peripheral sending bytes very fast. E.g. UART @921600 ( a byte every 10us )
Ok, so not particularly fast compared to a processor running at 120 MHz, I think where it will start having consequences is a 30 MHz or so (ie a significant percentage of available bandwidth), where hard deadlines are difficult to meet with contended buses.2014-05-30 03:21 AM
Hi Antonio,
I'm probably facing a very similar problem. Moreover I see that, supposing that DMA perfoms multiple write actions to memory without waiting for a TC interrupt clear, no ''Direct Mode Error'' notification. From Reference Manual: ''Direct mode error: the direct mode error interrupt flag (DMEIFx) can only be set in theperipheral-to-memory mode while operating in direct mode and when the MINC bit in
the DMA_SxCR register is cleared. This flag is set when a DMA request occurs while
the previous data have not yet been fully transferred into the memory (because the
memory bus was not granted). In this case, the flag indicates that 2 data items were be
transferred successively to the same destination address, which could be an issue if
the destination is not able to manage this situation''.
Have you found a workaround?Thank you in advance.Ciao
2014-05-30 03:21 AM
Hi Antonio,
I'm probably facing a very similar problem. Moreover I see that, supposing that DMA perfoms multiple write actions to memory without waiting for a TC interrupt clear, no ''Direct Mode Error'' notification. From Reference Manual: ''Direct mode error: the direct mode error interrupt flag (DMEIFx) can only be set in theperipheral-to-memory mode while operating in direct mode and when the MINC bit in
the DMA_SxCR register is cleared. This flag is set when a DMA request occurs while
the previous data have not yet been fully transferred into the memory (because the
memory bus was not granted). In this case, the flag indicates that 2 data items were be
transferred successively to the same destination address, which could be an issue if
the destination is not able to manage this situation''.
Have you found a workaround?Thank you in advance.Ciao
2014-05-30 03:49 AM
Start a new thread and describe in detail your problem there.
JW