"I also have tried with this..." <- works fine for me with rev c of that board, with a few adjustments: ``` diff --git a/.cargo/config.toml b/.cargo/config.toml index 73f2ab3..e9d3d58 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,5 +1,5 @@ [target.thumbv7em-none-eabihf] -runner = 'probe-run --chip STM32F411CEUx' +runner = 'probe-rs run --chip STM32F429ZITx' rustflags = [ # `flip-link` moves stack at the end of flash #"-C", "linker=flip-link", diff --git a/Cargo.toml b/Cargo.toml index 48a4f6f..2ef402f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -544,7 +544,7 @@ required-features = ["otg-fs", "usb_fs"] # stm32f407 [[example]] name = "usb-serial-poll" -required-features = ["otg-fs", "usb_fs"] # stm32f401 +required-features = ["otg-fs", "usb_hs"] # stm32f401 [[example]] name = "ws2812-spi" diff --git a/examples/usb-serial-poll.rs b/examples/usb-serial-poll.rs index acce819..716d008 100644 --- a/examples/usb-serial-poll.rs +++ b/examples/usb-serial-poll.rs @@ -6,7 +6,7 @@ use panic_halt as _; use cortex_m_rt::entry; -use stm32f4xx_hal::otg_fs::{UsbBus, USB}; +use stm32f4xx_hal::otg_hs::{UsbBus, USB}; use stm32f4xx_hal::{pac, prelude::*}; use usb_device::prelude::*; @@ -20,16 +20,17 @@ fn main() -> ! { let clocks = rcc .cfgr - .use_hse(25.MHz()) + .use_hse(8.MHz()) .sysclk(48.MHz()) .require_pll48clk() .freeze(); let gpioa = dp.GPIOA.split(); + let gpiob = dp.GPIOB.split(); let usb = USB::new( - (dp.OTG_FS_GLOBAL, dp.OTG_FS_DEVICE, dp.OTG_FS_PWRCLK), - (gpioa.pa11, gpioa.pa12), + (dp.OTG_HS_GLOBAL, dp.OTG_HS_DEVICE, dp.OTG_HS_PWRCLK), + (gpiob.pb14, gpiob.pb15), &clocks, ); ``` then just `cargo run --release --example usb-serial-poll --features otg-fs,usb_hs,stm32f429`