Crowd supply - HiFive1
Project name: HiFive1 - Open-Source, Arduino-Compatible RISC-V Dev Kit
SoC: FE310-G000
CPU core: RISC-V RV32IMAC
Operating Voltage 3.3 V and 1.8 V Input Voltage 5 V USB or 7-12 VDC Jack IO Voltages Both 3.3 V or 5 V supported Digital I/O Pins 19 PWM Pins 9 SPI Controllers/HW CS Pins 1/3 External Interrupt Pins 19 External Wakeup Pins 1 Flash Memory 128 Mbit Off-Chip (ISSI SPI Flash) Host Interface (microUSB) Program, Debug, and Serial Communication
Back to crowdfunding, microcontrollers page.
Links
SiFive board HiFive1, HiFive 1 getting started, SiFive forums,
probe-rs flash loader for Hifive1 Rev B, crates.io mandown lib.rs mandown,
local links
History
2023-05-19: bb - run the example
tingo@kg-bsbox:~/personal/projects/2023/rust/embedded/riscv/hifive1-example $ cargo run --example leds_blink Finished dev [unoptimized + debuginfo] target(s) in 0.03s Running `gdb -q -x gdb_init target/riscv32imac-unknown-none-elf/debug/examples/leds_blink` Reading symbols from target/riscv32imac-unknown-none-elf/debug/examples/leds_blink... 0x204007e6 in vcell::VolatileCell<u32>::set<u32> (self=0x0, value=0) at /home/tingo/.cargo/registry/src/github.com-1ecc6299db9ec823/vcell-0.1.3/src/lib.rs:41 41 unsafe { ptr::write_volatile(self.value.get(), value) } JTAG tap: riscv.cpu tap/device found: 0x10e31913 (mfg: 0x489 (SiFive Inc), part: 0x0e31, ver: 0x1) halted at 0x404 due to software breakpoint Loading section .text, size 0x434e lma 0x20400000 Loading section .rodata, size 0x1164 lma 0x20404350 Start address 0x20400000, load size 21682 Transfer rate: 65 KB/sec, 7227 bytes/write.
in the openocd shell, I see
Info : accepting 'gdb' connection on tcp/3333 Info : JTAG tap: riscv.cpu tap/device found: 0x10e31913 (mfg: 0x489 (SiFive Inc), part: 0x0e31, ver: 0x1) halted at 0x20403566 due to debug interrupt Info : JTAG tap: riscv.cpu tap/device found: 0x10e31913 (mfg: 0x489 (SiFive Inc), part: 0x0e31, ver: 0x1) halted at 0x20403566 due to debug interrupt Info : Padding image section 0 at 0x2040434e with 2 bytes halted at 0x80000004 due to software breakpoint halted at 0x80000004 due to software breakpoint halted at 0x80000004 due to software breakpoint halted at 0x80000004 due to software breakpoint halted at 0x80000004 due to software breakpoint Info : JTAG tap: riscv.cpu tap/device found: 0x10e31913 (mfg: 0x489 (SiFive Inc), part: 0x0e31, ver: 0x1) halted at 0x80000004 due to software breakpoint
and the LEDs blink in sequence. In the console shell (which I run screen Dev/cuaU2 115200
for) I see
Starting blink loop
so yes - it works.
2023-05-19: bb - start openocd in a another shell
tingo@kg-bsbox:~ $ openocd -f board/sifive-hifive1.cfg Open On-Chip Debugger 0.11.0 Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'. Warn : libusb_detach_kernel_driver() failed with LIBUSB_ERROR_OTHER, trying to continue anyway Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling" Info : clock speed 10000 kHz Info : JTAG tap: riscv.cpu tap/device found: 0x10e31913 (mfg: 0x489 (SiFive Inc), part: 0x0e31, ver: 0x1) Info : Examined RISCV core; XLEN=32, misa=0x40001105 Info : starting gdb server for riscv.cpu on 3333 Info : Listening on port 3333 for gdb connections Info : [0] Found 2 triggers halted at 0x204035ba due to debug interrupt Info : Found flash device 'issi is25lp128d' (ID 0x0018609d) cleared protection for sectors 64 through 255 on flash bank 0 Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections
2023-05-19: bb - rust - the first compile failed
tingo@kg-bsbox:~/personal/projects/2023/rust/embedded/riscv/hifive1-example $ cargo build Updating crates.io index Downloaded critical-section v1.1.1 Downloaded bare-metal v0.2.5 Downloaded nb v0.1.3 Downloaded panic-halt v0.2.0 Downloaded void v1.0.2 Downloaded embedded-hal v0.2.7 Downloaded vcell v0.1.3 Downloaded semver-parser v0.7.0 Downloaded semver v0.9.0 Downloaded nb v1.1.0 Downloaded bit_field v0.10.2 Downloaded rustc_version v0.2.3 Downloaded aho-corasick v1.0.1 Downloaded regex v1.8.1 Downloaded regex-syntax v0.7.1 Downloaded riscv-target v0.1.2 Downloaded r0 v1.0.0 Downloaded riscv-rt-macros v0.2.0 Downloaded hifive1 v0.10.0 Downloaded e310x-hal v0.9.3 Downloaded riscv-rt v0.11.0 Downloaded riscv v0.10.1 Downloaded e310x v0.9.0 Downloaded riscv v0.6.0 Downloaded 24 crates (1.1 MB) in 1.49s Compiling memchr v2.5.0 Compiling regex-syntax v0.7.1 Compiling lazy_static v1.4.0 Compiling semver-parser v0.7.0 Compiling proc-macro2 v1.0.58 Compiling semver v0.9.0 Compiling bit_field v0.10.2 error[E0463]: can't find crate for `core` | = note: the `riscv32imac-unknown-none-elf` target may not be installed = help: consider downloading the target with `rustup target add riscv32imac-unknown-none-elf` error[E0463]: can't find crate for `compiler_builtins` error: cannot find macro `assert` in this scope --> /home/tingo/.cargo/registry/src/github.com-1ecc6299db9ec823/bit_field-0.10.2/src/lib.rs:217:17 | 217 | assert!(bit < Self::BIT_LENGTH); | ^^^^^^ ... 277 | bitfield_numeric_impl! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize } | ------------------------------------------------------------------------------ in this macro invocation | = note: this error originates in the macro `bitfield_numeric_impl` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot find macro `assert` in this scope --> /home/tingo/.cargo/registry/src/github.com-1ecc6299db9ec823/bit_field-0.10.2/src/lib.rs:227:17 | 227 | assert!(range.start < Self::BIT_LENGTH); | ^^^^^^ ... 277 | bitfield_numeric_impl! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize } | ------------------------------------------------------------------------------ in this macro invocation | = note: this error originates in the macro `bitfield_numeric_impl` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot find macro `assert` in this scope --> /home/tingo/.cargo/registry/src/github.com-1ecc6299db9ec823/bit_field-0.10.2/src/lib.rs:228:17 | 228 | assert!(range.end <= Self::BIT_LENGTH); | ^^^^^^ ... 277 | bitfield_numeric_impl! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize } | ------------------------------------------------------------------------------ in this macro invocation | = note: this error originates in the macro `bitfield_numeric_impl` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot find macro `assert` in this scope --> /home/tingo/.cargo/registry/src/github.com-1ecc6299db9ec823/bit_field-0.10.2/src/lib.rs:229:17 | 229 | assert!(range.start < range.end); | ^^^^^^ ... 277 | bitfield_numeric_impl! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize } | ------------------------------------------------------------------------------ in this macro invocation | = note: this error originates in the macro `bitfield_numeric_impl` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot find macro `assert` in this scope --> /home/tingo/.cargo/registry/src/github.com-1ecc6299db9ec823/bit_field-0.10.2/src/lib.rs:241:17 | 241 | assert!(bit < Self::BIT_LENGTH); | ^^^^^^ ... 277 | bitfield_numeric_impl! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize } | ------------------------------------------------------------------------------ in this macro invocation | = note: this error originates in the macro `bitfield_numeric_impl` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot find macro `assert` in this scope --> /home/tingo/.cargo/registry/src/github.com-1ecc6299db9ec823/bit_field-0.10.2/src/lib.rs:257:17 | 257 | assert!(range.start < Self::BIT_LENGTH); | ^^^^^^ ... 277 | bitfield_numeric_impl! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize } | ------------------------------------------------------------------------------ in this macro invocation | = note: this error originates in the macro `bitfield_numeric_impl` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot find macro `assert` in this scope --> /home/tingo/.cargo/registry/src/github.com-1ecc6299db9ec823/bit_field-0.10.2/src/lib.rs:258:17 | 258 | assert!(range.end <= Self::BIT_LENGTH); | ^^^^^^ ... 277 | bitfield_numeric_impl! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize } | ------------------------------------------------------------------------------ in this macro invocation | = note: this error originates in the macro `bitfield_numeric_impl` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot find macro `assert` in this scope --> /home/tingo/.cargo/registry/src/github.com-1ecc6299db9ec823/bit_field-0.10.2/src/lib.rs:259:17 | 259 | assert!(range.start < range.end); | ^^^^^^ ... 277 | bitfield_numeric_impl! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize } | ------------------------------------------------------------------------------ in this macro invocation | = note: this error originates in the macro `bitfield_numeric_impl` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot find macro `assert` in this scope --> /home/tingo/.cargo/registry/src/github.com-1ecc6299db9ec823/bit_field-0.10.2/src/lib.rs:260:17 | 260 | assert!(value << (Self::BIT_LENGTH - (range.end - range.start)) >> | ^^^^^^ ... 277 | bitfield_numeric_impl! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize } | ------------------------------------------------------------------------------ in this macro invocation | = note: this error originates in the macro `bitfield_numeric_impl` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot find macro `assert` in this scope --> /home/tingo/.cargo/registry/src/github.com-1ecc6299db9ec823/bit_field-0.10.2/src/lib.rs:298:9 | 298 | assert!(range.len() <= T::BIT_LENGTH); | ^^^^^^ error: cannot find macro `assert` in this scope --> /home/tingo/.cargo/registry/src/github.com-1ecc6299db9ec823/bit_field-0.10.2/src/lib.rs:306:9 | 306 | assert!(slice_end - slice_start <= 1); | ^^^^^^ error: cannot find macro `assert` in this scope --> /home/tingo/.cargo/registry/src/github.com-1ecc6299db9ec823/bit_field-0.10.2/src/lib.rs:335:9 | 335 | assert!(range.len() <= T::BIT_LENGTH); | ^^^^^^ error: cannot find macro `assert` in this scope --> /home/tingo/.cargo/registry/src/github.com-1ecc6299db9ec823/bit_field-0.10.2/src/lib.rs:342:9 | 342 | assert!(slice_end - slice_start <= 1); | ^^^^^^ For more information about this error, try `rustc --explain E0463`. error: could not compile `bit_field` due to 15 previous errors warning: build failed, waiting for other jobs to finish...
I probably need to build the core crate.
tingo@kg-bsbox:~/personal/projects/2023/rust/embedded/riscv/hifive1-example $ cargo build -Z build-std=core error: the `-Z` flag is only accepted on the nightly channel of Cargo, but this is the `stable` channel See https://doc.rust-lang.org/book/appendix-07-nightly-rust.html for more information about Rust release channels.
ok. How about just building it?
tingo@kg-bsbox:~/personal/projects/2023/rust/embedded/riscv/hifive1-example $ cargo build core error: unexpected argument 'core' found Usage: cargo build [OPTIONS] For more information, try '--help'.
of course not. I had forgot to source the rust environment (again).
tingo@kg-bsbox:~/personal/projects/2023/rust/embedded/riscv/hifive1-example $ . ~/.cargo/env
and now it builds
tingo@kg-bsbox:~/personal/projects/2023/rust/embedded/riscv/hifive1-example $ cargo build Compiling memchr v2.5.0 Compiling regex-syntax v0.7.1 Compiling lazy_static v1.4.0 Compiling semver-parser v0.7.0 Compiling bit_field v0.10.2 Compiling semver v0.9.0 Compiling rustc_version v0.2.3 Compiling proc-macro2 v1.0.58 Compiling aho-corasick v1.0.1 Compiling bare-metal v0.2.5 Compiling nb v1.1.0 Compiling nb v0.1.3 Compiling unicode-ident v1.0.8 Compiling void v1.0.2 Compiling quote v1.0.27 Compiling embedded-hal v0.2.7 Compiling syn v1.0.109 Compiling regex v1.8.1 Compiling e310x v0.9.0 Compiling riscv v0.10.1 Compiling vcell v0.1.3 Compiling riscv-target v0.1.2 Compiling critical-section v1.1.1 Compiling hifive1 v0.10.0 Compiling r0 v1.0.0 Compiling panic-halt v0.2.0 Compiling riscv v0.6.0 Compiling riscv-rt v0.11.0 Compiling e310x-hal v0.9.3 Compiling riscv-rt-macros v0.2.0 Compiling hifive1-example v0.0.0 (/zs/tingo/personal/projects/2023/rust/embedded/riscv/hifive1-example) Finished dev [unoptimized + debuginfo] target(s) in 20.78s
2023-05-19: c1 - devd - fixed the hifive1 conf file
root@kg-core1:~ # cat /usr/local/etc/devd/hifive1.conf # allow group (operator) to access the usb connection of hifive1 notify 100 { match "system" "USB"; match "subsystem" "INTERFACE"; match "type" "ATTACH"; match "vendor" "0x0403"; match "product" "0x6010"; action "usb_devaddr=`echo $cdev | sed 's#^ugen##'` && chmod g+rw /dev/usb/${usb_devaddr}.*"; };
a single space character isn't good enough for field delimiter; tab or multiple spaces are needed.
2023-05-16: c1 - set up a devd file to let normal users access usb connection of hifive1
root@kg-core1:~ # cat /usr/local/etc/devd/hifive1.cfg # allow group (operator) to access the usb connection of hifive1 notify 100 { match "system" "USB"; match "subsystem" "INTERFACE"; match "type" "ATTACH"; match "vendor" "0x0403"; match "product" "0x6010"; action "usb_devaddr=`echo $cdev | sed 's#^ugen##'` && chmod g+rw /dev/usb/${usb_devaddr}.*"; };
and restart devd
root@kg-core1:~ # service devd restart Stopping devd. Waiting for PIDS: 683. Starting devd.
hmm, it works better if the file is named correctly.
root@kg-core1:~ # mv /usr/local/etc/devd/hifive1.cfg /usr/local/etc/devd/hifive1.conf
restart devd again, and unplug re-plug the device. Then check. Hmm, for some reason this is not working on this machine, even if it works on c2.
2023-05-16: c1 - check out permissions of the usb connection for hifive1
root@kg-core1:~ # ll /dev/ugen3.5 /dev/usb/3.5.0 lrwxr-xr-x 1 root wheel 9 May 16 19:11 /dev/ugen3.5@ -> usb/3.5.0 crw------- 1 root operator 0x1b8 May 16 19:11 /dev/usb/3.5.0
2023-05-16: c1 - try to run after change to used gdb
in .cargo/config:
tingo@kg-core1:~/personal/projects/2023/rust/embedded/riscv/hifive1/hifive1-example $ cargo run --example leds_blink Finished dev [unoptimized + debuginfo] target(s) in 0.03s Running `gdb -q -x gdb_init target/riscv32imac-unknown-none-elf/debug/examples/leds_blink` Reading symbols from target/riscv32imac-unknown-none-elf/debug/examples/leds_blink... 0x204003b4 in e310x_hal::gpio::atomic_set_bit (r=0x2040007e <_abs_start+118>, index=2241669655, bit=116) at /home/tingo/.cargo/registry/src/github.com-1ecc6299db9ec823/e310x-hal-0.9.3/src/gpio.rs:65 65 let mask = 1 << (index & 31); JTAG tap: riscv.cpu tap/device found: 0x10e31913 (mfg: 0x489 (SiFive Inc), part: 0x0e31, ver: 0x1) halted at 0x404 due to software breakpoint Loading section .text, size 0x43aa lma 0x20400000 Loading section .rodata, size 0x1144 lma 0x204043b0 Start address 0x20400000, load size 21742 Transfer rate: 31 KB/sec, 7247 bytes/write.
and in the openocd shell I see
Info : accepting 'gdb' connection on tcp/3333 Info : Retrying memory read starting from 0x204003b4 with more delays Info : Retrying memory read starting from 0x204003b4 with more delays Info : Retrying memory read starting from 0x204003b4 with more delays Info : Retrying memory read starting from 0x204003b4 with more delays Info : Retrying memory read starting from 0x204003b4 with more delays Info : Retrying memory read starting from 0x204003b4 with more delays Info : Retrying memory read starting from 0x204003b4 with more delays Info : Retrying memory read starting from 0x204003b4 with more delays Info : Retrying memory read starting from 0x204003b4 with more delays Info : Retrying memory read starting from 0x204003b4 with more delays Info : Retrying memory read starting from 0x204003b4 with more delays Info : Retrying memory read starting from 0x204003b4 with more delays Info : Retrying memory read starting from 0x204003b4 with more delays Info : Retrying memory read starting from 0x204003b4 with more delays Info : Retrying memory read starting from 0x204003b4 with more delays Info : Retrying memory read starting from 0x204003b4 with more delays Info : Retrying memory read starting from 0x204003b4 with more delays Info : Retrying memory read starting from 0x204003b4 with more delays Info : Retrying memory read starting from 0x204003b4 with more delays Core got an exception (0xffffffff) while reading from 0x9a3c132 Core got an exception (0xffffffff) while reading from 0x9a3c130 Core got an exception (0xffffffff) while reading from 0x9a3c12e Core got an exception (0xffffffff) while reading from 0x9a3c12c Core got an exception (0xffffffff) while reading from 0x9a3c12a Core got an exception (0xffffffff) while reading from 0x9a3c128 Core got an exception (0xffffffff) while reading from 0x9a3c126 Info : JTAG tap: riscv.cpu tap/device found: 0x10e31913 (mfg: 0x489 (SiFive Inc), part: 0x0e31, ver: 0x1) halted at 0x404 due to software breakpoint Info : JTAG tap: riscv.cpu tap/device found: 0x10e31913 (mfg: 0x489 (SiFive Inc), part: 0x0e31, ver: 0x1) halted at 0x404 due to software breakpoint Info : Padding image section 0 at 0x204043aa with 6 bytes halted at 0x80000004 due to software breakpoint halted at 0x80000004 due to software breakpoint halted at 0x80000004 due to software breakpoint halted at 0x80000004 due to software breakpoint halted at 0x80000004 due to software breakpoint Info : JTAG tap: riscv.cpu tap/device found: 0x10e31913 (mfg: 0x489 (SiFive Inc), part: 0x0e31, ver: 0x1) halted at 0x80000004 due to software breakpoint
and the LEDs blink red - green - blue. with screen connected to /dev/cuaU1 (at 115200) I get
Starting blink loop
cool.
2023-05-16: c1 - try openocd
tingo@kg-core1:~ $ sudo openocd -f board/sifive-hifive1.cfg Open On-Chip Debugger 0.11.0 Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'. Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling" Info : clock speed 10000 kHz Info : JTAG tap: riscv.cpu tap/device found: 0x10e31913 (mfg: 0x489 (SiFive Inc), part: 0x0e31, ver: 0x1) Info : Examined RISCV core; XLEN=32, misa=0x40001105 Info : starting gdb server for riscv.cpu on 3333 Info : Listening on port 3333 for gdb connections Info : [0] Found 2 triggers halted at 0x204003b4 due to debug interrupt Info : Found flash device 'issi is25lp128d' (ID 0x0018609d) cleared protection for sectors 64 through 255 on flash bank 0 Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections
didn't work without sudo. Permissions problem, likely.
2023-05-16: c1 - generate a rust example from the template
tingo@kg-core1:~/personal/projects/2023/rust/embedded/riscv/hifive1 $ cargo generate --git https://github.com/riscv-rust/riscv-rust-quickstart 🤷 Project Name: hifive1-example 🔧 Destination: /zs/tingo/personal/projects/2023/rust/embedded/riscv/hifive1/hifive1-example ... 🔧 project-name: hifive1-example ... 🔧 Generating template ... 🔧 Moving generated files into: `/zs/tingo/personal/projects/2023/rust/embedded/riscv/hifive1/hifive1-example`... Initializing a fresh Git repository ✨ Done! New project created /zs/tingo/personal/projects/2023/rust/embedded/riscv/hifive1/hifive1-example
change Cargo.toml. before
tingo@kg-core1:~/personal/projects/2023/rust/embedded/riscv/hifive1/hifive1-example $ grep board Cargo.toml hifive1 = { version = "0.10.0", features = ["board-hifive1-revb"] }
after
tingo@kg-core1:~/personal/projects/2023/rust/embedded/riscv/hifive1/hifive1-example $ grep board Cargo.toml hifive1 = { version = "0.10.0", features = ["board-hifive1"] }
try to build the leds_blink example
tingo@kg-core1:~/personal/projects/2023/rust/embedded/riscv/hifive1/hifive1-example $ cargo build --example leds_blink Updating crates.io index Downloaded critical-section v1.1.1 Downloaded r0 v1.0.0 Downloaded proc-macro2 v1.0.57 Downloaded bit_field v0.10.2 Downloaded riscv v0.6.0 Downloaded riscv-rt v0.11.0 Downloaded riscv-rt-macros v0.2.0 Downloaded riscv-target v0.1.2 Downloaded riscv v0.10.1 Downloaded e310x v0.9.0 Downloaded hifive1 v0.10.0 Downloaded e310x-hal v0.9.3 Downloaded 12 crates (311.6 KB) in 1.35s Compiling memchr v2.5.0 Compiling regex-syntax v0.7.1 Compiling lazy_static v1.4.0 Compiling semver-parser v0.7.0 Compiling bit_field v0.10.2 Compiling semver v0.9.0 Compiling rustc_version v0.2.3 Compiling nb v1.1.0 Compiling proc-macro2 v1.0.57 Compiling aho-corasick v1.0.1 Compiling bare-metal v0.2.5 Compiling nb v0.1.3 Compiling void v1.0.2 Compiling quote v1.0.27 Compiling unicode-ident v1.0.8 Compiling embedded-hal v0.2.7 Compiling e310x v0.9.0 Compiling syn v1.0.109 Compiling regex v1.8.1 Compiling vcell v0.1.3 Compiling riscv v0.10.1 Compiling riscv-target v0.1.2 Compiling critical-section v1.1.1 Compiling hifive1 v0.10.0 Compiling r0 v1.0.0 Compiling panic-halt v0.2.0 Compiling riscv v0.6.0 Compiling riscv-rt v0.11.0 Compiling e310x-hal v0.9.3 Compiling riscv-rt-macros v0.2.0 Compiling hifive1-example v0.0.0 (/zs/tingo/personal/projects/2023/rust/embedded/riscv/hifive1/hifive1-example) Finished dev [unoptimized + debuginfo] target(s) in 46.47s
worked nicely.
2023-05-16: c1 - connect it to the FreeBSD workstation with rust installed, check ports
tingo@kg-core1:~/personal/projects/2023/rust/embedded $ ll /dev/cuaU[01] /dev/ttyU[01] crw-rw---- 1 uucp dialer - 0x1c5 May 16 19:11 /dev/cuaU0 crw-rw---- 1 uucp dialer - 0x1cb May 16 19:11 /dev/cuaU1 crw------- 1 root wheel - 0x1c2 May 16 19:11 /dev/ttyU0 crw------- 1 root wheel - 0x1c8 May 16 19:11 /dev/ttyU1
yes, it shows up.
2023-05-16: c2 - connecting the HiFive1 to my FreeBSD workstation, this shows up in /var/log/messages
May 16 18:44:27 kg-core2 kernel: ugen1.6: <FTDI Dual RS232-HS> at usbus1 May 16 18:44:27 kg-core2 kernel: uftdi0 on uhub3 May 16 18:44:27 kg-core2 kernel: uftdi0: <Dual RS232-HS> on usbus1 May 16 18:44:27 kg-core2 kernel: uftdi1 on uhub3 May 16 18:44:27 kg-core2 kernel: uftdi1: <Dual RS232-HS> on usbus1
usbconfig
root@kg-core2:~ # usbconfig -d ugen1.6 ugen1.6: <FTDI Dual RS232-HS> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
find tty names
root@kg-core2:~ # sysctl dev.uftdi.0.ttyname dev.uftdi.1.ttyname dev.uftdi.0.ttyname: U0 dev.uftdi.1.ttyname: U1
check tty ports
root@kg-core2:~ # ll /dev/cuaU[01] /dev/ttyU[01] crw-rw---- 1 uucp dialer 0x1eb May 16 18:44 /dev/cuaU0 crw-rw---- 1 uucp dialer 0x1f4 May 16 18:44 /dev/cuaU1 crw------- 1 root wheel 0x1e8 May 16 18:44 /dev/ttyU0 crw------- 1 root wheel 0x1ee May 16 18:44 /dev/ttyU1
try to connect via screen, like so
tingo@kg-core2:~ $ screen /dev/cuaU1 115200
results in
SIFIVE, INC. 5555555555555555555555555 5555 5555 5555 5555 5555 5555 5555 5555555555555555555555 5555 555555555555555555555555 5555 5555 5555 5555 5555 5555 5555555555555555555555555555 55555 55555 555555555 55555 55555 55555 55555 55555 5 55555 55555 55555 55555 55555 55555 55555 55555 55555 55555 55555 555555555 55555 5 'led_fade' Demo 55555555555555555555555555555555555555555555555 5555555 Are the LEDs Changing? [y/n] 555555555 55555555555555555555555555555555555555555555555 y PASS
2021-08-14: I re-created this page on my self-hosted web server.
2017-03-02: downloaded and manually installed Arduino IDE 1.8.1, and now the compile works. But the upload fails:
Open On-Chip Debugger 0.10.0-dev-g9bab078 (2017-02-02-01:39) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html adapter speed: 10000 kHz Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'. Error: libusb_open() failed with LIBUSB_ERROR_ACCESS Error: no device found Error: unable to open ftdi device with vid 0403, pid 6010, description 'Dual RS232-HS', serial '*' at bus location '*' the selected serial port does not exist or your board is not connected
(from the shell where I started arduino)
2017-03-02: build night at Bitraf again. Testing the ardunio IDE again - but yes, the error is still there. Difference? I have upgraded my laptop to Fedora 24:
[tingo@localhost ~]$ lsb_release -a LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch Distributor ID: Fedora Description: Fedora release 24 (Twenty Four) Release: 24 Codename: TwentyFour [tingo@localhost ~]$ uname -a Linux localhost.localdomain 4.9.10-100.fc24.x86_64 #1 SMP Wed Feb 15 18:35:50 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
ok.
2017-02-23: software - indstalling board support in Arduino IDE (1.6.4) works, and the HiFive1 board show up. Trying to compile the "blink" example gives an error:
/home/tingo/.arduino15/packages/sifive/tools/riscv32-unknown-elf-gcc/3f7b3696217548bc31aeccf9a0c89bdfa4e16a8f/bin/riscv32-unknown-elf-ar: {archive_file_path}: Permission denied Error compiling.
hmm...
2017-02-23: build night at Bitraf. Board setup - connecting the board to a USB-to- microUSB cable and to my Fedora laptop, the power LEDs (D9 and D10) light up. They are green and very bright, so I install two of the included "LED-dimmer stickers" right away. D9 (closest to the buttons) is the 5V power LED, and D10 (closest to the microUSB connector) is the 3.3V power LED. The demo program blink the RGB LED (D6) slowly. On my laptop, two serial ports show up:
[tingo@localhost ~]$ ls -l /dev/ttyU* crw-rw----. 1 root dialout 188, 0 Feb 23 19:51 /dev/ttyUSB0 crw-rw----. 1 root dialout 188, 1 Feb 23 19:51 /dev/ttyUSB1
ok. Connecting at 115200 to ttyUSB1 gives:
$ screen /dev/ttyUSB1 115200 output SIFIVE, INC. 5555555555555555555555555 5555 5555 5555 5555 5555 5555 5555 5555555555555555555555 5555 555555555555555555555555 5555 5555 5555 5555 5555 5555 5555555555555555555555555555 55555 55555 555555555 55555 55555 55555 55555 55555 5 55555 55555 55555 55555 55555 55555 55555 55555 55555 55555 55555 555555555 55555 5 'led_fade' Demo 55555555555555555555555555555555555555555555555 5555555 Are the LEDs Changing? [y/n] 555555555 55555555555555555555555555555555555555555555555 y PASS
ok.
2017-02-22: on my way home from wok I picked up the package (at PIB Extra Trondheimsveien).
2017-02-21: order tracking show that the package is available for pickup at my local PIB.
2017-02-10: I got a shipping confirmation.
2016-12-25: I ordered 1 x HiFive1 Open-Source, Arduino-Compatible RISC-V Dev Kit from Crowd Suoply for USD 59.- plus USD 15. in shipping.