-
Notifications
You must be signed in to change notification settings - Fork 179
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
The trait UsbPeripheral
is not implemented for usb::Peripheral
#490
Comments
I'm having the same issue with a different use cortex_m::asm::delay;
use cortex_m_rt::entry;
use stm32f1xx_hal::usb::{Peripheral, UsbBus};
use stm32f1xx_hal::{pac, prelude::*};
use usb_device::prelude::*;
use usbd_serial::{SerialPort, USB_CLASS_CDC};
#[entry]
fn main() -> ! {
let dp = pac::Peripherals::take().unwrap();
let mut gpioa = dp.GPIOA.split();
let mut usb_dp = gpioa.pa12.into_push_pull_output(&mut gpioa.crh);
usb_dp.set_low();
delay(clocks.sysclk().raw() / 100);
let usb = stm32f1xx_hal::usb::Peripheral {
usb: dp.USB,
pin_dm: gpioa.pa11,
pin_dp: usb_dp.into_floating_input(&mut gpioa.crh),
};
let usb_bus = UsbBus::new(usb);
let mut serial = SerialPort::new(&usb_bus);
} The error produced is:
For reference my [package]
name = "blinky-test"
version = "0.1.0"
edition = "2021"
[dependencies]
embedded-hal = "1.0.0"
nb = "1"
cortex-m = "0.7.6"
cortex-m-rt = "0.7.1"
# Panic behaviour, see https://crates.io/keywords/panic-impl for alternatives
panic-halt = "0.2.0"
cortex-m-semihosting = "0.5.0"
usb-device = "0.3.2"
usbd-serial = "0.2.2"
stm32-usbd = "0.7.0"
stm32f1xx-hal = { features=["rt", "stm32f103", "medium", "stm32-usbd"], version = "0.10.0" }
panic-semihosting = "0.6.0"
panic-itm = "0.4.2" Environment
|
And rolling back to [dependencies]
usb-device = "0.2.8"
usbd-serial = "0.1.1" fixes it. Alright then. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe
The doc says
usb::Peripheral
has implemented UsbPeripheral. But I got a compile error says the struct has not implement the trait.To Reproduce
Expected behavior
usb::Peripheral
implements UsbPeripheral trait and is able to construct the UsbBusAllocator.Error mesage
**Environment: **
The text was updated successfully, but these errors were encountered: