![]() A convenient Makefile is provided to this aim in this tools/usb directory. ![]() The user-space application located in tools/usb/ in the Linux kernel code needs to be cross-compiled. Of course USB Host support must also be enabled, with the relevant drivers depending on your specific hardware. Usage of test-usb where the test and tested system are the sameįor the test system, one needs to enable the USB test driver, using CONFIG_USB_TEST=m. Instead, since our board that contains the USB Device Controller to be tested also includes a USB Host controller, we used the board itself as a test system, and looped back the USB Host to the USB Device using the appropriate USB cable. So we didn’t use our workstation as the test system. The driver can hang on some failures and, in that case, a test system reboot is needed. The testusb part that runs on the test system is composed of a kernel driver and a simple user-space program that asks the driver to run the tests. Indeed, this gadget is compatible with testusb. On the tested system, the simple g_zero gadget module ( CONFIG_USB_ZERO=m) can be used. On this system, a dedicated USB test kernel module is needed, together with the testusb user-space application. The test system, which runs the tests themselves, which has a USB Host Controller.The system under test, which contains the USB Device Controller to be tested, which must expose some USB functionality using a USB gadget driver.The tool is quite old and not very well known, but it proved to be very useful for our testing, so in this blog post we are sharing some details on how to use it.įirst of all, some documentation can be found at. ![]() However, these existing USB gadget drivers are not necessarily the best option for this kind of testing: they perform some more or less complex transfers and it can be difficult to find the root cause of an error using these gadget drivers.įortunately, a tool exists precisely to perform testing of USB transfers: this tool is called testusb, and it can be found directly in the Linux kernel source code in tools/usb/testusb.c. This driver is already accepted upstream, is currently visible in linux-next and should hopefully be part of the upcoming Linux 6.3 release.Īs part of developing this driver, we of course had to… test it! To test a USB Device Controller driver, the obvious idea that comes to mind is to use the available USB gadget drivers in the Linux kernel, to expose a USB mass-storage device, a USB network device, etc. At Bootlin, we recently developed from scratch a new Linux driver for the USB Device Controller found in the Renesas RZ/N1 processor. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |