Migrating from XHRA to XU208
Posted: Fri Jan 26, 2018 11:14 am
With the obsolescence of the the XHRA USB Audio device https://www.xmos.com/download/private/X ... 281%29.pdf we wanted to offer a migration path.
If you use the XU208-128-TQ64-C10 device you will be able to produce a PIN COMPATIBLE replacement for the XHRA-2HPA-TQ64-C. This means it is possible to migrate to an XU208 device without making hardware changes to your XHRA system, although there will be some software work to do.
This post offers an example project which is designed to run on the XK-USB-AUDIO-HPA evaluation board https://www.xmos.com/support/boards?product=18340. Ie. if you remove the HXRA device from this board and replace it with an XU208 with this project in the SPI FLASH, it will function as a working headphone Amp.
Please note that the XU208 based solution will require you to download the Usb Audio Reference design https://www.xmos.com/support/software/uac2 and make modifications in the source to port it to your hardware. This normally involves modifying:
- customdefines.h (high level setting such as channel count, feature toggling (SPDIF, MIDI, HID, DFU etc..), supported sample rates/depths and PID/VID)
- audiohw.xc (audio hardware setup including DAC, clocks, LEDs etc.)
- xhra_xcore.xn (This is the xcore system description file for the project where you define audio signal pinout and FLASH specification) files, and sometimes:
- audiostream.xc & hostactive.xc if you wish to indicate when streams start/stop and when the USB host is active
The reference design documentation provides further details on the above - see section 5.6
Clearly you must ensure that the binary you compile for the XU208 is fully correct before flashing the QSPI device. It is possible to connect an XTAG debug adapter to the XHRA hardware using TP6..9 on the board which correspond to pins 60..63 on the device which are TMS, TCK, TDI and TDO. You will also need to connect to RST_N (TP10) to the XTAG. This way you can download and debug your app and even flash into the attached QSPI device. This is by far the most convenient way to develop and gives good debug visibility. You can do the same for your own hardware. See section H of the XU208 datasheet for more details of providing debug connections. http://www.xmos.com/download/private/XU ... t(1.9).pdf
Features of the attached project:
- USB Audio 2.0 (USB Audio class 1.0 fallback disabled)
- 44.1 - 384kHz Sample rates
- 32b PCM data
- DoP Support for 64x and 128x
- DSD Native support for 64x, 128x and 256x
- Uses ESS9018 DAC and SI5351A frequency generator as per XHRA hardware
- SPDIF Tx (up to 192kHz @ 24b)
- DFU Enabled
- VID/PID = 0x20B1/0x3066 (as per XHRA)
- Based on audio reference design 6.15.2rc2
- Includes DSD fix for the above release (see thread http://www.xcore.com/viewtopic.php?t=5010)
- It's C source so you can add a lot more functionality over the XHRA if you choose and integrate other MCU style features
Instructions for use:
- Download and unzip this source package
- Copy over the top of a fresh 6.15.1rc2 (latest released version) reference design download. Note you will need to copy into the root of the reference design project so that the sw_usb_audio and sc_usb_audio subdirectories are correctly overlaid. Download from here https://www.xmos.com/support/software/uac2
- Make sure you have a copy of the XMOS tools. We used 14.3.2 to test this. Download from here https://www.xmos.com/support/tools where you can also find links to user guides and programming docs
- Build the app_usb_aud_xu208_xhra project. Please see usual documentation for doing this:
https://www.xmos.com/download/private/s ... ha1%29.pdf
- Download to your XU208 or program the flash. To make a raw binary file suitable for programming a SPI FLASH, you can use xflash -o app_usb_aud_xu208.bin --noinq --boot-partition-size 2097152 bin/app_usb_aud_xu208_xhra.xe. Note that the boot partition size has been set to the whole flash device, in this case, a 16Mb IS25LQ016B. The boot partition has the bootloader, factory image and upgrade image in it. Please consult the tools documentation for more info on this.
Please note that this project is supplied 'as is', outside of the official release channels, without support or any warranty. It does work however and has undergone basic testing and is based on the reference design which is being used in hundreds of commercial products. The intention of supplying this is to make the transition from XHRA to XU208 as easier but please accept that you will be responsible for the source customisation to your own hardware.
[Edit 5th March 2018]
I have re-uploaded the source with eclipse (xtimecomposer GUI) project files. This means you can now do a simple import instead of file->"new xtimecomposer project based on existing application"
If you use the XU208-128-TQ64-C10 device you will be able to produce a PIN COMPATIBLE replacement for the XHRA-2HPA-TQ64-C. This means it is possible to migrate to an XU208 device without making hardware changes to your XHRA system, although there will be some software work to do.
This post offers an example project which is designed to run on the XK-USB-AUDIO-HPA evaluation board https://www.xmos.com/support/boards?product=18340. Ie. if you remove the HXRA device from this board and replace it with an XU208 with this project in the SPI FLASH, it will function as a working headphone Amp.
Please note that the XU208 based solution will require you to download the Usb Audio Reference design https://www.xmos.com/support/software/uac2 and make modifications in the source to port it to your hardware. This normally involves modifying:
- customdefines.h (high level setting such as channel count, feature toggling (SPDIF, MIDI, HID, DFU etc..), supported sample rates/depths and PID/VID)
- audiohw.xc (audio hardware setup including DAC, clocks, LEDs etc.)
- xhra_xcore.xn (This is the xcore system description file for the project where you define audio signal pinout and FLASH specification) files, and sometimes:
- audiostream.xc & hostactive.xc if you wish to indicate when streams start/stop and when the USB host is active
The reference design documentation provides further details on the above - see section 5.6
Clearly you must ensure that the binary you compile for the XU208 is fully correct before flashing the QSPI device. It is possible to connect an XTAG debug adapter to the XHRA hardware using TP6..9 on the board which correspond to pins 60..63 on the device which are TMS, TCK, TDI and TDO. You will also need to connect to RST_N (TP10) to the XTAG. This way you can download and debug your app and even flash into the attached QSPI device. This is by far the most convenient way to develop and gives good debug visibility. You can do the same for your own hardware. See section H of the XU208 datasheet for more details of providing debug connections. http://www.xmos.com/download/private/XU ... t(1.9).pdf
Features of the attached project:
- USB Audio 2.0 (USB Audio class 1.0 fallback disabled)
- 44.1 - 384kHz Sample rates
- 32b PCM data
- DoP Support for 64x and 128x
- DSD Native support for 64x, 128x and 256x
- Uses ESS9018 DAC and SI5351A frequency generator as per XHRA hardware
- SPDIF Tx (up to 192kHz @ 24b)
- DFU Enabled
- VID/PID = 0x20B1/0x3066 (as per XHRA)
- Based on audio reference design 6.15.2rc2
- Includes DSD fix for the above release (see thread http://www.xcore.com/viewtopic.php?t=5010)
- It's C source so you can add a lot more functionality over the XHRA if you choose and integrate other MCU style features
Instructions for use:
- Download and unzip this source package
- Copy over the top of a fresh 6.15.1rc2 (latest released version) reference design download. Note you will need to copy into the root of the reference design project so that the sw_usb_audio and sc_usb_audio subdirectories are correctly overlaid. Download from here https://www.xmos.com/support/software/uac2
- Make sure you have a copy of the XMOS tools. We used 14.3.2 to test this. Download from here https://www.xmos.com/support/tools where you can also find links to user guides and programming docs
- Build the app_usb_aud_xu208_xhra project. Please see usual documentation for doing this:
https://www.xmos.com/download/private/s ... ha1%29.pdf
- Download to your XU208 or program the flash. To make a raw binary file suitable for programming a SPI FLASH, you can use xflash -o app_usb_aud_xu208.bin --noinq --boot-partition-size 2097152 bin/app_usb_aud_xu208_xhra.xe. Note that the boot partition size has been set to the whole flash device, in this case, a 16Mb IS25LQ016B. The boot partition has the bootloader, factory image and upgrade image in it. Please consult the tools documentation for more info on this.
Please note that this project is supplied 'as is', outside of the official release channels, without support or any warranty. It does work however and has undergone basic testing and is based on the reference design which is being used in hundreds of commercial products. The intention of supplying this is to make the transition from XHRA to XU208 as easier but please accept that you will be responsible for the source customisation to your own hardware.
[Edit 5th March 2018]
I have re-uploaded the source with eclipse (xtimecomposer GUI) project files. This means you can now do a simple import instead of file->"new xtimecomposer project based on existing application"