Skip to main content
Graduate
July 26, 2024
Solved

STM32F3 USART1 in LIN mode, is it possible to use a DMA for outgoing messages, but RXNE interrupt/reading data register for incoming messages?

  • July 26, 2024
  • 1 reply
  • 1013 views

I acquired some code for an STM32F3 that performs LIN communication over USART1.  Previously the code used DMA channels for both memory-to-peripheral and peripheral-to-memory transfers to/from USART1, but it had some problems that required restructuring the code so that USART1 instead interrupts on RXNE and the received bytes are read from the peripheral in the ISR.  Currently LIN transmissions are still driven by a memory-to-peripheral DMA channel.

However, since I made that change I have not been able to get any LIN messages to transmit from USART1.  So my question is: can USART1 simultaneously support DMA for the memory-to-peripheral direction (transmit) and non-DMA (RXNE interrupt) for the peripheral-to-memory direction (receive)?  I was unable to find a definitive answer in the STM32F3 data sheet so I wanted to check that this should be possible before I dig into debugging.

    This topic has been closed for replies.
    Best answer by Dazai

    Of course right after I posted I figured it out.  I accidentally had the code to enable the DMA TX request and to enable the DMA commented out and after adding them back, LIN RX and TX worked properly.

    1 reply

    DazaiAuthorAnswer
    Graduate
    July 26, 2024

    Of course right after I posted I figured it out.  I accidentally had the code to enable the DMA TX request and to enable the DMA commented out and after adding them back, LIN RX and TX worked properly.