Getting Basic USB Audio running on the dev kit

New to XMOS and XCore? Get started here.
ACR_Ovation
Member
Posts: 13
Joined: Mon Feb 26, 2018 3:38 pm

Getting Basic USB Audio running on the dev kit

Postby ACR_Ovation » Mon Mar 05, 2018 1:26 pm

Hello,

My XCORE-200 MC audio board dev kit arrived. I've installed XTIME composer and have been trying to get a basic USB audio setup up and running on the dev kit, however, I am quite lost. I've tried following the instructions in section 5 of The USB Audio design guide. Here's what I did:-
1. In project explorer, I clicked on AN00146_xCORE_XA_usb and then hit build.
2. It displayed the following in the console panel:-

12:19:13 **** Incremental Build of configuration Default for project AN00146_xCORE_XA_usb ****
xmake all
Checking build modules
No build modules used.
Building xCORE binary
Building ARM binary
Build Complete

12:19:26 Build Finished (took 12s.409ms)


3. Then I went to section 5.12 to try to install the application in flash, but I cannot find the XE file anywhere following the injstructions.

Clearly, I am lost here!

Appreciate some pointers - Thank you
User avatar
mon2
XCore Legend
Posts: 1847
Joined: Thu Jun 10, 2010 11:43 am

Postby mon2 » Mon Mar 05, 2018 1:50 pm

Hi. xCORE_XA is an older and believe now EOL XMOS CPU with an ARM processor (licensed from Silabs). Respectively not the correct CPU as a target for your purchased kit.

Please review the hardware manual for your kit which should identify the exact cpu that is onboard your evalboard. Then proceed to change the target CPU inside the make file for your project. This should permit the compiler to recompile correctly for your CPU.

------

Please review this thread:

http://www.xcore.com/viewtopic.php?f=8&t=5598
ACR_Ovation
Member
Posts: 13
Joined: Mon Feb 26, 2018 3:38 pm

Postby ACR_Ovation » Mon Mar 05, 2018 2:19 pm

Thanks - I'll give that a try!
ACR_Ovation
Member
Posts: 13
Joined: Mon Feb 26, 2018 3:38 pm

Postby ACR_Ovation » Thu Mar 08, 2018 7:50 pm

I went back and reset up a new project. I selected the xCORE USB MC audio board in the makefile dialogue. I selected all the library files in the dialogue and then hit the build button. I am still getting two erroes and to be honest nowhere near getting the board up and running. Here is the console output from the build process:-

18:43:50 **** Build of configuration Default for project test6 ****
xmake CONFIG=Default all
Checking build modules
WARNING: Required version of lib_xassert is >=2.0.0 and actual version has greater major version: 3.0.0. There could be API incompatibilities.
Using build modules: lib_gpio(1.1.0) lib_i2s(2.3.0) lib_logging(2.1.0) lib_spdif(2.0.2) lib_usb(3.1.2) lib_xassert(3.0.0)
Analyzing debug_printf.c
Analyzing XUD_GetDone.c
Analyzing XUD_SetCrcTableAddr.c
Analyzing XUD_User.c
Analyzing gpio.xc
Analyzing i2s_dummy_impl.xc
Analyzing device_reboot.xc
C:/Users/Andrew/workspace/lib_usb/src/endpoint0/device_reboot.xc:34:21: error: use of undeclared identifer `usb_tile'
write_periph_32(usb_tile, XS1_SU_PERIPH_USB_ID, XS1_SU_PER_UIFM_FUNC_CONTROL_NUM, 1, data);
^
xmake[1]: *** [.build/_l_usb/src/endpoint0/device_reboot.xc.pca.xml.decouple] Error 1
xmake: *** [analyze] Error 2

18:44:15 Build Finished (took 24s.932ms)

I am assuming that the compiler knows what board I have attached (selected in makefile) and is building with the correct library components.

Appreciate any pointers to get this sorted out.
User avatar
mon2
XCore Legend
Posts: 1847
Joined: Thu Jun 10, 2010 11:43 am

Postby mon2 » Fri Mar 09, 2018 2:28 pm

The XCORE-200 based Audio kit you own is based on the XE216-512-TQ128 CPU.

Please change your makefile to reflect this CPU as the target. This may be your issue. Please post your results.

Disclaimer: Do not own this kit and not an audio developer. From your toolchain, do you see this kit as a target? I could not in my setup.
ACR_Ovation
Member
Posts: 13
Joined: Mon Feb 26, 2018 3:38 pm

Postby ACR_Ovation » Wed Mar 28, 2018 3:11 pm

Hello, back again with more questions.

I've followed the instructions in the USB manual for the xCORE-200 MC DK. I am looking for the basic 2 channel USB+SP/DIF configuration so I selected the app_usb_aud_xk_216_mc file. It compiles up and I then flash it to the DK (seems to take quite a long time BTW).

However, I am getting no output (pair of headphones plugged into any one of the line out sockets). Input from the PC is into the USB socket and I am using the WMP (the xCORE is listed on the PC as the playback device). Any ideas on what I am doing wrong here?

FYI here is a screen dump from the flash process:-

Warning: F03098 Factory image and boot loader cannot be write-protected on flash device on node 0
xflash: Warning: F03148 --quad-spi-clock not given, using default 15.62MHz
xflash: Warning: F03149 QE_REGISTER and/or QE_BIT locations not found in XN file for this flash device. Using default quad_spi_qe_location_status_reg_0 and quad_spi_qe_bit_6.

Site 0 has started.
Site 0 has type 005.
Site 0 write 0x00000000.
Site 0 verified 0x00000000.
Site 0 write 0x00000400.
Site 0 verified 0x00000400.
Site 0 write 0x00000800.
Site 0 verified 0x00000800.
Site 0 write 0x00000c00.
Site 0 verified 0x00000c00.
Site 0 write 0x00001000.
Site 0 verified 0x00001000.
Site 0 write 0x00001400.
Site 0 verified 0x00001400.
Site 0 write 0x00001800.
Site 0 verified 0x00001800.
Site 0 write 0x00001c00.
Site 0 verified 0x00001c00.
Site 0 write 0x00002000.
Site 0 verified 0x00002000.
Site 0 write 0x00002400.
Site 0 verified 0x00002400.
Site 0 write 0x00002800.
Site 0 verified 0x00002800.
Site 0 write 0x00002c00.
Site 0 verified 0x00002c00.
Site 0 write 0x00003000.
Site 0 verified 0x00003000.
Site 0 write 0x00003400.
Site 0 verified 0x00003400.
Site 0 write 0x00003800.
Site 0 verified 0x00003800.
Site 0 write 0x00003c00.
Site 0 verified 0x00003c00.
Site 0 write 0x00004000.
Site 0 verified 0x00004000.
Site 0 write 0x00004400.
Site 0 verified 0x00004400.
Site 0 write 0x00004800.
Site 0 verified 0x00004800.
Site 0 write 0x00004c00.
Site 0 verified 0x00004c00.
Site 0 write 0x00005000.
Site 0 verified 0x00005000.
Site 0 write 0x00005400.
Site 0 verified 0x00005400.
Site 0 write 0x00005800.
Site 0 verified 0x00005800.
Site 0 write 0x00005c00.
Site 0 verified 0x00005c00.
Site 0 write 0x00006000.
Site 0 verified 0x00006000.
Site 0 write 0x00006400.
Site 0 verified 0x00006400.
Site 0 write 0x00006800.
Site 0 verified 0x00006800.
Site 0 write 0x00006c00.
Site 0 verified 0x00006c00.
Site 0 write 0x00007000.
Site 0 verified 0x00007000.
Site 0 write 0x00007400.
Site 0 verified 0x00007400.
Site 0 write 0x00007800.
Site 0 verified 0x00007800.
Site 0 write 0x00007c00.
Site 0 verified 0x00007c00.
Site 0 write 0x00008000.
Site 0 verified 0x00008000.
Site 0 write 0x00008400.
Site 0 verified 0x00008400.
Site 0 write 0x00008800.
Site 0 verified 0x00008800.
Site 0 write 0x00008c00.
Site 0 verified 0x00008c00.
Site 0 write 0x00009000.
Site 0 verified 0x00009000.
Site 0 write 0x00009400.
Site 0 verified 0x00009400.
Site 0 write 0x00009800.
Site 0 verified 0x00009800.
Site 0 write 0x00009c00.
Site 0 verified 0x00009c00.
Site 0 has finished successfully.

here is the Makefile:-


# The TARGET variable determines what target system the application is
# compiled for. It either refers to an XN file in the source directories
# or a valid argument for the --target option when compiling.

TARGET = xk-audio-216-mc.xn
APP_NAME =

# The flags passed to xcc when building the application
BUILD_FLAGS = -DFLASH_MAX_UPGRADE_SIZE=64*1024 -fcomment-asm -Xmapper --map -Xmapper MAPFILE -Wall -O3 -report -lquadflash -fsubword-select -save-temps -g -fxscope -DXSCOPE -DSDA_HIGH=2 -DSCL_HIGH=1 -DXUD_SERIES_SUPPORT=4 -march=xs2a -DUSB_TILE=tile[1] -DADAT_TX_USE_SHARED_BUFF=1 -DQUAD_SPI_FLASH=1

# The USED_MODULES variable lists other module used by the application. These
# modules will extend the SOURCE_DIRS, INCLUDE_DIRS and LIB_DIRS variables.
# Modules are expected to be in the directory above the BASE_DIR directory.
USED_MODULES = module_usb_shared module_xud module_usb_audio module_spdif_tx module_spdif_rx module_usb_midi module_dfu module_usb_device module_i2c_shared module_i2c_single_port module_adat_tx module_adat_rx

# Build config naming scheme:

# Audio Class: 1 or 2
# Input enabled: i (channelcount)
# Output enabled: o (channelcount)
# MIDI enabled: m, disabled: x
# SPDIF out enabled: s, disabled: x
# SPDIF in enabled: s, disabled: x
# ADAT out enabled: a, disabled: x
# ADAT in enabled: a, disabled: x
# DSD out enabled: d, disabled: x
# e.g. 2i10o10xsxxx: Audio class 2.0, input and output enabled (10 channels each), SPDIF output, no SPDIF input, no ADAT

TEST_DFU_1 ?= 0
ifeq ($(TEST_DFU_1),1)
BUILD_FLAGS += -DBCD_DEVICE=0x9901
endif
TEST_DFU_2 ?= 0
ifeq ($(TEST_DFU_2),1)
BUILD_FLAGS += -DBCD_DEVICE=0x9902
endif

MFI ?= 0

ifeq ($(MFI), 0)

# Test build configs (Note these make use of the defaults in customdefines.h)

# Audio Class 2, Input (8), Output (8), No MIDI, No SPDIF i/o, No ADAT i/o, TDM mode
XCC_FLAGS_2i8o8xxxxx_tdm8 = $(BUILD_FLAGS) -DI2S_CHANS_DAC=8 -DI2S_CHANS_ADC=8 -DNUM_USB_CHAN_OUT=8 -DNUM_USB_CHAN_IN=8 \
-DMIDI=0 -DSPDIF_TX=0 -DSPDIF_RX=0 -DADAT_TX=0 -DADAT_RX=0 -DDSD_CHANS_DAC=0 \
-DI2S_MODE_TDM=1 -DMAX_FREQ=96000
INCLUDE_ONLY_IN_2i8o8xxxxx_tdm8 =

# Audio Class 2, Input (8), Output (8), No MIDI, No SPDIF i/o, No ADAT i/o, TDM slave mode
XCC_FLAGS_2i8o8xxxxx_tdm8_slave = $(BUILD_FLAGS) -DI2S_CHANS_DAC=8 -DI2S_CHANS_ADC=8 -DNUM_USB_CHAN_OUT=8 -DNUM_USB_CHAN_IN=8 \
-DMIDI=0 -DSPDIF_TX=0 -DSPDIF_RX=0 -DADAT_TX=0 -DADAT_RX=0 -DDSD_CHANS_DAC=0 \
-DI2S_MODE_TDM=1 -DMAX_FREQ=96000 -DMIXER=0 -DCODEC_MASTER=1
INCLUDE_ONLY_IN_2i8o8xxxxx_tdm8_slave =


# Audio Class 2, Input (0), Output (8), No MIDI, No SPDIF i/o, No ADAT i/o, TDM slave mode
XCC_FLAGS_2i0o8xxxxx_tdm8_slave = $(BUILD_FLAGS) -DI2S_CHANS_DAC=8 -DI2S_CHANS_ADC=0 -DNUM_USB_CHAN_OUT=8 -DNUM_USB_CHAN_IN=0 \
-DMIDI=0 -DSPDIF_TX=0 -DSPDIF_RX=0 -DADAT_TX=0 -DADAT_RX=0 -DDSD_CHANS_DAC=0 \
-DI2S_MODE_TDM=1 -DMAX_FREQ=96000 -DMIXER=0 -DCODEC_MASTER=1
INCLUDE_ONLY_IN_2i0o8xxxxx_tdm8_slave =



# Audio Class 2, Input (16), Output (16), No MIDI, No SPDIF i/o, No ADAT i/o, No DSD, TDM mode
# Note: sample rate restricted to 96K to fit in USB bandwidth
XCC_FLAGS_2i16o16xxxxx_tdm8 = $(BUILD_FLAGS) -DI2S_CHANS_DAC=16 -DI2S_CHANS_ADC=16 -DNUM_USB_CHAN_OUT=16 -DNUM_USB_CHAN_IN=16 \
-DMIDI=0 -DSPDIF_TX=0 -DSPDIF_RX=0 -DADAT_TX=0 -DADAT_RX=0 -DDSD_CHANS_DAC=0 \
-DI2S_MODE_TDM=1 -DMAX_FREQ=96000
INCLUDE_ONLY_IN_2i16o16xxxxx_tdm8 =

# Audio Class 2, Input, Output, No MIDI, No SPDIF Tx, TDM (32in/32out)
XCC_FLAGS_2i32o32xxxxx_tdm8 = $(BUILD_FLAGS) -DSPDIF_TX=0 -DI2S_MODE_TDM=1 -DI2S_CHANS_ADC=32 -DMAX_FREQ=48000 -DI2S_CHANS_DAC=32 -DNUM_USB_CHAN_OUT=32 -DNUM_USB_CHAN_IN=32
INCLUDE_ONLY_IN_2i32o32xxxxx_tdm8 =

# Audio Class 2, Input, Output, No MIDI, SPDIF, TDM (32in/32out)
XCC_FLAGS_2i32o32xsxxx_tdm8 = $(BUILD_FLAGS) -DSPDIF_TX=1 -DI2S_MODE_TDM=1 -DI2S_CHANS_ADC=32 -DMAX_FREQ=48000 -DI2S_CHANS_DAC=32 -DNUM_USB_CHAN_OUT=32 -DNUM_USB_CHAN_IN=32
INCLUDE_ONLY_IN_2i32o32xsxxx_tdm8 =

# Audio Class 2, Input, Output, MIDI, SPDIF
XCC_FLAGS_2i10o10msxxxx = $(BUILD_FLAGS) -DMIDI=1 -DSPDIF_TX=1
INCLUDE_ONLY_IN_2i10o10msxxxx =

# Audio Class 2, Input, Output, MIDI, SPDIF, DSD
XCC_FLAGS_2i10o10xxxxxd = $(BUILD_FLAGS) -DMIDI=0 -DSPDIF_TX=0 -DDSD_CHANS_DAC=2
INCLUDE_ONLY_IN_2i10o10xxxxxd =

# Audio Class 2, Input, Output, no MIDI, no SPDIF
XCC_FLAGS_2i10o10xxxxxx = $(BUILD_FLAGS) -DMIDI=0 -DSPDIF_TX=0
INCLUDE_ONLY_IN_2i10o10xxxxxx =

# Audio Class 2, Input, Output, no MIDI, no SPDIF
XCC_FLAGS_2i10o10xxxxxx_slave = $(BUILD_FLAGS) -DMIDI=0 -DSPDIF_TX=0 -DCODEC_MASTER=1
INCLUDE_ONLY_IN_2i10o10xxxxxx_slave =

# Audio Class 2, Input, Output, no MIDI, SPDIF
XCC_FLAGS_2i10o10xsxxxx = $(BUILD_FLAGS) -DMIDI=0 -DSPDIF_TX=1
INCLUDE_ONLY_IN_2i10o10xsxxxx =

# Audio Class 2, Input, Output, no MIDI, SPDIF
XCC_FLAGS_2i10o10xsxxxx_mix8 = $(BUILD_FLAGS) -DMIDI=0 -DSPDIF_TX=1 -DMAX_MIX_COUNT=8
INCLUDE_ONLY_IN_2i10o10xsxxxx_mix8 =

# Audio Class 2, Input, Output, No Midi, SPDIF, DSD
XCC_FLAGS_2i10o10xsxxxd = $(BUILD_FLAGS) -DSPDIF_TX=1 -DDSD_CHANS_DAC=2
INCLUDE_ONLY_IN_2i10o10xsxxxd =

# Audio Class 2, 10 Input, 16 Output, no MIDI, no SPDIF tx, no SPDIF Rx, ADAT tx, no ADAT rx, no DSD
XCC_FLAGS_2i10o16xxxaxx = $(BUILD_FLAGS) -DSPDIF_TX=0 -DMIDI=0 -DADAT_TX=1 -DMAX_FREQ=96000 -DNUM_USB_CHAN_OUT=16
INCLUDE_ONLY_IN_2i10o16xxxaxx =

# Audio Class 2, 16 Input, 10 Output, no MIDI, no SPDIF tx, no SPDIF Rx, ADAT tx, ADAT rx, no DSD
# Sample rate restriced to 96kHz fit in USB bandwidth
XCC_FLAGS_2i16o16xxxaax = $(BUILD_FLAGS) -DSPDIF_TX=0 -DMIDI=0 -DADAT_RX=1 -DADAT_TX=1 -DMAX_FREQ=96000 -DNUM_USB_CHAN_OUT=16 -DNUM_USB_CHAN_IN=16
INCLUDE_ONLY_IN_2i16o16xxxaax =

# Audio Class 2, Input, Output, No MIDI, SPDIF out, SPDIF in
XCC_FLAGS_2i10o10xssxxx = $(BUILD_FLAGS) -DSPDIF_RX=1
INCLUDE_ONLY_IN_2i10o10xssxxx =

# Audio Class 1, 2 channels Input, 2 channels Output, no MIDI, no SPDIF
XCC_FLAGS_1i2o2xxxxxx = $(BUILD_FLAGS) -DAUDIO_CLASS=1
INCLUDE_ONLY_IN_1i2o2xxxxxx =

# Audio Class 1, 8 channels Input, 2 channels Output, no MIDI, no SPDIF
XCC_FLAGS_1i8o2xxxxxx = $(BUILD_FLAGS) -DAUDIO_CLASS=1 -DNUM_USB_CHAN_IN_FS=6 -DMAX_FREQ_FS=44100 -DSTREAM_FORMAT_INPUT_1_RESOLUTION_BITS=16
INCLUDE_ONLY_IN_1i8o2xxxxxx =

ifeq ($(TEST_CONFIGS),1)
XCC_FLAGS_upgrade1 = $(BUILD_FLAGS) -DBCD_DEVICE_J=0x99 -DBCD_DEVICE_M=0x0 -DBCD_DEVICE_N=0x1
XCC_FLAGS_upgrade2 = $(BUILD_FLAGS) -DBCD_DEVICE_J=0x99 -DBCD_DEVICE_M=0x0 -DBCD_DEVICE_N=0x2
endif

else

# MFi test build configs - iAP support enabled

# # Audio Class 2, iAP enabled, Input, Output, No MIDI, SPDIF Tx
XCC_FLAGS_2i10o10xsxxxx_mfi = $(BUILD_FLAGS) -DIAP=1 -DSPDIF_TX=1 -DMIDI=0
INCLUDE_ONLY_IN_2i10o10xsxxxx_mfi =

# # Audio Class 2, iAP enabled, No Input, Output, No MIDI, SPDIF Tx, DSD
XCC_FLAGS_20i10oxsxxxxd_mfi = $(BUILD_FLAGS) -DIAP=1 -DSPDIF_TX=1 -DMIDI=0 -DDSD_CHANS_DAC=2
INCLUDE_ONLY_IN_20i10oxsxxxxd_mfi =

#Audio Class 2, iAP enabled, EA Protocol (Native Transport), Input, Output, No MIDI, No SPDIF Tx. i
# Hid controls disabled (buttons used for EA)
# XCC_FLAGS_210i10oxxxxx_mfi_n = $(BUILD_FLAGS) -DIAP=1 -DIAP_EA_NATIVE_TRANS=1 -DMIDI=0 -DSPDIF_TX=0 -DHID_CONTROLS=0
# INCLUDE_ONLY_IN_210i10oxxxxx_mfi_n =

#Audio Class 2, iAP enabled, Input, Output, No, No SPDIF Tx. Select USB A port. Ignore VBUS.
#Note, this is the config used for Apple role-switch
XCC_FLAGS_2ioxx_usba_mfi = $(BUILD_FLAGS) -DIAP=1 -DMIDI=0 -DSPDIF_TX=0 -DUSB_SEL_A=1 -DXUD_PWR_CFG=0
INCLUDE_ONLY_IN_2ioxx_usba_mfi =

include mfi.mk

endif


MODULE_LIBRARIES = xud_x200

#=============================================================================
# The following part of the Makefile includes the common build infrastructure
# for compiling XMOS applications. You should not need to edit below here.

XMOS_MAKE_PATH ?= ../..
include $(XMOS_MAKE_PATH)/xcommon/module_xcommon/build/Makefile.common
ACR_Ovation
Member
Posts: 13
Joined: Mon Feb 26, 2018 3:38 pm

Postby ACR_Ovation » Thu Mar 29, 2018 5:40 pm

I've been doing more sleuthing this afternoon. W10 recognizes the xCore USB DK when I attach it and I can select or deselect it from the control panel sound icon. However, the Thescon driver control panel is indicating that nothing is connected.
ACR_Ovation
Member
Posts: 13
Joined: Mon Feb 26, 2018 3:38 pm

Postby ACR_Ovation » Fri Mar 30, 2018 3:42 pm

Success! Audio playing correctly through the DK board.
Problem was with what I had loaded in the flash writer.

Who is online

Users browsing this forum: No registered users and 3 guests