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

Report here problems in any of ChibiOS components. This forum is NOT for support.
Post Reply
User avatar
kreyl
Posts: 59
Joined: Sun Jan 13, 2013 11:46 pm
Been thanked: 4 times

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

Post 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);
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

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

Post 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
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

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

Post by steved »

Worth trying this fix
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

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

Post by Giovanni »

Hi,

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

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

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

Post by Giovanni »

Closing.

Giovanni
Post Reply