Rust嵌入式开发embassy环境搭建

先配置Rust开发STM32所需的环境,文章地址: https://fake-rick.github.io/posts/rust%E9%85%8D%E7%BD%AEstm32%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83/ 安装项目创建CLI工具 cargo install cargo-embassy 生成项目 cargo embassy init my_project --chip stm32f407vgtx 在Cargo.toml中[dependencies]添加: embassy-stm32 = { version = "0.1.0", features = ["defmt", "stm32f407vg", "unstable-pac", "memory-x", "time-driver-any", "exti", "chrono"] } Embed.toml文件 # This file was automatically generated. [default.general] chip = "STM32F407VGTx" [default.reset] halt_afterwards = false [default.rtt] enabled = true [default.gdb] enabled = false 运行 cargo run 如果在终端出现以下内容则表示运行成功:

August 5, 2024 · 1 min · 57 words · FakeRick

Rust配置STM32嵌入式开发环境

安装 安装cargo工具 cargo install cargo-generate 安装stlink v2驱动 sudo apt-get install git make cmake libusb-1.0-0-dev sudo apt-get install gcc build-essential git clone https://github.com/stlink-org/stlink.git cd stlink/ mkdir build cd build cmake .. make cd bin/ sudo cp st-* /usr/local/bin cd ../lib/ sudo cp *.so* /lib32 cd ../../ sudo cp config/udev/rules.d/49-stlinkv* /etc/udev/rules.d/ 安装烧录和调试的工具 Linux, macOS curl --proto '=https' --tlsv1.2 -LsSf https://github.com/probe-rs/probe-rs/releases/latest/download/probe-rs-tools-installer.sh | sh WIndows irm https://github.com/probe-rs/probe-rs/releases/latest/download/probe-rs-tools-installer.ps1 | iex 安装适用于ARM Cortex-M目标的rust-std组件 rustup target add thumbv6m-none-eabi thumbv7m-none-eabi thumbv7em-none-eabi thumbv7em-none-eabihf ...

August 4, 2024 · 1 min · 132 words · FakeRick