Msp430g2553

Rust for MSP430G2553 #

msp430-quickstart #

msp430-quickstart MSP430G2553のexampleがある。

sudo apt install pkg-config libssl-dev
cargo install cargo-generate
cargo generate --git https://github.com/rust-embedded/msp430-quickstart
cd app
cargo build --release
cargo build --release –examples

上のコマンドは下とおなじ

cargo +nightly build --target=msp430-none-elf -Zbuild-std=core
cargo +nightly build --target=msp430-none-elf -Zbuild-std=core –examples

書き込み #

Flasherを使うと、デバッガーが使えるようになってマイコンに書き込めるようになった。

https://www.ti.com/tool/ja-jp/MSP430-FLASHER

MSP430Flasher.exe -w .\BlinkLED_MSP-EXP430G2ET.txt -v

-v はベリファイのオプション

MSP430Flasherはtxt形式をサポートしている。

Txt形式に変更するには

$(GCC_DIR)/msp430-elf-objcopy -O ihex eforth.elf eforth.hex

objcopyはTIから提供されているものが使える

Timerのexampleをビルドして、書き込む #

cargo build --release –examples
msp430-elf-objcopy target/msp430-none-elf/release/examples/timer -O ihex timer.txt

USBケーブルをLaunchpadボード(MSP-EXP430G2)に接続して、MSP430Flasherでマイコンに書き込む。

MSP430Flasher.exe -w .\timer.txt -v

Rust embedded run-time #