2012-01-13 04:53 PM
We've been working on this problem with the F2x and F4x for some time, and figure it's about time to warn others about what we've found. You can find the full details here:
http://blog.frankvh.com/2012/01/13/stm32f2xx-stm32f4xx-dma-maximum-transactions/
but in short, you probably should limit the number of simultaneous DMA transfers to 2. We've seen problems with more than 2 active DMAs on both the STM32F2xx and F4xx parts. We've given a testcase to ST and they've confirmed seeing this problem - hopefully they can shed some more light on what's going on.2012-01-15 02:20 AM
Hi,
I have been unable to reproduce the problem so far. I wrote a test application using 3 SPIs and 1 ADC running continuously and using DMAs, 7 DMA streams in use together, I'll add more later (I2C and SDIO). The testhttp://www.chibios.org/dokuwiki/doku.php?id=chibios:articles:stm32f4_discovery:testdma
. The application does not detect DMA errors or DMA timeouts (SPI operations are guarded by timers looking for missing TCs, DMA errors halt the system and the LED would stop flashing). Could you share a test case? BTW, your blog is very interesting. Giovanni ---2012-01-16 06:00 PM
I'm following this thread with interest, as I've grown quite fond of the DMA ''capability''.
So, what do I convert to interrupt:2012-01-20 12:30 AM
I've noticed this thread slipping down the list. The question seems so important (to me) that I'm surprised ST haven't leapt to the defence of their STM32 designs.
Frank - If you discover why you think more than 2 DMA doesn't always work and why Giovanni finds it does, I hope you'll explain on your excellent blog. I'm particularly interested as I hope to use (on STM32F4XX) the camera and SDIO with DMA as well as USARTS - although maybe not at the same time given what you've written. thanks ...2012-01-21 01:55 AM
I updated my test application (
http://www.chibios.org/dokuwiki/doku.php?id=chibios:articles:stm32f4_discovery:testdma
) by adding two continuous memory to memory DMA copy operations in background (at lowest DMA priority), nine DMA streams total. All DMA operations are guarded by watchdog software timers in order to catch missing DMA events, it is running since yesterday and still nothing. Now, my application does not use the ST FW library but a different framework so I wonder if there could be a software issue involved or some side effect triggered by something I am not using in my test case. Giovanni ---2012-01-22 08:21 AM
I have a lot of questions about this as well - certainly I don't fully understand it at all. On our hardware it is clear, however you'd need an image sensor on the DCMI port to be able to replicate it (plus an SD card although those are more common). I also have an email from ST saying they've replicated the problem so it's not just us. I cannot publicly distribute our piece of code because it's a portion of our application. I have tried all manner of things to find a ''software'' reason for this behaviour, but haven't succeeded - it really does appear to be hardware.
I would like to create a more ''general purpose'' testcase which replicates this problem. Ideally something that doesn't involve the DCMI port because that's a less commonly used port (and every image sensor is different). At the moment I'm tied up with some other work so it's not going to happen in the immediate future. It is on my list of things to do.2012-01-22 02:42 PM
Hi Franck,
We confirm your findings and it is a limitation that concerns only our DMA2, and here is the detailed description : DMA2 controller could corrupt data when managing AHB and APB2 peripherals in a concurrent way : Description : This case is somehow critical for peripherals embedding FIFO and generates data corruption. For memories, the impact is a multiple access but the data is not corrupted. AHB Peripherals embedding FIFO are DCMI, CRYPT, HASH. on STM32F2/40xx without CRYPTO only the DCMI is impacted. Implications: The data transferred by the DMA to the AHB peripherals could be corrupted in case of a FIFO target or multiply accesses in case of memories access. Workarounds : Avoid concurrent AHB and APB2 transfer using DMA2. One of the following approach could be used to solve the issue:If DMA2 is used to manage AHB peripheral (DCMI, CRYPT, HASH), we can use the Cortex-M CPU to manage APB2 peripherals.
If DMA2 is used to manage APB2 peripheral, we can use the CPU to manage AHB peripheral (DCMI, CRYPT, HASH).
Obviously, we will update our errata on web soon .
Thank you again for your findings . Cheers, STOne-32 { STM32 moderator } PS:You have a really Nice blog.
2012-01-23 06:58 AM
Hi STOne-32,
Would you kindly explain, what CCI, in STM32F4 context, means ?I just searched RM0090 throughly, followed by Google search for this term.Zero, null, nada results found...RegardsJacek2012-01-23 07:24 AM
Would you kindly explain, what CCI, in STM32F4 context, means ?
CMOS/CCD Camera Interface = DCMI2012-01-23 09:27 AM
Hi Jacek,
Sorry for the typo it should DCMI not CCI. The post was updated below. Cheers, STOne-32.