I’ve got the basics working with Hifive1 rev B using Rust crates from https://github.com/riscv-rust
Serial, build-in LEDs all work fine. I suspect GPIO will work fine too but I didn’t check yet.
I’m trying to find out how timing/sleep work with the hardware interrupts. Metal is a bit difficult to parse out for me with all the abstractions and vtable stuff.
I tried reading into the CLINT part of the spec for hifive1 but I don’t fully understand how it’s supposed to work on the lowest level (e.g. register sets).
Do you set the
mtimecmp registers to current_time (taken from the time register) + “cycles needed to sleep” to cause a hardware sleep & wake? How do you actually “fire it off” ?