2014-06-26 10:25 AM
I am using all 4 ADC's with 4 channels used on each. ADC 1 is on DMA1 and ADCs 2-4 have channels on DMA2. All 4 ADC's run off timer15 at 1Khz. The problem I am having is that I only get DMA interrupts for ADC 3,4 a few times and then not at all. If I change the DMA priority so that it is higher on ADC4, then I only get ADC1 and ADC4. DMA2 doesn't seem to be arbitrating among the channels. It doesnt effect it if the IRQ priority on each of the DMA interrupts is the same or different.
Suggestions? #stm32-adc-dma2014-06-26 01:32 PM
Suggestions?
Is the DMA indicating any error/fault condition? The IRQ typically doesn't fire unless the DMA is actually functioning[DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Discovery/STM32F3%20Discovery%20next%20steps&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F¤tviews=2755]https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2FSTM32Discovery%2FSTM32F3%20Discovery%20next%20steps&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F¤tviews=27552014-06-26 02:05 PM
ST needs to step into this discussion to clarify. According to the reference manual, Rev 3 Section 11.4.7, DMA2 is not designed to arbitrate among channels.
DMA2 controller
The five requests from the peripherals (TIMx (x= 6,7,8), ADCx (x=2,3,4), SPI/I2S3, UART4, DAC_Channel[1,2] ) are simply logically ORed before entering the DMA2, this means that only one request must be enabled at a time. Refer to Figure 25: STM32F303xB/C and STM32F358xC DMA2 request mapping. The reference manual says DMA 1 can arbitrate between channels. The referenced figures show a similar arrangement of OR'd peripherals for each channel for both DMAs. Confusing, no ? Cheers, Hal
2014-06-26 02:12 PM
If you are not chained to the F303, the F4 has streams to take care of this sort of problem.
Cheers, Hal2014-06-26 04:18 PM
Will push to moderation.
2014-06-27 04:31 AM
Not sure about the comments on the DMA engine or'ing the channel sources together, but if I run ADC's 1 & 2 off of timer 15, then use separate timers for ADCs 3 &4 (3 timers total), then I get all the DMA interrupts.