cancel
Showing results for 
Search instead for 
Did you mean: 

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

Dazai
Associate III

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Dazai
Associate III

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.

View solution in original post

1 REPLY 1
Dazai
Associate III

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.