From 2e104170de36295243608fbbebebdc6f52e8f8d0 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Mon, 9 May 2022 02:07:48 +0200 Subject: usb: remove address arg from endpoint allocation. --- examples/nrf/src/bin/usb_serial.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/nrf/src/bin/usb_serial.rs') diff --git a/examples/nrf/src/bin/usb_serial.rs b/examples/nrf/src/bin/usb_serial.rs index bc41c2acf..11651f82c 100644 --- a/examples/nrf/src/bin/usb_serial.rs +++ b/examples/nrf/src/bin/usb_serial.rs @@ -48,7 +48,7 @@ async fn main(_spawner: Spawner, p: Peripherals) { let mut device_descriptor = [0; 256]; let mut config_descriptor = [0; 256]; let mut bos_descriptor = [0; 256]; - let mut control_buf = [0; 7]; + let mut control_buf = [0; 64]; let mut state = State::new(); -- cgit From 2a7afe4262fd3ff8288c6381598a8794a7beee37 Mon Sep 17 00:00:00 2001 From: Timo Kröger Date: Thu, 12 May 2022 07:59:33 +0200 Subject: 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 --- examples/nrf/src/bin/usb_serial.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'examples/nrf/src/bin/usb_serial.rs') diff --git a/examples/nrf/src/bin/usb_serial.rs b/examples/nrf/src/bin/usb_serial.rs index bc41c2acf..f607781a8 100644 --- a/examples/nrf/src/bin/usb_serial.rs +++ b/examples/nrf/src/bin/usb_serial.rs @@ -43,6 +43,13 @@ async fn main(_spawner: Spawner, p: Peripherals) { config.max_power = 100; config.max_packet_size_0 = 64; + // Required for windows compatiblity. + // https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help + config.device_class = 0xEF; + config.device_sub_class = 0x02; + config.device_protocol = 0x01; + config.composite_with_iads = true; + // Create embassy-usb DeviceBuilder using the driver and config. // It needs some buffers for building the descriptors. let mut device_descriptor = [0; 256]; -- cgit