cancel
Showing results for 
Search instead for 
Did you mean: 

How to transfer the DCMI interface data to Uart by using PSRAM and DMA

venkateshp
Associate
Posted on February 15, 2014 at 12:15

hi,

    I have used STM32F417 processor with PSRAM 64 MB size and OV5640 Camera.

I want to send the camera data  from dma to PSRAM then PSRAM to UART4.

How to configure the DMA for this above concept.

Present dma settings

uint8_t frame_buffer[640*480*2];

 

 DMA_InitStructure.DMA_Channel = DMA_Channel_1;  

//    DMA_InitStructure.DMA_PeripheralBaseAddr =  (uint32_t)(DCMI_BASE + 0x28); //vv added

  DMA_InitStructure.DMA_PeripheralBaseAddr =  (uint32_t)(DCMI_BASE); //vv added 0x50050000

 // DMA_InitStructure.DMA_Memory0BaseAddr = FSMC_LCD_ADDRESS;  //vv

  DMA_InitStructure.DMA_Memory0BaseAddr= (uint32_t)frame_buffer; //vv added

  DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory;

/* //DMA

  DMA_InitStructure.DMA_DIR = DMA_DIR_MemoryToMemory;

*/

 // DMA_InitStructure.DMA_BufferSize=frame_buffer;

  DMA_InitStructure.DMA_BufferSize = 0x25800; //(640*480*2)/4

  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_Mode_Normal Note:vv check this mode  0r

  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;

how to link  DMA_PeripheralBaseAddr to PSRAM link,and i want to capture images snapshot  10 ms intervals and store this images to psram and send images one by one PSRAM to uart4.

PSRAM  Chip select address is  FSMC_Bank1_NORSRAM2.

my requirements is camera datas need to send via uart ,how to configure this Data flow for following method. DMA to PSRAM and PSRAM to UART4.

Thanks by,

Venkat

1 REPLY 1
Posted on February 15, 2014 at 14:55

Observations:

This is TWO separate tasks, you'll need to configure a separate DMA task for each. The USART being significantly slower.

You need your buffer to be placed in your external memory.

You need the DMA to increment that memory address.

The DCMI data should come from &DCMI->DR, as I recall, and Half Words

The longest DMA transfer is 65535 units

The DMA for the UART4 will come from memory and go to the UART4->DR

This UART4 RX example could be modified to do TX. [DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Discovery/UART%20with%20DMA%20mode&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F&currentviews=5544]https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2FSTM32Discovery%2FUART%20with%20DMA%20mode&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F¤tviews=5544
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..