2014-02-11 03:05 AM
Hi I am working with stm32f4 DCMI and SDIO interface. Both peripherals are connected to DMA2. I need to store data taken (from DCMI) by DMA2 to SDIO. I have set the following configurations.
DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)(DCMI_BASE + DCMI->DR); // Source Address 1st locationDMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t) (SDIO->FIFO); // Destination address 1st locationDMA_InitStructure.DMA_DIR = DMA_DIR_MemoryToMemory; // DCMI FIFO (4 words) to SDIO FIFO (32 words)DCMI DMA is configured in ping pong mode. DCMI FIFO is only 4 words deep where as SDIO FIFO is 32 words deep. I also want to configure SDIO Fifo in ping pong mode. This has created confusion for me and after a lot of browsing I am still confused. Does any body have an idea how I achieve this? i.e. Data from DCMI to SDIO using DMA2. ThanksBaber #sdio #stm32f4 #dcmi-dma-camera2014-02-11 03:27 AM
ST manual par. 10.3.1 General Description
It can carry out the following transactions:
• peripheral-to-memory
• memory-to-peripheral
• memory-to-memory I think you can't move data from peripheral to peripheral using DMA But wait also replies from experts
2014-02-11 05:02 AM
Does any body have an idea how I achieve this?
It's an interesting experiment, but I suspect doomed to fail. I think you'd want to go through a RAM based buffer, permitting the SDIO to throttle it's requests, as you're almost certainly not going to have the rates align cleanly. Is the take up rate of your SD card in write mode going to be adequate? Also you need to understand what an address is, because the values you're passing to the DMA controller are incorrect. DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)(&DCMI->DR); DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t) (&SDIO->FIFO);2014-02-11 06:34 AM
Thanks guys for guidance; this is what i have thaught but i just wanted to be sure. Mr.Clive how do I achieve this? DCMI to RAM buffer using DMA2 and then from RAM to SDIO agiain using DMA2.
2014-02-11 06:36 AM
Thanks guys for guidance; this is what i have thaught but i just wanted to be sure. Mr.Clive how do I achieve this? DCMI to RAM buffer using DMA2 and then from RAM to SDIO again using DMA2. Keeping clock rate high. Am i thinking in correct way!
2014-02-11 07:54 AM
Well the SDIO side of it, you're almost certainly want to use an SDIO driver, with a file system implementation like FatFs stuck on top. I've posted examples of this before, both as a SDIO+FATFS implementation, and as an ADC to SDIO+FATFS.
I haven't worked with the camera interface, but you'd set you DCMI DMA transfers to occur to memory buffers, and then transfer that data in 8K or 32K chunks to the file system side, which would handle all the SDIO/DMA itself.2014-02-11 08:26 PM
Thanks Mr. Clive. Any links to ''
ADC to SDIO+FATFS
'' example.