Skip to content

StefJar/zephyr_stm32_uart3_dma_driver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

STM32F4 UART3 rx and tx via DMA

Simple ZephyrOS device driver using UART3 and the DMA1 (channel 4 & 7).

Main features:

  • getting bursts of uart bytes without knowing the amount of data to be received before.
  • sending uart data via DMA to reduce MCU load

The RX is received via DMA into a ring buffer. After the finish of the message burst or when the ringbuffer is half full(HTC)/full(TC) the rx callback is called. This callback is not blocking the rx/tx.

The TX is done via DMA transfer. The write function sets up the DMA transfer and waits for the complete semaphore. This semaphore is given in the DMA transfer complete(TC) interrupt.

Keeping in mind that vector based processing is the most efficent way, the RX ring buffer is set to 512 Bytes. Means that in the worst case the rx callback has to process 256 Bytes. But processing 256 Bytes than having 256 uart tx interrupts is much more efficent.

sources:

About

a driver for the stm32f4 uart using dma for rx and tx

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages