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

[WIP] USB OTG FS support #36

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

[WIP] USB OTG FS support #36

wants to merge 5 commits into from

Conversation

katyo
Copy link

@katyo katyo commented Feb 5, 2023

Depends from gd32vf103xx-hal#50

For review and test only. Do not merge!

@trinami
Copy link

trinami commented Mar 18, 2023

is it possible for you to implement the usb otg fs functionality in rust? Currently I get the error:

Compiling longan-nano v0.3.0 (/home/user/Desktop/rust-riscv/longan-nano-upcoming)
warning: unused import: `BlockSpi`
  --> src/sdcard.rs:10:44
   |
10 | use embedded_sdmmc::{Controller, SdMmcSpi, BlockSpi, TimeSource, Timestamp};
   |                                            ^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

error[E0277]: the trait bound `SdMmcSpi<Spi<gd32vf103xx_hal::gd32vf103_pac::SPI1, (PB13<Alternate<PushPull>>, PB14<Input<Floating>>, PB15<Alternate<PushPull>>)>, PB12<Output<PushPull>>>: Deref` is not satisfied
  --> src/sdcard.rs:71:83
   |
71 | pub fn configure(spi: SPI1, pins: SdCardPins, freq: SdCardFreq, rcu: &mut Rcu) -> SdCard {
   |                                                                                   ^^^^^^ the trait `Deref` is not implemented for `SdMmcSpi<Spi<gd32vf103xx_hal::gd32vf103_pac::SPI1, (PB13<Alternate<PushPull>>, PB14<Input<Floating>>, PB15<Alternate<PushPull>>)>, PB12<Output<PushPull>>>`
   |
   = help: the trait `BlockDevice` is implemented for `BlockSpi<'_, SPI, CS>`
   = note: required for `SdMmcSpi<Spi<gd32vf103xx_hal::gd32vf103_pac::SPI1, (PB13<Alternate<PushPull>>, PB14<Input<Floating>>, PB15<Alternate<PushPull>>)>, PB12<Output<PushPull>>>` to implement `BlockDevice`

For more information about this error, try `rustc --explain E0277`.
warning: `longan-nano` (lib) generated 1 warning
error: could not compile `longan-nano` due to previous error; 1 warning emitted

I'm not very familiar with Rust yet, but I would be very interested in the functionality :)
Keep me posted please, i love your work :))

@katyo
Copy link
Author

katyo commented Mar 23, 2023

@trinami The errors above hasn't related to USB support.
You need review your SPI configuration for applicability.

@trinami
Copy link

trinami commented Mar 23, 2023

Okay, i've downloaded https://github.com/katyo/longan-nano/tree/upcoming and compiled with
cargo build --example serial_usb --release --all-features
Then the error accured.
I'm not sure what you mean with "review your SPI configuration for applicability".

Is there a good chance that your serial_usb example get merged into the master branch of longan-nano? And can i compile it then with the command above?
If yes, then i will just wait for it. It would be nice for my planned project to know. I will then learn more of rust for it. But for now, it keeps me really confusing :D Thanks

@katyo
Copy link
Author

katyo commented Mar 23, 2023

@trinami

Course, it needs merging some related PRs such as the following:
synopsys-usb-otg#36
gd32vf103xx-hal#50

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