aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerhard de Clercq <[email protected]>2025-05-13 15:09:53 +0200
committerGerhard de Clercq <[email protected]>2025-05-13 15:13:46 +0200
commit46e25cbc5ff62e24f86574d7ae5d872aa0c2595d (patch)
tree2ddf612d681152dc87b2543aa2f7c4762154cc73
parentf7c796e3ccdbd559eee26fddf39413782530f977 (diff)
[embassy-usb-dfu] correct comment about composite devices
-rw-r--r--embassy-usb-dfu/src/application.rs5
-rw-r--r--embassy-usb-dfu/src/dfu.rs5
-rw-r--r--examples/boot/application/stm32wb-dfu/src/main.rs10
-rw-r--r--examples/boot/bootloader/stm32wb-dfu/src/main.rs10
4 files changed, 14 insertions, 16 deletions
diff --git a/embassy-usb-dfu/src/application.rs b/embassy-usb-dfu/src/application.rs
index 52a7ca951..2646d100d 100644
--- a/embassy-usb-dfu/src/application.rs
+++ b/embassy-usb-dfu/src/application.rs
@@ -137,8 +137,9 @@ pub fn usb_dfu<'d, D: Driver<'d>, MARK: DfuMarker, RST: Reset>(
137 // We add MSOS headers so that the device automatically gets assigned the WinUSB driver on Windows. 137 // We add MSOS headers so that the device automatically gets assigned the WinUSB driver on Windows.
138 // Otherwise users need to do this manually using a tool like Zadig. 138 // Otherwise users need to do this manually using a tool like Zadig.
139 // 139 //
140 // Adding them here on the function level appears to only work for compositive devices though. 140 // Adding them here on the function level appears to only be needed for compositive devices.
141 // For non-composite devices they should be placed on the device level instead. 141 // In addition to being on the function level, they should also be added to the device level.
142 //
142 func.msos_feature(msos::CompatibleIdFeatureDescriptor::new("WINUSB", "")); 143 func.msos_feature(msos::CompatibleIdFeatureDescriptor::new("WINUSB", ""));
143 func.msos_feature(msos::RegistryPropertyFeatureDescriptor::new( 144 func.msos_feature(msos::RegistryPropertyFeatureDescriptor::new(
144 "DeviceInterfaceGUIDs", 145 "DeviceInterfaceGUIDs",
diff --git a/embassy-usb-dfu/src/dfu.rs b/embassy-usb-dfu/src/dfu.rs
index 83feacaf8..43a35637d 100644
--- a/embassy-usb-dfu/src/dfu.rs
+++ b/embassy-usb-dfu/src/dfu.rs
@@ -193,8 +193,9 @@ pub fn usb_dfu<'d, D: Driver<'d>, DFU: NorFlash, STATE: NorFlash, RST: Reset, co
193 // We add MSOS headers so that the device automatically gets assigned the WinUSB driver on Windows. 193 // We add MSOS headers so that the device automatically gets assigned the WinUSB driver on Windows.
194 // Otherwise users need to do this manually using a tool like Zadig. 194 // Otherwise users need to do this manually using a tool like Zadig.
195 // 195 //
196 // Adding them here on the function level appears to only work for compositive devices though. 196 // Adding them here on the function level appears to only be needed for compositive devices.
197 // For non-composite devices they should be placed on the device level instead. 197 // In addition to being on the function level, they should also be added to the device level.
198 //
198 func.msos_feature(msos::CompatibleIdFeatureDescriptor::new("WINUSB", "")); 199 func.msos_feature(msos::CompatibleIdFeatureDescriptor::new("WINUSB", ""));
199 func.msos_feature(msos::RegistryPropertyFeatureDescriptor::new( 200 func.msos_feature(msos::RegistryPropertyFeatureDescriptor::new(
200 "DeviceInterfaceGUIDs", 201 "DeviceInterfaceGUIDs",
diff --git a/examples/boot/application/stm32wb-dfu/src/main.rs b/examples/boot/application/stm32wb-dfu/src/main.rs
index 68e9bc3f6..6236dfe52 100644
--- a/examples/boot/application/stm32wb-dfu/src/main.rs
+++ b/examples/boot/application/stm32wb-dfu/src/main.rs
@@ -59,13 +59,11 @@ async fn main(_spawner: Spawner) {
59 59
60 // We add MSOS headers so that the device automatically gets assigned the WinUSB driver on Windows. 60 // We add MSOS headers so that the device automatically gets assigned the WinUSB driver on Windows.
61 // Otherwise users need to do this manually using a tool like Zadig. 61 // Otherwise users need to do this manually using a tool like Zadig.
62 builder.msos_descriptor(msos::windows_version::WIN8_1, 2);
63
64 // In the case of non-composite devices, it seems that feature headers need to be on the device level.
65 // (As is implemented here)
66 // 62 //
67 // For composite devices however, they should be on the function level instead. 63 // It seems these always need to be at added at the device level for this to work and for
68 // (This is achieved by passing a GUID to the "usb_dfu" function) 64 // composite devices they also need to be added on the function level (as shown later).
65 //
66 builder.msos_descriptor(msos::windows_version::WIN8_1, 2);
69 builder.msos_feature(msos::CompatibleIdFeatureDescriptor::new("WINUSB", "")); 67 builder.msos_feature(msos::CompatibleIdFeatureDescriptor::new("WINUSB", ""));
70 builder.msos_feature(msos::RegistryPropertyFeatureDescriptor::new( 68 builder.msos_feature(msos::RegistryPropertyFeatureDescriptor::new(
71 "DeviceInterfaceGUIDs", 69 "DeviceInterfaceGUIDs",
diff --git a/examples/boot/bootloader/stm32wb-dfu/src/main.rs b/examples/boot/bootloader/stm32wb-dfu/src/main.rs
index 2cd7f859d..8cfd4daa7 100644
--- a/examples/boot/bootloader/stm32wb-dfu/src/main.rs
+++ b/examples/boot/bootloader/stm32wb-dfu/src/main.rs
@@ -67,13 +67,11 @@ 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 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 // 70 //
75 // For composite devices however, they should be on the function level instead. 71 // It seems these always need to be at added at the device level for this to work and for
76 // (This is achieved by passing a GUID to the "usb_dfu" function) 72 // composite devices they also need to be added on the function level (as shown later).
73 //
74 builder.msos_descriptor(msos::windows_version::WIN8_1, 2);
77 builder.msos_feature(msos::CompatibleIdFeatureDescriptor::new("WINUSB", "")); 75 builder.msos_feature(msos::CompatibleIdFeatureDescriptor::new("WINUSB", ""));
78 builder.msos_feature(msos::RegistryPropertyFeatureDescriptor::new( 76 builder.msos_feature(msos::RegistryPropertyFeatureDescriptor::new(
79 "DeviceInterfaceGUIDs", 77 "DeviceInterfaceGUIDs",