Skip to content

nosuz/ch32v103-hal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is studying Rust embedded-hal for WCH CH32V103 project.

Based Hal sample

japaric/stm32f30x-hal

CH32V103R8T6-EVT-R1

Connect KEY pin to BOOT0 and BOOT1 to GND. The KEY pin is Pull-Uped and goes to L by pressing the User button.

To download firmware, press RST button and release it. To run downloaded firmware, press RST and User buttons and release them.

Development tools

$ rustup target add riscv32imac-unknown-none-elf
$ sudo apt install binutils-riscv64-unknown-elf
$ cargo install wchisp
$ sudo chow root:root $HOME/.cargo/bin/wchisp
$ sudo chmod u+s $HOME/.cargo/bin/wchisp

Clear Cargo cache

$ cargo install cargo-cache
$ #cargo cache -a
$ cargo cache -r all

Examples

$ cd samples/blinky && make release && make flash

Debug macro_rules

$ cargo install cargo-expand
$ cargo expand --package ch32v103_hal

Get assembly

How to get assembly output from building with Cargo?

$ cargo rustc --release -- --emit asm
$ ls target/<ARCH>/release/deps/*.s

or

$ cargo install cargo-show-asm
$ cargo asm --bin <PACKAGE.NAME>

Object dump

Embedded Rust Techniques 3-1. Cargo

$ cargo install cargo-binutils
$ rustup component add llvm-tools-preview

$ cargo objdump --release -- -d --no-show-raw-insn --print-imm-hex

About

Rust embedded-hal for CH32V103 series.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages