-
Notifications
You must be signed in to change notification settings - Fork 33
Description
I wanted to test the display example. But it does not seem to work.
Steps to reproduce:
cargo build --release --example display --features=lcd
output:
Compiling semver-parser v0.7.0
Compiling proc-macro2 v0.4.30
Compiling unicode-xid v0.1.0
Compiling syn v0.15.44
Compiling riscv v0.5.4
Compiling bit_field v0.9.0
Compiling autocfg v1.0.0
Compiling num-derive v0.2.5
Compiling nb v0.1.2
Compiling rand_core v0.4.2
Compiling void v1.0.2
Compiling vcell v0.1.2
Compiling gd32vf103xx-hal v0.2.1
Compiling st7735-lcd v0.6.2
Compiling longan-nano v0.1.1 (/tmp/longan-nano)
Compiling embedded-graphics v0.5.2
Compiling riscv-rt v0.6.1
Compiling r0 v0.2.2
Compiling panic-halt v0.2.0
Compiling semver v0.9.0
Compiling embedded-hal v0.2.3
Compiling rand_core v0.3.1
Compiling rand v0.5.6
Compiling rustc_version v0.2.3
Compiling num-traits v0.2.11
Compiling quote v0.6.13
Compiling bare-metal v0.2.5
Compiling cast v0.2.3
Compiling gd32vf103-pac v0.2.0
Compiling riscv-rt-macros v0.1.6
Finished release [optimized] target(s) in 23.93s
As I have connected the Sipeed Longan Nano via USB-C, I had to dfu-util to flash the binary which must be converted before:
riscv-sifive-elf-objcopy -O binary target/riscv32imac-unknown-none-elf/release/examples/display display.bin
A file with ~23K size is the result. The next step was to put the Sipeed Longan Nano into flash mode and flash the bin file:
sudo dfu-util -s 0x08000000:leave -D display.bin
which outputs:
dfu-util 0.9
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device...
ID 28e9:0189
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 2048
DfuSe interface name: "Internal Flash "
Downloading to address = 0x08000000, size = 22888
Download [=========================] 100% 22888 bytes
Download done.
File downloaded successfully
dfu-util: Error during download get_status
When completed, the Sipeed Longan Nano resets and is not in flashmode anymore.
During the whole process including flashmode, flashing and running the program, the red led next to the boot button is on and the backlight of the display too but all pixels remain black and never change their color which is not expected as it should display Hello Rust! when the program is running.
I do not use openocd as I do not know how to use it as I do not own a JTAG adapter. I only own a USB UART adapter but I think it is not possible to use that instead.