Linux tool vfctrl_usb build error, failed using arm-linux-gcc

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
nestor_lee
Member
Posts: 13
Joined: Tue Nov 26, 2019 11:27 am

Linux tool vfctrl_usb build error, failed using arm-linux-gcc

Postby nestor_lee » Fri Jul 03, 2020 10:38 am

Hi Team,

We have a customer using Allwinner T5 CPU, running linux 32-bit OS.
In the design, Allwinner T5 CPU needs to communicate with XVF3000 via USB, and CPU needs to send out control command repeatedly to get the DOA angle information from XVF3000 array microphone.
However, we failed to build a vfctrl_usb executable using the arm-linux-gcc toolchain.
We use the Makefile.Pi as template, and changes the libusb directory to linux32 as follows, but got stucked compiling.

vfctrl_usb:
mkdir -p bin
cd src ; gcc -std=c99 -D_GNU_SOURCE -Wall -g -D HOST_APP -o ../bin/vfctrl_usb \
-I ../libusb/Linux32 \
$(LIB_DEVICE_CONTROL)/lib_device_control/host/device_access_usb.c \
-lusb-1.0 \
-D USE_USB=1 \
$(COMMON)

Please share some comments if you have encountered some similar problem.
The message is as follows,

beclear/lib_xbeclear/host/control# make -f Makefile.Linux32 vfctrl_usb
mkdir -p bin
cd src ; arm-linux-gcc -std=c99 -D_GNU_SOURCE -Wall -g -D HOST_APP -o ../bin/vfctrl_usb \
-I ../libusb/Linux32 \
../../../../../lib_device_control/lib_device_control/host/device_access_usb.c \
-lusb-1.0 \
-D USE_USB=1 \
-DBECLEAR_HOST=1 -I ../../../../../lib_device_control/lib_device_control/api -I ../../../../../lib_device_control/lib_device_control/src -I ../../../../../lib_device_control/lib_device_control/host -I ../../../../../sw_vocalfusion/module_vocalfusion/include -I ../../../../lib_xbeclear/inc/xmos -I ../../../../lib_xbeclear/api -I /opt/local/include ../../../../../lib_device_control/lib_device_control/host/util.c host.c -lm -lpthread -lreadline
/usr/local/arm/arm-linux-gcc-4.4.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.3/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lusb-1.0
collect2: ld returned 1 exit status
Makefile.Linux64:36: recipe for target 'vfctrl_usb' failed
make: *** [vfctrl_usb] Error 1

Image
You do not have the required permissions to view the files attached to this post.
Last edited by nestor_lee on Fri Jul 03, 2020 10:41 am, edited 1 time in total.
nestor_lee
Member
Posts: 13
Joined: Tue Nov 26, 2019 11:27 am

Postby nestor_lee » Fri Jul 03, 2020 10:40 am

Thanks
User avatar
mon2
XCore Legend
Posts: 1815
Joined: Thu Jun 10, 2010 11:43 am

Postby mon2 » Sat Jul 04, 2020 10:34 am

Hi. My 2-bits on this is to:

a) pick up the same raspberry pi board as used in the XMOS ref design

b) compile the same the source as per the attached document

c) once this procedure is working, then attempt the same on your different ARM target. This should reveal where the tools are breaking for your slightly different target.

From the quick review of your compilation effort, the libusb support appears to be missing. Linux can be a pain so best to start with a known-good and working process before customizing the IP.

Please post your updates.
You do not have the required permissions to view the files attached to this post.
nestor_lee
Member
Posts: 13
Joined: Tue Nov 26, 2019 11:27 am

Postby nestor_lee » Wed Jul 08, 2020 9:36 am

Hi Mon2,

Thanks for your advice, I've tried your suggestion, and using RaspberryPi 3B and following the control guide, I can build the vfctrl_usb tool successfully.
Then I moved forward, using the cross-compiling toolchain, I failed to build it.

The cross-compiling toolchain is aarch64-linux-gnu-gcc provided by Allwinner tech.
I uses Ubuntu 16.04 as host, first, I install the dependencies
sudo apt - get install libusb -1.0 -0 - dev libreadline - dev libncurses5 - dev

and set
alias gcc='aarch64-linux-gnu-gcc'
in ~/.bashrc
and export PATH of the toolchain in /etc/profile
export PATH=$PATH:/home/nestor/Workspace/gcc-linaro-5.3.1-2016.05-x86_64_aarch64-linux-gnu/bin

Then I switch to the directory of sw_vocalfusion-[sw]_1.1.2rc5\lib_xbeclear\lib_xbeclear\host\control
and build the tool using
make -f Makefile.Linux64 vfctrl_usb

But it always reports an error
host.c:13:31: fatal error: readline/readline.h: No such file or directory
Image
You do not have the required permissions to view the files attached to this post.
User avatar
mon2
XCore Legend
Posts: 1815
Joined: Thu Jun 10, 2010 11:43 am

Postby mon2 » Wed Jul 08, 2020 9:41 am

https://stackoverflow.com/questions/230 ... -not-found

Code: Select all

sudo apt-get install libreadline-dev
nestor_lee
Member
Posts: 13
Joined: Tue Nov 26, 2019 11:27 am

Postby nestor_lee » Wed Jul 08, 2020 11:10 am

Already tried this before posting.
The problem remains.
User avatar
mon2
XCore Legend
Posts: 1815
Joined: Thu Jun 10, 2010 11:43 am

Postby mon2 » Wed Jul 08, 2020 1:32 pm

Try with

Code: Select all

sudo apt-get install git build-essential
nestor_lee
Member
Posts: 13
Joined: Tue Nov 26, 2019 11:27 am

Postby nestor_lee » Thu Jul 09, 2020 4:44 am

Tired this too, problem remains.
I'm thinking it might related to the cross-compiling toolchain, because if I use gcc for X86, it will build a executable tool for Ubuntu.
User avatar
akp
Respected Member
Posts: 441
Joined: Thu Nov 26, 2015 11:47 pm

Postby akp » Thu Jul 09, 2020 8:27 pm

You'll probably have to work on your cross-compiler setup, if you download the readline source and cross compile it to a library that would probably work. Obviously there are some hoops to jump through if you need to keep your code free of gpl stuff.
nestor_lee
Member
Posts: 13
Joined: Tue Nov 26, 2019 11:27 am

Postby nestor_lee » Tue Jul 14, 2020 10:09 am

Hi all,

Customer's OS switched to Android.
And they cannot compile an android vfctrl_usb tool as expected, but they've managed to use Android USB API to send commands, and to read back the messages from XMOS.
Thank you all for your help.

Who is online

Users browsing this forum: No registered users and 4 guests