aboutsummaryrefslogtreecommitdiff
path: root/examples/boot/bootloader
diff options
context:
space:
mode:
Diffstat (limited to 'examples/boot/bootloader')
-rw-r--r--examples/boot/bootloader/stm32wb-dfu/src/main.rs15
1 files changed, 11 insertions, 4 deletions
diff --git a/examples/boot/bootloader/stm32wb-dfu/src/main.rs b/examples/boot/bootloader/stm32wb-dfu/src/main.rs
index 28216806e..2cd7f859d 100644
--- a/examples/boot/bootloader/stm32wb-dfu/src/main.rs
+++ b/examples/boot/bootloader/stm32wb-dfu/src/main.rs
@@ -67,17 +67,24 @@ fn main() -> ! {
67 67
68 // We add MSOS headers so that the device automatically gets assigned the WinUSB driver on Windows. 68 // We add MSOS headers so that the device automatically gets assigned the WinUSB driver on Windows.
69 // Otherwise users need to do this manually using a tool like Zadig. 69 // Otherwise users need to do this manually using a tool like Zadig.
70 //
71 // It seems it is important for the DFU class that these headers be on the Device level.
72 //
73 builder.msos_descriptor(msos::windows_version::WIN8_1, 2); 70 builder.msos_descriptor(msos::windows_version::WIN8_1, 2);
71
72 // In the case of non-composite devices, it seems that feature headers need to be on the device level.
73 // (As is implemented here)
74 //
75 // For composite devices however, they should be on the function level instead.
76 // (This is achieved by passing a GUID to the "usb_dfu" function)
74 builder.msos_feature(msos::CompatibleIdFeatureDescriptor::new("WINUSB", "")); 77 builder.msos_feature(msos::CompatibleIdFeatureDescriptor::new("WINUSB", ""));
75 builder.msos_feature(msos::RegistryPropertyFeatureDescriptor::new( 78 builder.msos_feature(msos::RegistryPropertyFeatureDescriptor::new(
76 "DeviceInterfaceGUIDs", 79 "DeviceInterfaceGUIDs",
77 msos::PropertyData::RegMultiSz(DEVICE_INTERFACE_GUIDS), 80 msos::PropertyData::RegMultiSz(DEVICE_INTERFACE_GUIDS),
78 )); 81 ));
79 82
80 usb_dfu::<_, _, _, _, 4096>(&mut builder, &mut state); 83 // For non-composite devices:
84 usb_dfu::<_, _, _, _, 4096>(&mut builder, &mut state, None);
85
86 // Or for composite devices:
87 // usb_dfu::<_, _, _, _, 4096>(&mut builder, &mut state, Some(DEVICE_INTERFACE_GUIDS));
81 88
82 let mut dev = builder.build(); 89 let mut dev = builder.build();
83 embassy_futures::block_on(dev.run()); 90 embassy_futures::block_on(dev.run());