STM32F205 DMA Problem
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-08-25 12:18 AM
Posted on August 25, 2014 at 09:18
Hello,
I am trying to use DMA to transfer data from a buffer in RAM to a GPIO BSRR port triggered by a timer. Due to the way the hardware is laid out I am committed to using TIM5 as the trigger. The DMA trigger is TIM5 Update on channel 6 stream 0 of DMA1. When I run the software the Number of Data decrements by 1 but the transfer error flag is set and the stream enable bit is reset. If I change the stream to use TIM1 Update channel 6 stream 5 on DMA2 everything works as expected. I cannot go over to using TIM1 in the application due to hardware constraints.Here is the code used to configure the DMA channelDMAInit.DMA_Channel = DMA_Channel_6;
DMAInit.DMA_Memory0BaseAddr = (uint32_t)(&LineCounter[0]); DMAInit.DMA_BufferSize = 15; DMAInit.DMA_PeripheralBaseAddr = (uint32_t)&(GPIOC->BSRRL); DMAInit.DMA_MemoryDataSize = DMA_MemoryDataSize_Word; DMAInit.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Word; DMAInit.DMA_Priority = DMA_Priority_VeryHigh; DMA_Init(DMA1_Stream0, &DMAInit); Before enabling the timer the registers of the DMA1 stream 0 areCR 0x0C035541
NDTR 0x0000000FPAR 0x40020818M0AR 0x200001E8M1AR 0x00000000FCR 0x00000008And afterCR 0x0C035540
NDTR 0x0000000E
PAR 0x40020818
M0AR 0x200001E8
M1AR 0x00000000
FCR 0x00000020
and LISR now reads 0x00000008Why does it work on DMA2 and not DMA1?What is causing this problem and how is it fixed?Thanks,Chris
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-08-25 4:38 AM
Posted on August 25, 2014 at 13:38
Why does it work on DMA2 and not DMA1? What is causing this problem and how is it fixed?
Only DMA2 supports memory-to-memory? GPIO on AHB is not a Peripheral on APB1? The initialization looks a bit spartan, can you use TIM8
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-08-25 5:29 AM
Posted on August 25, 2014 at 14:29Using TIM8 appears to be the only workable solution. The diagram I was looking at was ambiguous and I thought it suggested GPIO was accessible on both DMA channels
