cancel
Showing results for 
Search instead for 
Did you mean: 

Can i connect channel 0 for multiple DMA2 streams ?

Mani1
Associate II

Board : STM32F746g disco

I configure ADC1 with DMA2 Stream4

My LCD configured in DMA2 Stream 0

Both are having the same DMA Channel 0. Is it okay or not. any conflict are there for this configuration. Because i did not get any output from both ADC and LCD side. Can i use DMA_CHANNEL_0 both cases ?.

ADC1:

 hdma_adc1.Instance = DMA2_Stream4;

 hdma_adc1.Init.Channel = DMA_CHANNEL_0;

LCD :

 DmaHandle.Instance = DMA2_Stream0;

DmaHandle.Init.Channel = DMA_CHANNEL_0; 

Thanks

Manikandan

8 REPLIES 8

> Both are having the same DMA Channel 0. Is it okay or not.

"Channel" in the DMA in 'F7 is just another name for "trigger source selection". So one Stream's Cannel selection does not influence other streams in any way.

Your problem will be elsewhere. Do the DMA work individually? Don't you overload the system, leading e.g. to overruns in ADC?

JW

Mani1
Associate II

Thank you @Community member​ 

I checked the DMA individually, it is working fine. But now i am using FreeRTOS for read the ADC value and LCD display checking. I create some Testing task for FreeRTOS, the testing tasks are working fine. I want to check ADC with DMA using FreeRTOS. Can you Suggest any document or video or any link for ADC with DMA using FreeRTOS concept. I am struggled in this task, give me some solution.

Thanks

Manikandan

Maybe you are simply exhausting the system resources, for which there is no solution except radical redesign.

JW

Hai @Community member​ 

I can not understand your answer, can you explain clearly. Because i am a beginner of this FreeRTOS concept.

Thanks

Manikandan

Maybe you attempt to do too many things, and the mcu can't do that. For example, high volume LTDC traffic, plus high ADC sampling frequency may result in buses to be clogged, resulting in ADC overflow and whatever follows from that (see ADC overflow description in datasheet).

JW

You're unlikely to get tutorials here, people have their own commitments/jobs.

Perhaps if the system is choking you should look at the rate you have the ADC running. In most cases you'll want to pace them with a TIM rather than run the ADC into saturation

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

hello @Community member​ 

Thank you for your answers

Mani1
Associate II

Here i Attached my main.c file for your reference. I create two FreeRTOS tasks. One for ADC and another one for Display. Both tasks working fine when i am using ADC polling method, because in polling method no use of Callback function. But i ADC_DMA concept callback function also there, i don't know how to handle this type tasks. Now first i start ADC_Check task , then callback function called. After that nothing will be printed. I am using some function for printing adc value.