aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32l4/src/bin/usb_serial.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2024-05-13 01:01:44 +0200
committerDario Nieuwenhuis <[email protected]>2024-05-13 01:11:49 +0200
commit66e3d4da8d6eda003666b633bb57e67f2a10e31b (patch)
tree836ac5dee290ad7b05e52a8d08e0e882b4d43210 /examples/stm32l4/src/bin/usb_serial.rs
parent09781db85d401d23bec424482062758ac63079d3 (diff)
examples/stm32: do not enable vbus detect by default, it doesn't work on all boards.
Diffstat (limited to 'examples/stm32l4/src/bin/usb_serial.rs')
-rw-r--r--examples/stm32l4/src/bin/usb_serial.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/examples/stm32l4/src/bin/usb_serial.rs b/examples/stm32l4/src/bin/usb_serial.rs
index a378cdc6b..ed9671d0f 100644
--- a/examples/stm32l4/src/bin/usb_serial.rs
+++ b/examples/stm32l4/src/bin/usb_serial.rs
@@ -47,13 +47,11 @@ async fn main(_spawner: Spawner) {
47 let mut ep_out_buffer = [0u8; 256]; 47 let mut ep_out_buffer = [0u8; 256];
48 let mut config = embassy_stm32::usb::Config::default(); 48 let mut config = embassy_stm32::usb::Config::default();
49 49
50 // Enable vbus_detection 50 // Do not enable vbus_detection. This is a safe default that works in all boards.
51 // Note: some boards don't have this wired up and might not require it, 51 // However, if your USB device is self-powered (can stay powered on if USB is unplugged), you need
52 // as they are powered through usb! 52 // to enable vbus_detection to comply with the USB spec. If you enable it, the board
53 // If you hang on boot, try setting this to "false"! 53 // has to support it or USB won't work at all. See docs on `vbus_detection` for details.
54 // 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 54 config.vbus_detection = false;
55 // for more information
56 config.vbus_detection = true;
57 55
58 let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer, config); 56 let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer, config);
59 57