cancel
Showing results for 
Search instead for 
Did you mean: 

Adding DMA SPI in RX mode help :)

randyao12345
Associate II
Posted on September 04, 2014 at 00:06

The original post was too long to process during our migration. Please click on the attachment to read the original post.
1 REPLY 1
balmukund66
Associate II
Posted on September 04, 2014 at 08:24

Hello,

The DMA configuration will be different for SPI receive mode.

Please configure the DMA as Below:

//DMA2 setup for SPI1 (DMA2_Channel3_Stream2)

DMA_DeInit(DMA2_Stream2);

DMA_InitStructure.DMA_Channel = DMA_Channel_3;

DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory; //Transmit

DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t)SPI2_Buffer;

DMA_InitStructure.DMA_BufferSize = (uint16_t)(sizeof(SPI2_Buffer)-1);

DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)&SPI1->DR;

Thanks & Regards,

Balmukund Prasad