| Crates.io | py32f030_hal |
| lib.rs | py32f030_hal |
| version | 0.1.0 |
| created_at | 2025-01-01 12:20:25.368547+00 |
| updated_at | 2025-01-01 12:20:25.368547+00 |
| description | Peripheral Hal Crate for Puya's PY32F030 microcontroller |
| homepage | |
| repository | https://github.com/hysonglet/py32f030-hal |
| max_upload_size | |
| id | 1500777 |
| size | 386,059 |
该库提供 py32f030 芯片使用,目前适配了一些基本的外设驱动
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Rust 的嵌入式开发环境需要是 nightly 版本
rustup default nightly
rustup target add thumbv6m-none-eabi
执行下面的命令,没有报错说明rust编译环境安装正常
cd py32f030-hal
cargo build
➜ py32f030-hal git:(main) ✗ rustup --version
rustup 1.27.1 (54dd3d00f 2024-04-24)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.82.0-nightly (6de928dce 2024-08-18)`
Probe-rs 是一个优秀的固件下载和日志调试工具, 详细安装和功能请点击页面查看。
curl --proto '=https' --tlsv1.2 -LsSf \
https://github.com/probe-rs/probe-rs/releases/latest/download/probe-rs-tools-installer.sh \
| sh
cargo install cargo-binstall
cargo binstall probe-rs-tools
cargo install cargo-get
brew install llvm
pip install puyaisp
pip install pyusb pyserial hid
烧录:
# 同时按下 boot 和 RST 按键,然后先释放 RST,然后释放 Boot 即可,然后执行以下命令
puyaisp -f blink.bin
# 单次下载
pyisp -s tty.usbserial-130 -g -f test.bin
# 多次下载
pyisp -s COM4 -g -c -f test.bin
cargo r --example embassy_uart
probe-rs run --chip PY32F030x8 target/thumbv6m-none-eabi/debug/examples/embassy_uart
# run
cargo run --example blinky
# build
cargo build --release --example blinky
py32f030-hal git:(main) ✗ cargo r --example
error: "--example" takes one argument.
Available examples:
adc_block
advanced_timer_block
advanced_timer_block_2
bit_test
blinky
block_uart
clock
crc
dma_mem2mem
embassy_adc
embassy_delay
embassy_dma_mem2mem
embassy_exit
embassy_i2c
embassy_iwdg
embassy_pwm
embassy_rtc
embassy_ssd1309
embassy_uart
hello_world
i2c_master_block
key
rtc_block
uart
公众号:Rust嵌入式
