usb-device testing resources
Running the full test suite for usb-device requires two computers, connected via USB: a target USB device, and a host running the test suite. This repository contains firmware source code for that target device, and instructions to run the tests from the host.
In general, since the object is to test usb-device, we can't assume that the USB is a viable channel for flashing the firmware. These firmwares are intended to be loaded via SWD, so a debug probe supported by cargo-embed will be required, rather than using a protocol like HF2 to flash over USB.
This repo has usb-device
as a git submodule, so either clone using the --recursive
flag initially, or run git submodule update --init
if the usb-device
directory is empty.
graph LR;
Debugger[Debug probe]
Host --- Debugger
Host ---|USB| Target
Debugger ---|SWD| Target
Firmware is included in the metro-m0-express
directory for running the tests against an Adafruit Metro M0 - based on ATSAMD21G18 Cortex M0+. Loading this firmware will require a SWD debug probe.
Firmware is included in the metro-m4-express
directory for running the tests against an Adafruit Metro M4 - based on ATSAMD21G18 Cortex M4. Loading this firmware will require a SWD debug probe.
- Update
usb-device
submodule to the commit to test - Connect target board and programmer
- Compile and flash firmware in to the target as described in the README for the chosen target
- In the usb-device directory, run
cargo test