Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

SPI Demo

The image src/ferris.raw is from this project.

Build this example for D0 core (default) with BL Dev Cube

rustup target install riscv64imac-unknown-none-elf
cargo build --target riscv64imac-unknown-none-elf --release -p spi-demo

Objcopy and prepare flash image with:

cargo install cargo-binutils
rustup component add llvm-tools-preview
rust-objcopy --binary-architecture=riscv64 --strip-all -O binary ./target/riscv64imac-unknown-none-elf/release/spi-demo ./target/riscv64imac-unknown-none-elf/release/spi-demo.bin
cargo blri ./target/riscv64imac-unknown-none-elf/release/spi-demo.bin

Flash the binary file to the board with Bouffalo Lab Dev Cube on Windows:

  1. Connect the board to the computer via UART (Here takes M1s Dock as an example):

  2. Run the BLDevCube.exe, choose BL808, and click Finish.

  3. In MCU page, browse target\riscv64imac-unknown-none-elf\release\spi-demo.bin as the target of D0 Group. Choose the bigger number serial port, and set uart rate 2000000.

  4. Press BOOT and RST on the board, then release RST first and BOOT after to be into UART burning mode.

  5. Click Create & Download, wait for flash the binary file to success.

  6. After flashing, repower the board and you will see the ferris image on the screen.

Build this example for D0 core (default) with Cli

Replace PORT_NAME with your com name, COMx for Windows, /dev/ttyx for Linux.

cargo run --target riscv64imac-unknown-none-elf --release -p spi-demo -- --port PORT_NAME