在risc-v 的开发板上用 rust 开发其实也差不多,这里顺便以 GD32F103 的 Longan Naon 开发板为例,介绍一下 rust 依赖的组成。 大致是这样的组成: rust 处理器依赖 riscv rust 运行环境 riscv-rt 嵌入式 HAL 依赖 embedded-hal MCU 的 HAL 实现 gd32vf103xx-hal MCU 的
allocator-rs/src/main.rs //device for stm32f405#![no_main]#![no_std]#[allow(unused_extern_crates)]usepanic_haltas_;usecortex_m::peripheral::syst::SystClkSource;usecortex_m_rt::entry;usecortex_m_semihosting::hprint;usestm32f4xx_halashal;usecrate::hal::{gpio::{gpiob,Output,PushPull...
("cargo:rerun-if-changed=memory.x");// Specify linker arguments.// `--nmagic` is required if memory section addresses are not aligned to 0x10000,// for example the FLASH and RAM sections in your `memory.x`.// See https://github.com/rust-embedded/cortex-m-quickstart/pull/95println!(...
打开Cargo.toml在[dependencies] 内补充STM32所需依赖: [dependencies] embedded-hal = "0.2.7" nb = "1" cortex-m = "0.7.6" cortex-m-rt = "0.7.1" # Panic behaviour, see https://crates.io/keywords/panic-impl for alternatives panic-halt = "0.2.0" [dependencies.stm32f1xx-hal] version ...
name = "rust-stm32-led" version = "0.1.0" [dependencies] cortex-m = "^0.7.7" # Access to the generic ARM peripherals cortex-m-rt = "^0.7.3" # Startup code for the ARM Core embedded-hal = "^1.0.0" # Access to generic embedded functions (`set_high`) panic-halt = "^0.2....
该存储库提供 PAC(外围访问包)和更高级别的 HAL(硬件抽象层)。HAL 实现由embedded-hal 项目指定的 trait。目前已有 538 颗星。仓库地址:https://github.com/atsamd-rs/atsamd MSP430 (Texas Instruments) GitHub 存储库 japaric/msp430-rtfm 上有一个可用于 MSP430 MCU 的 RTFM(Real-Time For the Masses,...
This repository provides Rust device support crates for all STM32 microcontrollers, providing a safe API to that device's peripherals usingsvd2rustand a community-built collection of patches to the basic SVD files. There is one crate per device family, and each supported device is a feature-gat...
点击“浏览”选择soft packet下STM32仿真器驱动中的ST-LINK驱动,点击"下一步"后显示: STLink驱动安装完成 PuTTY 从此网站下载最新的putty.exe并将其放置在PATH中。 开发环境配置 Rust安装 Rust toolchain 使用night-mscvchannel 的Rust编译器工具链。 在终端输入: ...
嵌入式 HAL 依赖 embedded-hal MCU 的 HAL 实现 gd32vf103xx-hal MCU 的 bsp 支持 longan-nano 不...
cargo build --release cargo flash --chip stm32f103rb --release ref The Embedded Rust Book : https://docs.rust-embedded.org/book/ Introduction for various peripherals with F3 discovery board: https://docs.rust-embedded.org/discovery/f3discovery/ New tutorial with cargo flash: https://bacelar...