All Projects → Logiase → stm32-rustup

Logiase / stm32-rustup

Licence: MIT license
A guide to rust your stm32 microcontroller

Programming Languages

rust
11053 projects
GDB
78 projects

Projects that are alternatives of or similar to stm32-rustup

MCUCapture
Utility for plotting array data from MCU RAM
Stars: ✭ 22 (-12%)
Mutual labels:  stm32, mcu
pikascript
Ultralightweight Python engine that can run with 4KB of RAM and 32KB of Flash (such as STM32G030C8 and STM32F103C8), and is very easy to deploy and expand.
Stars: ✭ 855 (+3320%)
Mutual labels:  stm32, mcu
IOsonata
IOsonata multi-platform multi-architecture power & performance optimized software library for fast and easy IoT MCU firmware development. Object Oriented design, no board package to define, just pure plug & play any boards
Stars: ✭ 40 (+60%)
Mutual labels:  stm32, mcu
stm32f7xx-hal
A Rust embedded-hal HAL for all MCUs in the STM32 F7 family
Stars: ✭ 71 (+184%)
Mutual labels:  stm32, embedded-rust
Stm32 Dma Uart
Efficient DMA timeout mechanism for peripheral DMA configured in circular mode demonstrated on a STM32 microcontroller.
Stars: ✭ 111 (+344%)
Mutual labels:  stm32, mcu
Home
🏠 The landing page for nanoFramework repositories.
Stars: ✭ 315 (+1160%)
Mutual labels:  stm32, mcu
stm32DevelopmentBoards
Development boards and software templates for STM32 MCU
Stars: ✭ 41 (+64%)
Mutual labels:  stm32, mcu
nf-Visual-Studio-extension
🧰 Visual Studio extension for .NET nanoFramework
Stars: ✭ 42 (+68%)
Mutual labels:  stm32, mcu
Stm32 Bootloader
Customizable Bootloader for STM32 microcontrollers. This example demonstrates how to perform in-application-programming of a firmware located on an external SD card with FAT32 file system.
Stars: ✭ 541 (+2064%)
Mutual labels:  stm32, mcu
Various mcu debugger diy
各种LInk大合集
Stars: ✭ 402 (+1508%)
Mutual labels:  stm32, mcu
Nf Interpreter
⚙️ nanoFramework Interpreter, CLR, HAL, PAL and reference target boards
Stars: ✭ 168 (+572%)
Mutual labels:  stm32, mcu
CoreLibrary
📦 nanoFramework Base Class Library
Stars: ✭ 32 (+28%)
Mutual labels:  stm32, mcu
FNET
The FNET is a free, open source, dual TCP/IPv4 and IPv6 Stack (under Apache Version 2.0 license) for building embedded communication software on 32bit MCUs.
Stars: ✭ 97 (+288%)
Mutual labels:  mcu
psila
Work in progress Zigbee stack in Rust
Stars: ✭ 20 (-20%)
Mutual labels:  embedded-rust
at24cxx
at24cxx full function driver
Stars: ✭ 28 (+12%)
Mutual labels:  mcu
STM32F103-Bare-Metal
Programming the STM32F103C8 micro controller at the "bare metal" register level.
Stars: ✭ 42 (+68%)
Mutual labels:  stm32
rt soldering pen
RT soldering pen project firmware
Stars: ✭ 109 (+336%)
Mutual labels:  stm32
r3
R3-OS — Experimental static (μITRON-esque) RTOS for deeply embedded systems, testing the limit of Rust's const eval and generics
Stars: ✭ 87 (+248%)
Mutual labels:  embedded-rust
STC15 LIB
用于STC15系列单片机,借鉴STM32库的形式,让官方库更加易于使用。
Stars: ✭ 30 (+20%)
Mutual labels:  stm32
STM32-base.github.io
Github Pages for the STM32-base project.
Stars: ✭ 27 (+8%)
Mutual labels:  stm32

stm32-rustup

English: README.EN.md

Rust嵌入式开发指北。

Why

我C、C++写的好好的,为什么要换Rust?

首先Rust作为一门新兴的语言,相比C有着更良好的使用体验,其次使用Rust可以享受到Rust丰富的no_std环境。

Rust具有的高级现代语言的特性使得其在不同型号芯片,甚至不同架构芯片上,仅仅通过简单的修改即可移植,See 移植

同时相比于arm-gcc-none-eabi,即标准的ARM嵌入式编译器,Rust有着更高的性能。

crates

什么叫舒服啊.jpg

尝试

目前有如下例子:

  • hello 通过rtt输出 "Hello Embedded World"
  • blink 闪烁LED
  • button 读取GPIO控制LED
  • usart-irq 通过串口中断读取USART, 实现复读机
  • button-exti GPIO外部中断控制LED
  • iwdg 独立看门狗
  • timer 定时器控制LED
  • pwm PWM控制LED
  • rng 随机数发生器

IDE

VSCode是一个很好的选择,你需要安装如下扩展:

  • crates
  • rust-analyzer

请注意:此bug已经修复, 请使用最新版本 0.2.441. 在最新版本的rust-analyzer中存在着无法解析宏的Bug, 在修复之前请使用 0.2.400 版本 当前最新版本:0.2.416

编译

使用如下命令进行编译 blink

cargo build --example blink

编译后的ELF产物在target/thumbv7em-none-eabihf/debug/目录下,执行binutils即可查看相关信息。

第一次编译的过程会很长,如果你修改了内存布局memory.x,再次执行cargo build并不会重新应用你的内存布局, 你需要清除掉之前的缓存重新进行编译才可以应用新的内存布局

cargo clean
cargo build --example some_bin

设备

stm32F429IGT6,若干导线,ST-Link调试器,TTL转串口。

资源

例子中用到的外设资源:

高速外部时钟源 25MHz

  • PB0 - 绿色LED
  • PB1 - 红色LED
  • PA0 - WK_UP
  • PC13 - 按键
  • PH2 - 按键
  • PH3 - 按键

在我的博客上有更多有关嵌入式Rust的相关内容,也在持续更新中。

-> Blog <-

移植

如果想要在你的设备上进行实验,请注意一些内容:

  1. 首先根据自己的设备修改内存布局memory.x
  2. cargo.toml中替换HAL,如果你的设备不是ARM内核,请同时修改cortex-m至你的目标架构
  3. 根据你的设备重新定义源码中的引脚

如果你要在不同目标平台上进行修改尝试,请执行以下操作:

  1. 修改.cargo/config文件,将其中有关target的内容修改为你的目标架构
  2. 修改cargo.toml,引入你设备的布局,HAL等
  3. 可选,修改.vscode/settings.json中的内容来让VSCode正确检查你的代码

更多资源

Q&A

Open an Issues And I‘ll try my best to answer.

Author

@Logiase

LICENSE

MIT LICENSE

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].