Open katyo opened 1 year ago
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 :))
@trinami The errors above hasn't related to USB support. You need review your SPI configuration for applicability.
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
@trinami
Course, it needs merging some related PRs such as the following: synopsys-usb-otg#36 gd32vf103xx-hal#50
Depends from gd32vf103xx-hal#50
For review and test only. Do not merge!