DFU fails - "Error claiming interface 0", in Ubuntu 18.04
Posted: Tue Nov 26, 2019 2:46 pm
Hi XMOS experts,
I'm testing the DFU function using a XK-VF3100-C43 kit.
I followed the procedures as follows:
1. Download USB Audio 2.0 software from this webpage https://www.xmos.com/software/usb-audio
2. Extract the usb-audio software into my workspace: ~/workspace, and use the project
~/workspace/package/sw_usb_audio-615rc1/sw_usb_audio for testing.
After compiling, got following .xe files:
~/workspace/package/sw_usb_audio-615rc1/sw_usb_audio/app_usb_aud_mic_array/bin$ tree
.
├── 1i8o2
│ └── app_usb_aud_mic_array_1i8o2.xe
└── 2i8o2
└── app_usb_aud_mic_array_2i8o2.xe
3. Use 2i8o2/app_usb_aud_mic_array_2i8o2.xe as factory image, since its PID is 0x8( and if flashing 1i8o2/app_usb_aud_mic_array_1i8o2.xe in to demo board, got the VID = 0x20b1, PID = 0x9 . While the xmosdfu tool could not find devices if PID = 0x9).
So I type
~/workspace/package/sw_usb_audio-615rc1/sw_usb_audio/app_usb_aud_mic_array/bin$ xflash --boot-partition-size 0x30000 --factory ./2i8o2/app_usb_aud_mic_array_2i8o2.xe
to flash the firmware.
And, to generate the newfirmware to be flashed via DFU, by typing
~/workspace/package/sw_usb_audio-615rc1/sw_usb_audio/app_usb_aud_mic_array/bin$ xflash --factory-version 14.3 --upgrade 1 ./1i8o2/app_usb_aud_mic_array_1i8o2.xe -o ./1i8o2/newfirmware.bin
So now that I got the newfirmware.bin
.
├── 1i8o2
│ ├── app_usb_aud_mic_array_1i8o2.xe
│ └── newfirmware.bin
└── 2i8o2
└── app_usb_aud_mic_array_2i8o2.xe
4. Change directory to
~/workspace/package/sw_usb_audio-615rc1/sc_usb_audio/module_dfu/host/xmos_dfu_linux$
and follow the instructions in this thread(https://www.xcore.com/viewtopic.php?f=47&t=4025)
After installing usblib, I can build the xmosdfu tool by typing
~/workspace/package/sw_usb_audio-615rc1/sc_usb_audio/module_dfu/host/xmos_dfu_linux$ g++ -g -o xmosdfu xmosdfu.cpp `pkg-config --libs --cflags libusb-1.0`
~/workspace/package/sw_usb_audio-615rc1/sc_usb_audio/module_dfu/host/xmos_dfu_linux$ ls
Makefile.linux Readme.txt xmosdfu xmosdfu.cpp
5. First check the usb devices
~/workspace/package/sw_usb_audio-615rc1/sc_usb_audio/module_dfu/host/xmos_dfu_linux$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 007: ID 2386:310f
Bus 001 Device 005: ID 8087:0aa7 Intel Corp.
Bus 001 Device 066: ID 20b1:0008 XMOS Ltd
Bus 001 Device 003: ID 04f2:b56d Chicony Electronics Co., Ltd
Bus 001 Device 052: ID 20b1:f7d4 XMOS Ltd
Bus 001 Device 002: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
We can find the target XMOS device here
Bus 001 Device 066: ID 20b1:0008 XMOS Ltd
6. xmosdfu needs to be run as root, if not, will get "Could not find/open device" error(https://www.xcore.com/viewtopic.php?f=47&t=7691).
So I type
~/workspace/package/sw_usb_audio-615rc1/sc_usb_audio/module_dfu/host/xmos_dfu_linux$ sudo ./xmosdfu --download ~/workspace/package/sw_usb_audio-615rc1/sw_usb_audio/app_usb_aud_mic_array/bin/1i8o2/newfirmware.bin
[sudo] password for nestor:
VID = 0x1d6b, PID = 0x3, BCDDevice: 0x415
VID = 0x2386, PID = 0x310f, BCDDevice: 0x0
VID = 0x8087, PID = 0xaa7, BCDDevice: 0x1
VID = 0x20b1, PID = 0x8, BCDDevice: 0x6f2
XMOS DFU application started - Interface 3 claimed
Detaching device from application mode.
Waiting for device to restart and enter DFU mode...
VID = 0x1d6b, PID = 0x3, BCDDevice: 0x415
VID = 0x2386, PID = 0x310f, BCDDevice: 0x0
VID = 0x8087, PID = 0xaa7, BCDDevice: 0x1
VID = 0x20b1, PID = 0x8, BCDDevice: 0x6f2
Error claiming interface 0
Another program or driver has claimed the interface
I've been told that the Interface will bechanged to 0 as device restart to DFU mode.
But I don't know why it stuck (perhaps in interface 3?).
I've tried to unplug and re-plug the USB cable, but it does no help.
Please give a hand.
Thanks.
I'm testing the DFU function using a XK-VF3100-C43 kit.
I followed the procedures as follows:
1. Download USB Audio 2.0 software from this webpage https://www.xmos.com/software/usb-audio
2. Extract the usb-audio software into my workspace: ~/workspace, and use the project
~/workspace/package/sw_usb_audio-615rc1/sw_usb_audio for testing.
After compiling, got following .xe files:
~/workspace/package/sw_usb_audio-615rc1/sw_usb_audio/app_usb_aud_mic_array/bin$ tree
.
├── 1i8o2
│ └── app_usb_aud_mic_array_1i8o2.xe
└── 2i8o2
└── app_usb_aud_mic_array_2i8o2.xe
3. Use 2i8o2/app_usb_aud_mic_array_2i8o2.xe as factory image, since its PID is 0x8( and if flashing 1i8o2/app_usb_aud_mic_array_1i8o2.xe in to demo board, got the VID = 0x20b1, PID = 0x9 . While the xmosdfu tool could not find devices if PID = 0x9).
So I type
~/workspace/package/sw_usb_audio-615rc1/sw_usb_audio/app_usb_aud_mic_array/bin$ xflash --boot-partition-size 0x30000 --factory ./2i8o2/app_usb_aud_mic_array_2i8o2.xe
to flash the firmware.
And, to generate the newfirmware to be flashed via DFU, by typing
~/workspace/package/sw_usb_audio-615rc1/sw_usb_audio/app_usb_aud_mic_array/bin$ xflash --factory-version 14.3 --upgrade 1 ./1i8o2/app_usb_aud_mic_array_1i8o2.xe -o ./1i8o2/newfirmware.bin
So now that I got the newfirmware.bin
.
├── 1i8o2
│ ├── app_usb_aud_mic_array_1i8o2.xe
│ └── newfirmware.bin
└── 2i8o2
└── app_usb_aud_mic_array_2i8o2.xe
4. Change directory to
~/workspace/package/sw_usb_audio-615rc1/sc_usb_audio/module_dfu/host/xmos_dfu_linux$
and follow the instructions in this thread(https://www.xcore.com/viewtopic.php?f=47&t=4025)
After installing usblib, I can build the xmosdfu tool by typing
~/workspace/package/sw_usb_audio-615rc1/sc_usb_audio/module_dfu/host/xmos_dfu_linux$ g++ -g -o xmosdfu xmosdfu.cpp `pkg-config --libs --cflags libusb-1.0`
~/workspace/package/sw_usb_audio-615rc1/sc_usb_audio/module_dfu/host/xmos_dfu_linux$ ls
Makefile.linux Readme.txt xmosdfu xmosdfu.cpp
5. First check the usb devices
~/workspace/package/sw_usb_audio-615rc1/sc_usb_audio/module_dfu/host/xmos_dfu_linux$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 007: ID 2386:310f
Bus 001 Device 005: ID 8087:0aa7 Intel Corp.
Bus 001 Device 066: ID 20b1:0008 XMOS Ltd
Bus 001 Device 003: ID 04f2:b56d Chicony Electronics Co., Ltd
Bus 001 Device 052: ID 20b1:f7d4 XMOS Ltd
Bus 001 Device 002: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
We can find the target XMOS device here
Bus 001 Device 066: ID 20b1:0008 XMOS Ltd
6. xmosdfu needs to be run as root, if not, will get "Could not find/open device" error(https://www.xcore.com/viewtopic.php?f=47&t=7691).
So I type
~/workspace/package/sw_usb_audio-615rc1/sc_usb_audio/module_dfu/host/xmos_dfu_linux$ sudo ./xmosdfu --download ~/workspace/package/sw_usb_audio-615rc1/sw_usb_audio/app_usb_aud_mic_array/bin/1i8o2/newfirmware.bin
[sudo] password for nestor:
VID = 0x1d6b, PID = 0x3, BCDDevice: 0x415
VID = 0x2386, PID = 0x310f, BCDDevice: 0x0
VID = 0x8087, PID = 0xaa7, BCDDevice: 0x1
VID = 0x20b1, PID = 0x8, BCDDevice: 0x6f2
XMOS DFU application started - Interface 3 claimed
Detaching device from application mode.
Waiting for device to restart and enter DFU mode...
VID = 0x1d6b, PID = 0x3, BCDDevice: 0x415
VID = 0x2386, PID = 0x310f, BCDDevice: 0x0
VID = 0x8087, PID = 0xaa7, BCDDevice: 0x1
VID = 0x20b1, PID = 0x8, BCDDevice: 0x6f2
Error claiming interface 0
Another program or driver has claimed the interface
I've been told that the Interface will bechanged to 0 as device restart to DFU mode.
But I don't know why it stuck (perhaps in interface 3?).
I've tried to unplug and re-plug the USB cable, but it does no help.
Please give a hand.
Thanks.