cancel
Showing results for 
Search instead for 
Did you mean: 

camera project without dma to LCD

victory015
Associate II
Posted on August 12, 2016 at 01:40

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

#camera
15 REPLIES 15
victory015
Associate II
Posted on August 13, 2016 at 04:43

is there anyone able to brainstorm on this project?

victory015
Associate II
Posted on August 14, 2016 at 15:44

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);

victory015
Associate II
Posted on August 14, 2016 at 16:54

i think we need to DMA to a memory address from camera

Posted on August 14, 2016 at 18:09

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
victory015
Associate II
Posted on August 15, 2016 at 04:59

victory015
Associate II
Posted on August 15, 2016 at 07:31

victory015
Associate II
Posted on August 15, 2016 at 07:36

victory015
Associate II
Posted on August 15, 2016 at 11:58

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.

Posted on August 15, 2016 at 13:24

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..