Should I use libusb or libxud?

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
User avatar
dsteinwe
Experienced Member
Posts: 100
Joined: Wed Jun 29, 2016 8:59 am

Should I use libusb or libxud?

Post 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


Ralf.Suckow
Junior Member
Posts: 4
Joined: Sun Nov 01, 2020 10:26 pm

Post 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
User avatar
dsteinwe
Experienced Member
Posts: 100
Joined: Wed Jun 29, 2016 8:59 am

Post by dsteinwe »

Thanks for the info.
User avatar
dsteinwe
Experienced Member
Posts: 100
Joined: Wed Jun 29, 2016 8:59 am

Post 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!
MaximLiadov
Active Member
Posts: 45
Joined: Mon Apr 16, 2018 9:14 am

Post 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.
Last edited by MaximLiadov on Sun Jan 30, 2022 3:28 pm, edited 1 time in total.
MaximLiadov
Active Member
Posts: 45
Joined: Mon Apr 16, 2018 9:14 am

Post by MaximLiadov »

Many thanks to Ross Owen and all XMOS people for the lib_xud library. I like it very much. Great job!
User avatar
dsteinwe
Experienced Member
Posts: 100
Joined: Wed Jun 29, 2016 8:59 am

Post by dsteinwe »

Sorry, I have not used the DFU, yet. So I cannot share any experience.
MaximLiadov
Active Member
Posts: 45
Joined: Mon Apr 16, 2018 9:14 am

Post 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.
MaximLiadov
Active Member
Posts: 45
Joined: Mon Apr 16, 2018 9:14 am

Post 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.
User avatar
Ross
XCore Expert
Posts: 783
Joined: Thu Dec 10, 2009 9:20 pm

Post 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.