Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update embedded-hal dependencies #37

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

Update embedded-hal dependencies #37

wants to merge 10 commits into from

Conversation

romancardenas
Copy link
Contributor

NOTE: I still haven't tested these updates on boards. I will keep building some examples to verify that everything is alright. Furthermore, I have a few doubts about some peripherals (especially SPI, namely I don't understand why we would support SPI peripherals with MOSI or MISO missing).

@romancardenas romancardenas marked this pull request as draft October 14, 2024 14:45
@almindor
Copy link
Collaborator

NOTE: I still haven't tested these updates on boards. I will keep building some examples to verify that everything is alright. Furthermore, I have a few doubts about some peripherals (especially SPI, namely I don't understand why we would support SPI peripherals with MOSI or MISO missing).

By MOSI/MISO missing I'm guessing you mean using the (MOSI, SCK, CS) kind of tuples? This was done since some devices (e.g. displays) do not use MISO and do not have an actual connector for it.

@romancardenas
Copy link
Contributor Author

So we provide SPI implementation without owning the MISO pin?

The potential problem I see here is that SPI traits usually deal with reading and writing. Maybe we need to re-structure the trait implementation to return errors in those pin configurations that are not complete (e.g., return an Error when trying to read from a display)

@romancardenas
Copy link
Contributor Author

romancardenas commented Oct 14, 2024

I rescued a few examples from riscv-quickstart but adapted them to use semihosting for QEMU emulation. However (surprise) QEMU does not support GPIO on sifive_e targets yet 🥲

In any case, I will try to set up a proper GDB session with semihosting so we can test examples on board. Eventually, QEMU will support our needs and we can start using more robust CI workflows.

@romancardenas
Copy link
Contributor Author

I added new examples. It looks like QEMU supported GPIOs, but I introduced a bug in the GPIO implementation. Current examples work as expected both in QEMU and on board.

Examples are now in hifive1-examples. The idea is that hifive1-examples can work as riscv-rust-quickstart but with all the new configurations. Having all the examples in the same repo as the PAC, HAL, and BSP is useful while developing.

I managed to use semihosting on the board. However, it only works for OpenOCD, JLinkDebugger has this option disabled.
I added a few scripts to facilitate opening a debug session on board. Once I am done testing everything, I will write a nice README file.

@romancardenas
Copy link
Contributor Author

romancardenas commented Oct 19, 2024

I still need to check:

  • GPIO input traits
  • PWM traits
  • I2C traits
  • SPI traits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants