Page 1 of 1
DFU loader for XMOS USB AUDIO - Linux?
Posted: Thu Feb 26, 2015 4:29 pm
by Chendy
I'm wondering what approaches there is for updating/flashing firmware for a XMOS USB Audio device, without using a XTAG or other external tool.
For windows and OSX it seems the "DFU Loader" does the job, but Linux?
Thanks
Senthil
Re: DFU loader for XMOS USB AUDIO - Linux?
Posted: Sun Nov 06, 2016 1:41 pm
by zab
308 views but no replies; seems there's interest in this.
+1 !!
Re: DFU loader for XMOS USB AUDIO - Linux?
Posted: Mon Nov 07, 2016 2:58 am
by Dyang
Read the design_guide,
Macro :DFU
Description :Enable DFU functionality.
A driver required for Windows operation.
Default: 1 (Enabled)
,Maybe Linux doesn't need ?
Re: DFU loader for XMOS USB AUDIO - Linux?
Posted: Mon Nov 07, 2016 4:49 am
by zab
Reading the build instructions for OSX:
https://www.xmos.com/support/boards?ver ... 441&page=4
Would it simply be a case of changing the Makefile flags to suit *nix?
Re: DFU loader for XMOS USB AUDIO - Linux?
Posted: Tue Oct 10, 2017 11:24 am
by johned
A kind customer has shared these instructions with me, to explain how they got this running under Ubuntu 17.04.
1. Install usblib:
sudo apt-get install libusb-1.0-0-dev
2. Tweak headers in ‘xmosdfu.cpp’ :
#include <libusb-1.0/libusb.h>
3. Build:
g++ -g -o xmosdfu xmosdfu.cpp `pkg-config --libs --cflags libusb-1.0`
Needs root privileges to run.
Best regards,
John
Re: DFU loader for XMOS USB AUDIO - Linux?
Posted: Thu Aug 05, 2021 5:00 pm
by jseaber
johned wrote: ↑Tue Oct 10, 2017 11:24 am
A kind customer has shared these instructions with me, to explain how they got this running under Ubuntu 17.04.
1. Install usblib:
sudo apt-get install libusb-1.0-0-dev
2. Tweak headers in ‘xmosdfu.cpp’ :
#include <libusb-1.0/libusb.h>
3. Build:
g++ -g -o xmosdfu xmosdfu.cpp `pkg-config --libs --cflags libusb-1.0`
Needs root privileges to run.
Best regards,
John
To save anyone a headache, the DFU loader compiles under Ubuntu 20.0.4 with these modifications
, but produces unexpected results. Observations:
'xmosdfu --listdevices' works
'xmosdfu --download...' returns the error "Could not find/open device", despite the VID/PID appearing correctly in the list and the same code running fine under macOS. I've attempted to read through xmosdfu.cpp and see this error is thrown by:
Code: Select all
if (libusb_open(dev, &devh) < 0)
{
return -1;
}
So, libusb functionality differs in this setup. Additionally, 5 warnings are returned when compiling, which differ from the 6 warnings returned when compiling under macOS Big Sur. This again suggests a difference in the compiled version of libusb.
I'll update if/when we manage to resolve.
EDIT: The fix was super simple. The --download command requires `sudo` privileges, wheras the --listdevices command does not! Permissions work differently in macOS...
Re: DFU loader for XMOS USB AUDIO - Linux?
Posted: Thu Feb 17, 2022 6:47 pm
by jseaber
To accommodate both Mac and Linux systems, replace the libusb include as follows. Tested under Ubuntu 20.0.4 and macOS Big Sur:
#ifdef __linux
#include <libusb-1.0/libusb.h>
#endif
#ifdef __APPLE__
#include "libusb.h"
#endif