Page 1 of 1

F072: DMA1.5 TC IRQ does not work if DMA1.7 setup first

Posted: Mon Sep 18, 2017 6:59 pm
by kreyl
OS: chibios v 17.6.0
MCU: stm32f072c8t6
Board: custom
DMA1_STREAM5 used for SPI2 TX, Transmission Complete interrupt required
DMA1_STREAM7 used for USART3 TX, Transmission Complete interrupt NOT required

If Stream7 initialized before Stream5, TC IRQ of Stream5 does not fire.
If Stream5 initialized before Stream7, TC IRQ of Stream5 works ok.

Data transmission works ok in both scenarios.
USART3 works non-stop (circulary), feeding LCD with data. SPI2 works time after time to control WS2812 LEDs.

Here is initialization code (very similar):

Code: Select all

#define LCD_DMA         STM32_DMA1_STREAM7  // USART3 TX
#define LEDWS_DMA       STM32_DMA1_STREAM5  // SPI2 TX
...
    dmaStreamAllocate     (LEDWS_DMA, IRQ_PRIO_LOW, LedTxcIrq, NULL);
    dmaStreamSetPeripheral(LEDWS_DMA, &LEDWS_SPI->DR);
    dmaStreamSetMode      (LEDWS_DMA, LED_DMA_MODE);
...
    dmaStreamAllocate     (LCD_DMA, IRQ_PRIO_LOW, nullptr, nullptr);
    dmaStreamSetPeripheral(LCD_DMA, &USART3->TDR);
    dmaStreamSetMemory0   (LCD_DMA, IBuf);
    dmaStreamSetTransactionSize(LCD_DMA, LCD_VIDEOBUF_SIZE);
    dmaStreamSetMode      (LCD_DMA, LCD_DMA_TX_MODE);
    // Start transmission
    dmaStreamEnable(LCD_DMA);

Re: F072: DMA1.5 TC IRQ does not work if DMA1.7 setup first

Posted: Sun Oct 01, 2017 3:12 pm
by Giovanni
Hi,

Could you verify if it is related to the problems fixed in this thread?

viewtopic.php?f=35&t=4207

If not then probably there are more similar errors in the F0 registry.

Giovanni

Re: F072: DMA1.5 TC IRQ does not work if DMA1.7 setup first

Posted: Fri Oct 06, 2017 8:15 am
by steved
Worth trying this fix

Re: F072: DMA1.5 TC IRQ does not work if DMA1.7 setup first

Posted: Sat Oct 07, 2017 1:26 pm
by Giovanni
Hi,

I committed the fix from steved, could you confirm if it fixes your problem too?

Giovanni

Re: F072: DMA1.5 TC IRQ does not work if DMA1.7 setup first

Posted: Sun Nov 05, 2017 2:11 pm
by Giovanni
Closing.

Giovanni