Page 1 of 1

using lib_xud and module_xud implement 2 usb issue

Posted: Mon Nov 18, 2019 4:02 am
by TonyXiao
Hi all

2 usb function are need for my project, and i am trying use lib_xud and module_xud .
for 1 usb function, both libraries can be used to realize the usb function.
for 2 usb function, that's to say each libray realize one usb.
of curse there are some prerequisite works, there are some same parts for the 2 libaries, so i changed the lib_xud, usb signals 、some variables、and some functions are renamed. when finish such works, the lib_xud still works on usb.
when i used them both, only the lib_xud usb function is ok, and always failed with module_xud.
i tried basing on 1 usb with module_xud, and add lib_xud step by step. first i just add lib_xud in workspace, compile ok, but usb function failed. it is strange, i just add the library.
and i found when i delete lib_xud in USED_MODULES of the makefile, and the module_xud usb function works.
USED_MODULES = module_xud module_usb_shared module_usb_device module_usb_audio module_usb_midi module_dfu module_locks

so lib_xud and module_xud can not work at the same time?

Re: using lib_xud and module_xud implement 2 usb issue

Posted: Fri Dec 13, 2019 7:24 am
by TonyXiao
solved.
the lib_xud is the child of module_xud, it shares most of the function and variable.
after rename the whole function and variables in lib_xud, now the two libary working together now.

Re: using lib_xud and module_xud implement 2 usb issue

Posted: Fri Dec 13, 2019 12:25 pm
by akp
Glad you got it working. I think XMOS should have designed it to work simply by instantiating on the different tiles but I wonder if it's something simple -- like #define usb_tile etc -- that causes it to fail.

Re: using lib_xud and module_xud implement 2 usb issue

Posted: Fri Dec 13, 2019 12:29 pm
by akp
Glad you got it working. I think XMOS should have designed it to work simply by instantiating on the different tiles but I wonder if it's something simple -- like #define usb_tile etc -- that causes it to fail.