2016-08-11 04:40 PM
dear all,
I have studied the camera sample project, it uses dma from camera address to LCD memory address. I do not have lcd in my design, so when i run the camera project, i see one whole black image. Is there a way to modify the project so that it uses dma to SD Card address directly? thanks,victor #camera2016-08-12 07:43 PM
is there anyone able to brainstorm on this project?
2016-08-14 06:44 AM
in reference manual, table 43, it shows DMA2, channel 4, stream 3, is the DMA request of SDIO. So i have the code below. I have a question: what is the memory base address of the DMA structure? Is it the FIFO address of SDIO?
/* DMA2 Stream3 Configuration */ DMA_DeInit(DMA2_Stream3); DMA_InitStructure.DMA_Channel = DMA_Channel_4; DMA_InitStructure.DMA_PeripheralBaseAddr = DCMI_DR_ADDRESS; DMA_InitStructure.DMA_Memory0BaseAddr = 0x40012C80; DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory; DMA_InitStructure.DMA_BufferSize = 1; DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable; DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Disable; DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Word; DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord; DMA_InitStructure.DMA_Mode = DMA_Mode_Circular; DMA_InitStructure.DMA_Priority = DMA_Priority_High; DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Enable; DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_Full; DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single; DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single; DMA_Init(DMA2_Stream3, &DMA_InitStructure);2016-08-14 07:54 AM
i think we need to DMA to a memory address from camera
2016-08-14 09:09 AM
The address given to the DMA controller is exactly the same as the register you'd read/write to if you were transferring data to the peripheral manually. DMA simply automates the same process in the background. Review examples of DCMI and SDIO to see what they use. Only DMA2 is capable of memory-to-memory, or peripheral-to-peripheral type configurations.
I don't think you can pipe the data directly from the DCMI to the SDIO, the forms and rates of the data don't match well. You're welcome to try, but don't expect much assistance. I'd presume you are using an STM32F4, but it helps to be specific.2016-08-14 07:59 PM
2016-08-14 10:31 PM
2016-08-14 10:36 PM
2016-08-15 02:58 AM
Thank you for replying. it is stm32f4. I spent 6 hours and i couldn't get the DMA from camera to memory working. Can i declare an array variable and use it as DMA destination address?
uint32_t buffer[8][64];DMA_InitStructure.DMA_PeripheralBaseAddr = DCMI_DR_ADDRESS; DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t) buffer;Thank you.2016-08-15 04:24 AM
You would need it to increment the memory address to fill the array. It would also fill rather rapidly. If you need to transfer the data out, you'd want to consider doubling the buffer size, and using the HT and TC interrupts to manage alternate halves of the buffer, so the data doesn't change underneath the portion you are working on.