riscv-rt = "0.10.0" panic-halt = "0.2.0" 可以看到 Rust 层级非常明显,从底层的riscvCPU 支持,到riscv-rt最小运行环境,接下来有通用的嵌入式抽象embedded-hal,到 MCU 的 HAL 支持gd32vf103xx-hal,最顶层是开发板 bsp 的支持longan-nano。这里我使用了 riscv-rust 维护的 Longan Nano 的 bsp。 最...
rustup 这个工具是用来管理 rust 工具链的,前面提到 rust 集成了 LLVM,但是程序要想在嵌入式环境运行,除了编译器还需要一个运行环境(Runtime),而 rustup target list 就可以看到不同的目标环境,这些环境会提供编译好的 rust-std,例如我安装好了 riscv 和 armv7 的环境。 $ rustup target list riscv32imac-...
接下来把准备好的svd文件(CH32V103xx.svd)放到自动生成的ch32v103pac文件夹中,在ch32v103pac文件夹中通过svd2rust工具处理svd文件, 执行命令:svd2rust --target=riscv -i .\CH32V103xx.svd 命令中--target=riscv指明目标是riscv(CH32V103xx就是riscv的),如果不指明,似乎默认就会认为是cortex-m的。
接下来把准备好的svd文件(CH32V103xx.svd)放到自动生成的ch32v103pac文件夹中,在ch32v103pac文件夹中通过svd2rust工具处理svd文件, 执行命令:svd2rust --target=riscv -i .\CH32V103xx.svd 命令中--target=riscv指明目标是riscv(CH32V103xx就是riscv的),如果不指明,似乎默认就会认为是cortex-m的。
RISC-V标准中,“SBI”意味着“操作系统二进制接口”,运行在其上的操作系统会通过环境调用“ecall”指令,陷入到二进制接口的实现中,由其调用具体硬件的实现功能。这种实现被称作“SBI实现”,社区常用的实现有开源的OpenSBI。RustSBI是鹏城实验室“rCore代码之夏-2020”活动提出的SBI实现,它是全新的操作系统引导软件。
riscv32imc-unknown-none-elf ESP32-C3 SoC 芯片支持以下功能: 2.4 GHz Wi-Fi 低功耗蓝牙 高性能 32 位 RISC-V 单核处理器 多种外设 内置安全硬件 ESP32-C3 采用 40 nm 工艺制成,具有最佳的功耗性能、射频性能、稳定性、通用性和可靠性,适用于各种应用场景和不同功耗需求。
Contribution to this crate is organized under the terms of theRust Code of Conduct, the maintainer of this crate, theRISC-V team, promises to intervene to uphold that code of conduct. Releases1 Compatibility with riscv-rt 0.13.0 and embedded-hal 1.0.0Latest ...
riscv riscv-rt-macros: Attributes re-exported in riscv-rt. proc-macro2: A stable implementation of the upcoming new proc_macro API. docs.rs unicode-xid: Determine whether characters have...
use riscv_rt::entry; #[entry] fn main() -> ! { let _y; let x = 42; _y = x; // infinite loop; just so we don't leave this stack frame loop {} } 将.cargoconfig修改为: [target.riscv32imac-unknown-none-elf] runner = "riscv-none-embed-gdb -q -x gdb_init" rustflags...
riscv: CPU registers access and intrinsics riscv-pac: Common traits to be implemented by RISC-V PACs riscv-peripheral: Interfaces for standard RISC-V peripherals riscv-rt: Startup code and interrupt handling riscv-semihosting: Semihosting for RISC-V processors riscv-target-parser: Utility crate...