diff options
| author | Timo Kröger <[email protected]> | 2022-05-12 07:59:33 +0200 |
|---|---|---|
| committer | Timo Kröger <[email protected]> | 2022-05-12 08:05:13 +0200 |
| commit | 2a7afe4262fd3ff8288c6381598a8794a7beee37 (patch) | |
| tree | b17b54760d820c61913204afab6b39cc899392c8 /examples/nrf/src/bin/usb_serial_multitask.rs | |
| parent | 69e0f9f0fea8731fa23b4b62707ca2641f5f301a (diff) | |
Make usb_serial examples work on windows
Windows shows `error 10` when using CDC ACM on non composite devices.
Workaround is to use IADS:
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
Diffstat (limited to 'examples/nrf/src/bin/usb_serial_multitask.rs')
| -rw-r--r-- | examples/nrf/src/bin/usb_serial_multitask.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/nrf/src/bin/usb_serial_multitask.rs b/examples/nrf/src/bin/usb_serial_multitask.rs index 31e0af483..e165cd434 100644 --- a/examples/nrf/src/bin/usb_serial_multitask.rs +++ b/examples/nrf/src/bin/usb_serial_multitask.rs | |||
| @@ -60,6 +60,13 @@ async fn main(spawner: Spawner, p: Peripherals) { | |||
| 60 | config.max_power = 100; | 60 | config.max_power = 100; |
| 61 | config.max_packet_size_0 = 64; | 61 | config.max_packet_size_0 = 64; |
| 62 | 62 | ||
| 63 | // Required for windows compatiblity. | ||
| 64 | // https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help | ||
| 65 | config.device_class = 0xEF; | ||
| 66 | config.device_sub_class = 0x02; | ||
| 67 | config.device_protocol = 0x01; | ||
| 68 | config.composite_with_iads = true; | ||
| 69 | |||
| 63 | struct Resources { | 70 | struct Resources { |
| 64 | device_descriptor: [u8; 256], | 71 | device_descriptor: [u8; 256], |
| 65 | config_descriptor: [u8; 256], | 72 | config_descriptor: [u8; 256], |
