diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-05-13 01:01:44 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2024-05-13 01:11:49 +0200 |
| commit | 66e3d4da8d6eda003666b633bb57e67f2a10e31b (patch) | |
| tree | 836ac5dee290ad7b05e52a8d08e0e882b4d43210 /examples/stm32h7 | |
| parent | 09781db85d401d23bec424482062758ac63079d3 (diff) | |
examples/stm32: do not enable vbus detect by default, it doesn't work on all boards.
Diffstat (limited to 'examples/stm32h7')
| -rw-r--r-- | examples/stm32h7/src/bin/usb_serial.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/examples/stm32h7/src/bin/usb_serial.rs b/examples/stm32h7/src/bin/usb_serial.rs index 71d0c0a25..1c50fc1c8 100644 --- a/examples/stm32h7/src/bin/usb_serial.rs +++ b/examples/stm32h7/src/bin/usb_serial.rs | |||
| @@ -53,13 +53,11 @@ async fn main(_spawner: Spawner) { | |||
| 53 | let mut ep_out_buffer = [0u8; 256]; | 53 | let mut ep_out_buffer = [0u8; 256]; |
| 54 | let mut config = embassy_stm32::usb::Config::default(); | 54 | let mut config = embassy_stm32::usb::Config::default(); |
| 55 | 55 | ||
| 56 | // Enable vbus_detection | 56 | // Do not enable vbus_detection. This is a safe default that works in all boards. |
| 57 | // Note: some boards don't have this wired up and might not require it, | 57 | // However, if your USB device is self-powered (can stay powered on if USB is unplugged), you need |
| 58 | // as they are powered through usb! | 58 | // to enable vbus_detection to comply with the USB spec. If you enable it, the board |
| 59 | // If you hang on boot, try setting this to "false"! | 59 | // has to support it or USB won't work at all. See docs on `vbus_detection` for details. |
| 60 | // See https://embassy.dev/book/dev/faq.html#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure | 60 | config.vbus_detection = false; |
| 61 | // for more information | ||
| 62 | config.vbus_detection = true; | ||
| 63 | 61 | ||
| 64 | let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer, config); | 62 | let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer, config); |
| 65 | 63 | ||
