-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 TL;DR: * https://github.com/karlp/libopencm3-examples/tree/drafts/gadget0-2/tests/gadget-zero * python -m unittest test_gadget0
Just wanted to let people have a bit of an update on what's happening with all the USB pulls, particularly getting F0 and L0 (and L4...) to merge in cleanly. There's been a lot of conversations on IRC on and off about testing, and particularly with the USB pulls, it was getting difficult to do fair judgements of changes. There was no real common tests to be done, and so few people had sufficient boards or sufficient inclination to run any sort of comprehensive tests. We'd tended to rely on, "this is working in my project" I personally didn't know enough (still don't, but I'm learning) about both USB device development and the libopencm3 usb device framework code, so I have been not merging anything until I could be happy that it wasn't breaking things on existing platforms, and so that it would be easy to maintain in the future. There've already been cases of things getting fixed in one place, but not fixed in others, and I'm trying to avoid that. (particularly the USB examples in the -examples repo, which have a lot of copy pasta) So... Testing :) I decided to build up "gadget zero" firmware, modeled after the linux gadget framework driver, ideally so that the existing usbtest code could be used. [see references] Turns out that needs kernel module support that wasn't packaged for my desktop, and I didn't have any linux gadget capable hardware around to get a baseline, but, with a bit of libusb and python, I've got some tests running on f4 and f1, and will be expanding it when I fix a few niggles. this is largely automated. Flash the device firmware, run the tests. The tests are common, the "gadget zero" code is all common, just a little bit of startup glue for the different targets. I've fiddled with some makefiles a bit to make it bit easier to build multiple targets from one base (I think I succeeded in making it easier, we'll see) I've still got some wrinkles to sort out, and I've not finished setting up the "loopback" function yet, but it's already given me a great understanding of the locm3 usb code base, and I feel it's going to be a great groundwork for merging in the rest. If only I had some more time in the day :) Currently, I've got this in the examples repo, in a separate tree, "testing" as it's a different structure of files than the family/subfamily/board/demo in the "examples" dir. I'm not sure what the best final location for this is though, if people have any opinions on that. For reference, the code I'm currently expanding on is at https://github.com/karlp/libopencm3-examples/tree/drafts/gadget0-2/tests/gadget-zero The tests are all in pyusb and standard unittest, you can run them with "python -m unittest test_gadget0" though I'm actually using PyCharm community edition myself. Progress is still slow, but just letting you know that it's not zero, it is moving forward and the f0/l0 usb willll land RealSoonNow, and I hope that these tests I've built up will help keep USB healthy down the road too. Cheers, Karl P USB gadget 0 and testing links http://www.linux-usb.org/usbtest/ https://github.com/torvalds/linux/blob/master/Documentation/usb/gadget-testing.txt (particularly the source/sink and loopback functions) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBAgAGBQJV615fAAoJEBmotQ/U1cr2WekP/RUALvE6+iVidDhu4KKhda0I SXtVPN89xJCc/slJnBJJp3wVDoGJTmWS/wrMHPzkohPc154JrI8hqo3mYuLsmHA4 D6+ntp5P4DiEEPfpcWyvVSj6opToTzRvfMIZIpioi4BQGTQtcFPQWzoNZ/ZOwjyA gsAccY/rZlKpghV+rTz6UBtwtnixhkPdNOsunjjuAD/5EdxwQd2qmGDEjdUKAfM/ ybThR+Z51gHtoQQoCvMpsDevnx9Ous9W2MmBBH0HkB9zkjIGmwNCRdxKk1VcBEDA nP1+T3R90eCVXlsbGvmFzMQJfc79jb1gTTmfzNWqdGv9TxVGRTbT+1kgfQYASKuR b/gdxZDbbegCgSwVWmgfTOFzzXh7V8xsTLAbEC9Cm9D2fWuFMP4HIdNB5CzlsJNl ViQq7W3skD9hCMjg1P9MxvFvEdOeV0lvIB4HPKZQg/58+ehMLORTu1FQLX76x4RJ ZNGC/SGn0EmSVmBe39v+iAw7SUijdtHyJFn+vk3NS+Erq659JWjxl+zlT7vYuPEd EsJ/6+1zfPtGOCsI5RGAcPId1uK0x7Xax9S4FA5uomRUbyjiCPWlO/SdFKwXOSP8 TV0zNF7aZUm7A9BGY7fW0w33FNCS2Fm7s2kV7qoyZb4mozlKRXarO6yPJy1VkN2/ SmTDjxUz2rgPRbspKojs =09Wr -----END PGP SIGNATURE-----
------------------------------------------------------------------------------
_______________________________________________ libopencm3-devel mailing list libopencm3-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libopencm3-devel