Issue with XMOS DFU Using XTC Version 15.3 (AN02019)

Discussions relating to the XK-EVK-XU316
rml42
New User
Posts: 2
Joined: Sat Oct 19, 2024 11:40 pm

Issue with XMOS DFU Using XTC Version 15.3 (AN02019)

Post by rml42 »

Hi,

I'm trying to perform a Device Firmware Upgrade (DFU) on my XMOS USB Audio device following **AN02019: Using Device Firmware Upgrade (DFU) in USB Audio**, but I’m running into some issues.

Steps I Followed

1. I flashed the factory image with this command:

Code: Select all

xflash --boot-partition-size 0x30000 --factory app_usb_aud_xk_316_mc_2SSi8o8xxxxxx.xe
2. I generated the upgrade image with:

Code: Select all

xflash --factory-version 15.3 --upgrade 1 app_usb_aud_xk_316_mc_2SSi8o8xxxxxx.xe -o new_firmware.bin
3. I flashed the device using `xmosdfu`:

Code: Select all

xmosdfu 0016 --download new_firmware.bin
The output seemed successful:

Code: Select all

XMOS DFU application started - Interface 0 claimed  
Detaching device from application mode.  
Waiting for device to restart and enter DFU mode...  
VID = 0x20b1, PID = 0x16, BCDDevice: 0x810  
... DFU firmware upgrade device opened  
... Downloading image (new_firmware.bin) to device  
... Download complete  
... Returning device to application mode  
However, the firmware doesn’t seem to update.

4. When I try to upload the firmware from the device:

Code: Select all

xmosdfu 0016 --upload new_firmware2.bin
I get the following warning:

Code: Select all

XMOS DFU application started - Interface 3 claimed  
Detaching device from application mode.  
Waiting for device to restart and enter DFU mode...  
VID = 0x20b1, PID = 0x16, BCDDevice: 0x810  
... DFU firmware upgrade device opened  
... Uploading image (new_firmware2.bin) from device  
... WARNING: Upgrade image size is 0: check if image is present in the flash  
... Returning device to application mode  

The resulting file (`new_firmware2.bin`) is empty.

Additional Notes

- The firmware is compiled with `-DXUA_DFU_EN=1`.
- I see the same issue with `dfu-util`.
- I’m using `sw_usb_audio-_sw_v8_1_0`. Unfortunately, I can’t upgrade to version 9.0.0 as it’s incompatible with my hardware.
- I noticed that the `xflash` command to generate the upgrade image outputs a very small file:

Code: Select all

72K   new_firmware.bin  
98K   new_firmware.bin.ppb  

The original `.xe` file is over 3.5MB. and works well when I flash it using xflash ...

Questions

1. Why is the generated upgrade image so small?
2. What am I doing wrong in this process?
3. How can I successfully perform a DFU with this setup?

Any guidance would be much appreciated!

Thank you!
MaximLiadov
XCore Addict
Posts: 179
Joined: Mon Apr 16, 2018 9:14 am

Post by MaximLiadov »

del
Last edited by MaximLiadov on Wed Feb 05, 2025 4:43 pm, edited 1 time in total.
danielp
Active Member
Posts: 33
Joined: Tue Jul 16, 2024 9:52 am
Location: Bristol, UK

Post by danielp »

Unfortunately app note AN02019 is very closely tied to sw_usb_audio v9.0.0 as it uses lib_xua v5.0.0 and this release of lib_xua includes significant changes to the DFU implementation.

If you can't upgrade to these latest versions of sw_usb_audio and lib_xua, you will have more success using the DFU documentation from lib_xua v4.1.0 (as a part of sw_usb_audio v8.1.0). This documentation is available here or as source on GitHub

Out of interest, if you are able to share, I'm wondering what hardware incompatibility you have with sw_usb_audio v9.0.0; if you could upgrade that would be the best solution, but I understand that might not be possible. I'm just interested in case it's something I can help with.
XMOS, Senior Software Engineer