Skip to main content
Visitor II
July 5, 2021
Question

Can i connect channel 0 for multiple DMA2 streams ?

  • July 5, 2021
  • 5 replies
  • 1862 views

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

    This topic has been closed for replies.

    5 replies

    Super User
    July 5, 2021

    > 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

    Mani1Author
    Visitor II
    July 6, 2021

    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

    Super User
    July 6, 2021

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

    JW

    Mani1Author
    Visitor II
    July 6, 2021

    Hai @Community member​ 

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

    Thanks

    Manikandan

    Graduate II
    July 7, 2021

    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

    Super User
    July 6, 2021

    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

    Mani1Author
    Visitor II
    July 7, 2021

    hello @Community member​ 

    Thank you for your answers

    Mani1Author
    Visitor II
    July 7, 2021

    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.