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

usb_serial.rs example doesn't work out-of-box #369

Open
kebonly opened this issue Jul 10, 2024 · 0 comments · May be fixed by #370
Open

usb_serial.rs example doesn't work out-of-box #369

kebonly opened this issue Jul 10, 2024 · 0 comments · May be fixed by #370

Comments

@kebonly
Copy link

kebonly commented Jul 10, 2024

Hello, I'm trying to get the example/usb_serial.rs to work, but I'm getting the following errors at compile time. I am running this on STM32F303VC Discovery board, but the problem seems to be coming from various USB crates.

To run the example, I pass in the feature flag as well like so: cargo run --example usb_serial --features="ld stm32f303xc usb cortex-m/critical-section-single-core"

149 | pub struct UsbBusAllocator<B: UsbBus> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: `UsbBusAllocator<_>` is defined in crate `usb_device`
   --> /Users/kevinly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/usb-device-0.3.2/src/bus.rs:152:1
    |
152 | pub struct UsbBusAllocator<B: UsbBus> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `usb_device` are being used?
note: associated function defined here
   --> /Users/kevinly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/usb-device-0.3.2/src/device_builder.rs:85:12
    |
85  |     pub fn new(alloc: &'a UsbBusAllocator<B>, vid_pid: UsbVidPid) -> UsbDeviceBuilder<'a, B> {
    |            ^^^

error[E0599]: no method named `manufacturer` found for struct `usb_device::device::UsbDeviceBuilder` in the current scope
  --> examples/usb_serial.rs:71:10
   |
70 |       let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x16c0, 0x27dd))
   |  _______________________-
71 | |         .manufacturer("Fake company")
   | |         -^^^^^^^^^^^^ method not found in `UsbDeviceBuilder<'_, _>`
   | |_________|
   |

Some errors have detailed explanations: E0308, E0599.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `stm32f3xx-hal` (example "usb_serial") due to 3 previous errors
kebonly added a commit to kebonly/stm32f3xx-hal that referenced this issue Jul 24, 2024
- Also updated respective examples/usb_serial.rs
- Will fix stm32-rs#369
@kebonly kebonly linked a pull request Jul 24, 2024 that will close this issue
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 a pull request may close this issue.

1 participant