libopencm3/tests/gadget-zero
Karl Palsson 3ed12b6fd9 usb: short control IN might need a ZLP
Control transfers can transfer less than was requested by the host in the
wLength field.  if this short transfer is a multiple of the endpoint's packet
size, a zero length packet must be sent.

Adds tests for a range of control transfer IN requests, and properly supports
this in the core.  Based heavily on work by Kuldeep Dhaka.

See https://github.com/libopencm3/libopencm3/pull/505
and https://github.com/libopencm3/libopencm3/pull/194 for original discussion.

Tested with stm32f4, stm32f103 and stm32l053.
2015-10-11 18:43:11 +00:00
..
Makefile.stm32f4disco tests: usb: gadget0 compatible interface (stm32f4) 2015-10-03 00:58:43 +00:00
Makefile.stm32f072disco usb: Add st_usbfs_v2 for f0/l0 devices 2015-10-03 02:03:58 +00:00
Makefile.stm32f103-generic tests: gadget0: add stm32f103 target 2015-10-03 01:18:17 +00:00
Makefile.stm32l1-generic tests: gadget0: add stm32l1 target 2015-10-03 01:29:49 +00:00
Makefile.stm32l053disco tests: gadget0: Add stm32l053 disco support 2015-10-06 00:54:53 +00:00
README.md tests: usb: gadget0 compatible interface (stm32f4) 2015-10-03 00:58:43 +00:00
main-stm32f4disco.c tests: usb: gadget0 compatible interface (stm32f4) 2015-10-03 00:58:43 +00:00
main-stm32f072disco.c tests: gadget0: F0: drop unnecessary code. 2015-10-04 00:28:16 +00:00
main-stm32f103-generic.c usb: extract ST USB FS peripheral core. [BREAKING CHANGE] 2015-10-03 01:32:34 +00:00
main-stm32l1-generic.c usb: extract ST USB FS peripheral core. [BREAKING CHANGE] 2015-10-03 01:32:34 +00:00
main-stm32l053disco.c tests:gadget0: stm32l0: drop RCC test code 2015-10-06 01:06:30 +00:00
openocd.stm32f4disco.cfg tests: usb: gadget0 compatible interface (stm32f4) 2015-10-03 00:58:43 +00:00
openocd.stm32f072disco.cfg usb: Add st_usbfs_v2 for f0/l0 devices 2015-10-03 02:03:58 +00:00
openocd.stm32f103-generic.cfg tests: gadget0: add stm32f103 target 2015-10-03 01:18:17 +00:00
openocd.stm32l1-generic.cfg tests: gadget0: add stm32l1 target 2015-10-03 01:29:49 +00:00
openocd.stm32l053disco.cfg tests: gadget0: Add stm32l053 disco support 2015-10-06 00:54:53 +00:00
stub.py tests: usb: gadget0 compatible interface (stm32f4) 2015-10-03 00:58:43 +00:00
test_gadget0.py usb: short control IN might need a ZLP 2015-10-11 18:43:11 +00:00
usb-gadget0.c usb: short control IN might need a ZLP 2015-10-11 18:43:11 +00:00
usb-gadget0.h tests: usb: gadget0 compatible interface (stm32f4) 2015-10-03 00:58:43 +00:00

README.md

This project, inspired by usbtest and the linux usb gadget zero driver is used for regression testing changes to the libopencm3 usb stack.

The firmware itself is meant to be portable to any supported hardware, and then identical unit test code is run against all platforms. This project can and should be built for multiple devices.

Requirements: pyusb for running the tests. openocd >= 0.9 for automated flashing of specific boards python3 for running the tests at the command line.

You will need to modify the openocd config files, as they contain specific serial numbers of programming hardware. You should set these up for the set of available boards at your disposal.

Tests marked as @unittest.skip are either for functionality that is known to be broken, and are awaiting code fixes, or are long running performance tests

An example of a successful test run: