Coder Social home page Coder Social logo

prry / stm32-uart-dma Goto Github PK

View Code? Open in Web Editor NEW
275.0 7.0 100.0 45.09 MB

STM32串口DMA模式发送&接收实现,高速串口通信(1.5Mbps)不丢数据

Batchfile 0.01% C 95.76% C++ 0.11% Assembly 4.03% HTML 0.07% Python 0.01% CMake 0.02% PowerShell 0.01%
stm32 dma uart fifo

stm32-uart-dma's Introduction

STM32高速串口通信DMA收发实现


测试平台

平台 主频 BSP库 串口
STM32F030C8T6 48MHz 标准库 UART1、UART2
STM32F103ZET6 72MHz 标准库 UART1、UART2
STM32H743XIH6 400MHz HAL/LL库 UART5
STM32F407VCT6 168MHz HAL/LL库 UART1

实现功能

  • 收/发环形缓冲区
  • 不定长度接收处理
  • 高速(1.5Mbps)通信不丢数据

关键实现

DMA发送模式

  • 线程循环查询发送环形缓冲区数据,然后启动MDA传输

  • DMA传输完成中断,连续发送

  • 定时器中断周期发送


DMA接收模式

  • DMA缓存半满中断(如CPU硬件支持,可使用DMA双缓存机制)
  • DMA缓存传输完成中断
  • 串口空闲中断实现

其他

更详细的描述过程参考文章一个严谨的STM32串口DMA发送&接收(1.5Mbps波特率)机制

stm32-uart-dma's People

Contributors

prry avatar yoyoyes1983 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

stm32-uart-dma's Issues

关键文件找不到

compiling main.c...
../Core/Src/main.c(22): error:  #5: cannot open source input file "dev_uart.h": No such file or directory
  #include "dev_uart.h"
../Core/Src/main.c: 0 warnings, 1 error
compiling gpio.c...
"no source": Error:  #5: cannot open source input file "../Core/Src/gpio.c": No such file or directory
../Core/Src/gpio.c: 0 warnings, 1 error
compiling dma.c...
"no source": Error:  #5: cannot open source input file "../Core/Src/dma.c": No such file or directory
../Core/Src/dma.c: 0 warnings, 1 error
compiling usart.c...
"no source": Error:  #5: cannot open source input file "../Core/Src/usart.c": No such file or directory
../Core/Src/usart.c: 0 warnings, 1 error
compiling stm32f4xx_it.c...
../Core/Src/stm32f4xx_it.c(24): error:  #5: cannot open source input file "dev_uart.h": No such file or directory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.