You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0308]: mismatched types
--> src/main.rs:60:38
|
60 | let mut serial = SerialPort::new(&usb_bus);
| --------------- ^^^^^^^^ expected `&UsbBusAllocator<_>`, found `&UsbBusAllocator<UsbBus<...>>`
| |
| arguments to this function are incorrect
|
= note: `UsbBusAllocator<UsbBus<...>>` and `UsbBusAllocator<_>` have similar names, but are actually distinct types
note: `UsbBusAllocator<UsbBus<...>>` is defined in crate `usb_device`
--> /home/soda/.cargo/registry/src/index.crates.io-6f17d22bba15001f/usb-device-0.2.9/src/bus.rs:149:1
|
149 | pub struct UsbBusAllocator<B: UsbBus> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: `UsbBusAllocator<_>` is defined in crate `usb_device`
--> /home/soda/.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
--> /home/soda/.cargo/registry/src/index.crates.io-6f17d22bba15001f/usbd-serial-0.2.2/src/serial_port.rs:49:12
|
49 | pub fn new<'alloc: 'a>(
| ^^^
error[E0308]: mismatched types
--> src/main.rs:62:45
|
62 | let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x16c0, 0x27dd))
| --------------------- ^^^^^^^^ expected `&UsbBusAllocator<_>`, found `&UsbBusAllocator<UsbBus<...>>`
| |
| arguments to this function are incorrect
|
= note: `UsbBusAllocator<UsbBus<...>>` and `UsbBusAllocator<_>` have similar names, but are actually distinct types
note: `UsbBusAllocator<UsbBus<...>>` is defined in crate `usb_device`
--> /home/soda/.cargo/registry/src/index.crates.io-6f17d22bba15001f/usb-device-0.2.9/src/bus.rs:149:1
|
149 | pub struct UsbBusAllocator<B: UsbBus> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: `UsbBusAllocator<_>` is defined in crate `usb_device`
--> /home/soda/.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
--> /home/soda/.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> {
| ^^^
Some errors have detailed explanations: E0308, E0463.
Cargo.toml
[package]
name = "rusty-blink"
version = "0.1.0"
edition = "2021"
[dependencies]
cortex-m = {version="0.7.1", features=["critical-section-single-core"] } # Access to the generic ARM peripherals
cortex-m-rt = "*" # Startup code for the ARM Core
cortex-m-semihosting = "0.5.0"
panic-semihosting = "0.6.0"
embedded-hal = "1.0" # Access to generic embedded functions (`set_high`)
nb = "1.1"
rtt-target = {version="0.6", features=["defmt"]}
usb-device = "0.3.1"
usbd-serial = "0.2.2"
stm32-usbd="0.6.0"
embedded-io="0.6.1"
vcell = "0.1.2"
[dependencies.stm32f1xx-hal]
features = ["stm32f103", "stm32-usbd", "rt", "medium"]
version = "0.10.0"
The text was updated successfully, but these errors were encountered:
usb example compiles with errors
Cargo.toml
The text was updated successfully, but these errors were encountered: