Page 1 of 1
Request UART Driver Receive/Transmit Only.
Posted: Wed Jan 04, 2017 8:33 am
by vambwodonk
Any chance UART driver will be split into Receive or Transmit only? Because this will save DMA to another purpose if our project is very complex.
Receive only mcuconf.h will be like this,
Code: Select all
#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 5)
#define STM32_UART_USART1_TX_DMA_STREAM OFF
or,
Code: Select all
#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 5)
#define STM32_UART_USART1_TX_DMA_STREAM NULL
Re: Request UART Driver Receive/Transmit Only.
Posted: Wed Jan 04, 2017 9:21 am
by steved
If your CPU uses the UART2 driver, I use a modified version which gives the option of using only interrupts for the UART transfers - well tested in some specific configurations.
Not quite what you're asking, but might solve the problem in a slightly different way.
Re: Request UART Driver Receive/Transmit Only.
Posted: Wed Jan 04, 2017 9:25 am
by Giovanni
hi,
It would be a significant rework because all checks performed on DMA channels, probably the changes would impact other drivers using DMA.
Have you considered using the Serial driver instead? it does not use DMA at all.
Giovanni
Re: Request UART Driver Receive/Transmit Only.
Posted: Thu Jan 05, 2017 4:16 am
by vambwodonk
Thanks for reply,
steved wrote:If your CPU uses the UART2 driver, I use a modified version which gives the option of using only interrupts for the UART transfers - well tested in some specific configurations.
Not quite what you're asking, but might solve the problem in a slightly different way.
Unfortunately i used STM32F407 which is use USARTv1, but i got your idea. Maybe i can edit some Transmit use interrupt but Receive still use DMA in the future. Why you not just using serial driver if want interrupts on UART transfer?
Giovanni wrote:It would be a significant rework because all checks performed on DMA channels, probably the changes would impact other drivers using DMA.
Have you considered using the Serial driver instead? it does not use DMA at all.
Giovanni
I know this will be silly idea. I under development Air Data Computer using STM32F4. Will need some high load calculation, so i build low level peripherals/sensors communication with DMA(2 SPI and 3 UART). And i got SPI and UART in the same DMA channel. This will be solved if i used serial driver, but can be solved if i have received only UART driver too. I choose UART driver as i know DMA is "pure non-blocking" because it handle by hardware. CMIIW
Re: Request UART Driver Receive/Transmit Only.
Posted: Thu Jan 05, 2017 9:32 am
by steved
vambwodonk wrote:Why you not just using serial driver if want interrupts on UART transfer?
I use the UART driver because I'm using a serial protocol where you need to examine the received data stream as it comes in to determine when a complete message has been received.
This had its roots in use of the STM32F051 which shared DMA with I2C which is also in use - interrupt-driven serial was both easier to implement, and probably a bit less overhead than interrupt-driven I2C. (I also use the same code on the 32F4; I suspect receiving one character at a time through DMA is not very efficient, but it works OK. And transmit messages are usually pre-calculated, so sending those via DMA is better).