From a5f47036f32a29b8408f5a19deebb10208e3bb03 Mon Sep 17 00:00:00 2001 From: "Jonathan Pallant (Ferrous Systems)" Date: Wed, 1 Nov 2023 10:57:17 +0000 Subject: [PATCH] More fixes. --- exercise-book/src/nrf52-usb-data-stage.md | 2 ++ exercise-book/src/nrf52-usb-setup-stage.md | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/exercise-book/src/nrf52-usb-data-stage.md b/exercise-book/src/nrf52-usb-data-stage.md index b6fa6ca..da3dadd 100644 --- a/exercise-book/src/nrf52-usb-data-stage.md +++ b/exercise-book/src/nrf52-usb-data-stage.md @@ -22,6 +22,8 @@ Extend `usb-3.rs` so that it uses `Ep0In` to respond to the `GET_DESCRIPTOR Devi ### Values of the device descriptor +The raw values you need to pack into the descriptor are as follows. Note, we won't be doing this by hand, so read on before you start typing! + - `bLength = 18`, the size of the descriptor (must always be this value) - `bDescriptorType = 1`, device descriptor type (must always be this value) - `bDeviceClass = bDeviceSubClass = bDeviceProtocol = 0`, these are unimportant for enumeration diff --git a/exercise-book/src/nrf52-usb-setup-stage.md b/exercise-book/src/nrf52-usb-setup-stage.md index 178f727..aa42bbf 100644 --- a/exercise-book/src/nrf52-usb-setup-stage.md +++ b/exercise-book/src/nrf52-usb-setup-stage.md @@ -22,7 +22,7 @@ Modify `Request::parse()` in `nrf52-code/usb-lib/src/lib.rs` to recognize a `GET When you need to write some `no_std` code that does not involve device-specific I/O you should consider writing it as a separate crate. This way, you can test it on your development machine (e.g. `x86_64`) using the standard `cargo test` functionality. -So that's what we'll do here. In `nrf52-code/usb-lib/src/lib.rs` you'll find starter code for writing a `no_std` SETUP data parser. The starter code contains some unit tests; you can run them with `cargo test` (from within the `usb` folder) or you can use Rust Analyzer's "Test" button in VS code. +So that's what we'll do here. In `nrf52-code/usb-lib/src/lib.rs` you'll find starter code for writing a `no_std` SETUP data parser. The starter code contains some unit tests; you can run them with `cargo test` (from within the `usb-lib` folder) or you can use Rust Analyzer's "Test" button in VS code. The definition of `Descriptor::Configuration` as well as the associated test has been "commented out" using an `#[cfg(TODO)]` attribute because it is not handled by the firmware yet. Delete the `#[cfg(TODO)]` so that the unit tests can access it. This pattern is used for enum members and test functions throughout this workshop, so keep it in mind should you see it again.