Page 1 of 2

Should I use libusb or libxud?

Posted: Tue Dec 14, 2021 3:44 pm
by dsteinwe
Hello,

I have seen the project lib_xud v2.0.2 on github. The readme of the project says, that it merges the existing sc_xud and lib_usb and replaces them both. Should I use lib_xud v2.0.2 instead of the lib_usb v3.1.2 from xmos library directory for product development? Does lib_xud contain bug fixes and features, that lib_usb v3.1.2 does not contain? Is lib_usb not compatible to the new AI processors but lib_xud is?

Best regards
Dieter

Re: Should I use libusb or libxud?

Posted: Thu Jan 13, 2022 12:25 pm
by Ralf.Suckow
Yes, yes and yes. The only disadvantage is that lib_xud is not compatible to XS1 processors. The API is almost compatible.

(Just stumbled over your question. Switching fixed some bugs for me last December, including some performance issues.)

/Ralf

Re: Should I use libusb or libxud?

Posted: Thu Jan 13, 2022 1:50 pm
by dsteinwe
Thanks for the info.

Re: Should I use libusb or libxud?

Posted: Tue Jan 25, 2022 2:49 pm
by dsteinwe
In the meantime, i have switched to libxud. I have only add one line to xud.h to be able to compile it with xcc 14.x.x:

Code: Select all

#define xcore_clock_t clock
I had to fix the includes. Also the functions differs a little bit, but that was easy to fix. I personally prefer the libusb implementation to the libxud one for the XUD_InitEp() function. But that's just my personal taste.

libusb has some experimental code that is not ported yet to libxud.

However, thumbs up for libxud!

Re: Should I use libusb or libxud?

Posted: Sat Jan 29, 2022 6:11 pm
by MaximLiadov
Please, test if DFU does work in your project with lib_xud 2.1.0?

I also implemented latest lib_xud 2.1.0 instead of old one. Everything works fine, USB works fine, but now I have a problem with a DFU updater. Seems to be XMOS cannot reboot to DFU mode for some reason and get stuck. If I reboot XMOS manually (inside a firmware with a button) DFU does work fine then. I had no such problem with lib_xud v.1.2, so I believe it's an issue with a new more advanced lib_xud version.

Re: Should I use libusb or libxud?

Posted: Sat Jan 29, 2022 6:21 pm
by MaximLiadov
Many thanks to Ross Owen and all XMOS people for the lib_xud library. I like it very much. Great job!

Re: Should I use libusb or libxud?

Posted: Sat Jan 29, 2022 6:47 pm
by dsteinwe
Sorry, I have not used the DFU, yet. So I cannot share any experience.

Re: Should I use libusb or libxud?

Posted: Sat Jan 29, 2022 6:50 pm
by MaximLiadov
That's pity. Thank you for your response anyway. Hope to see any clue from someone who uses lib_xud as a complete replacement.

Re: Should I use libusb or libxud?

Posted: Sun Jan 30, 2022 4:34 pm
by MaximLiadov
I found the problem. It's reboot.xc that doesn't work correctly with new lib_xud.

We still need some definitions (that we have no more in xud.h) for compatibility with all current projects.

#ifndef XUD_X200_SERIES
#define XUD_X200_SERIES 4
#endif

#define XUD_SERIES_SUPPORT XUD_X200_SERIES

These defines affect on some part of sourcodes around the project. So lib_xud 1.2 worked fine, and lib_xud 2.1 doesn't work.

The solution is: either add old defines to xud.h or update old codes removing defines manually.

Re: Should I use libusb or libxud?

Posted: Wed Mar 02, 2022 2:59 pm
by Ross
MaximLiadov wrote: Sat Jan 29, 2022 6:21 pm Many thanks to Ross Owen and all XMOS people for the lib_xud library. I like it very much. Great job!
No problem :)

Please do use lib_xud, its has updates for xCORE.AI devices now.