2015-09-27 05:19 AM
Hello,
Im developing some applicatnion whitch must use FreeRTOS and sample 2 channels ADC. I decided to use DMA mechanism for easier data preparation. Code is fully generated from ST CubeMx and just without FreeRTOS works fine.Here is same topic but there is no answer:/public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=https%3a//my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/ADC%20with%20DMA%20in%20FreeRTOS&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F¤tviews=955
I created few task to refresh LCD, read Touchscreen state and some more... DMA works once and then processor do not goes into DMA interrupt and do not refresh buffer. I have no more ideas. I think FreeRTOS is bad configured for DMA and thats the reason of this behaviour.
Can you help? #dma #adc #freertos2015-09-28 07:36 AM
Hi koziel.arkadiusz,
Is it possible to check where does your project get stuck?-Mayla-To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2015-09-28 12:03 PM
FreeRTOS does indeed work well with ADC and DMA so it's more likely your code is missing a check for an error condition. As in the original post you reference you need to provide the state of DMA channel and an example of how you handle DMA interrupts.
Do you enable the error interrupts for DMA? Never ignore the error interrupts for any device; they exist for a reason. If you do, your program may never complete, precisely as you describe. You should also check for ADC errors. If the ADC conversion stops the DMA will never complete, again, precisely as you describe your problem. Your first task should be to determine what happens to the DMA. Use timeouts waiting for DMA completion and insert a breakpoint in the debugger so you can examine the DMA and ADC channel status. Jack Peacock