Build error USB Audio Reference Design

Technical questions regarding the XTC tools and programming with XMOS.
niektb
Member++
Posts: 28
Joined: Tue Mar 26, 2019 8:38 am

Post by niektb »

akp wrote: Fri Dec 13, 2019 12:50 pm Hi, I assume you can compile the reference design OK? The XUF chips are just multi-chip modules I am pretty sure. So they have an embedded ISSI flash or something. I doubt the flash is even on the same die as the XMOS MCU (because then the MCU would probably have been fabbed in a flash process rather than logic or SRAM process I suppose). All that is to say is that if your target file is OK then it really shouldn't make a difference.
You mean the example applications? They compile fine indeed
User avatar
akp
XCore Expert
Posts: 580
Joined: Thu Nov 26, 2015 11:47 pm

Post by akp »

Try adding this to your BUILD_FLAGS
-DQUAD_SPI_FLASH=1
niektb
Member++
Posts: 28
Joined: Tue Mar 26, 2019 8:38 am

Post by niektb »

akp wrote: Fri Dec 13, 2019 7:42 pm Try adding this to your BUILD_FLAGS
-DQUAD_SPI_FLASH=1
You mean before or after I changed -lquadflash into -lflash?
User avatar
akp
XCore Expert
Posts: 580
Joined: Thu Nov 26, 2015 11:47 pm

Post by akp »

I would keep -lquadflash -- the XUF208 has a quadspi interface to the embedded flash. I have always used -lquadflash with the XEF/XUF parts.
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am

Post by mon2 »

Hi. Further to @akp posts and to clarify:

1) XMOS CPU devices can be made to boot from standard SPI flash devices (slower) or QSPI mode flash device (faster). The datasheet for the respective flash and the XMOS CPU offer the timing of each interface. In the case of the XMOS CPU datasheet, the pin strappings define the boot modes.

2) The original post had some compilation errors which are due to the confusion of SPI vs. QSPI mode use by the applied code. If the parameter during compilation is passed for standard SPI flash, the error will be resolved. That was the case when we tested your project last week.

3) The target project is keyed to make use of QSPI mode and it will be best for you to follow the thread here (same as before):

https://www.xcore.com/viewtopic.php?f=37&t=6375

which should meet your requirements. This thread details the procedure to use the XMOS Audio IP with a QSPI flash device to build audio widgets. The flash inside the XUF series is a licensed flash from ISSI. This flash offers a QE (QUAD ENABLE) bit which if I recall from memory correctly (pun intended), the flash tool will enable this QE bit automatically for the QSPI mode.

Suggest to place a simple LED on your project so that you can debug / test a quick blinky project to confirm that this flashing LED IP is able to boot from the QSPI flash. Once this boot from flash is confirmed, move on to your full fledged audio IP. Too many moving parts on first power up always wastes too many brain cells...at least for us :)
niektb
Member++
Posts: 28
Joined: Tue Mar 26, 2019 8:38 am

Post by niektb »

so I finally seem to be able to build and run the project with the link you provided (yay!) and it also shows up on my computer as audio device! However, I can't get any sound from it just yet (as in, no i2s data is being sent over these ports) :(. So it does show up as audio device but f.e. Spotify gives the error that it can't play the song over that device.

I wondered if it might have to do something with the unconnected pins warning?
► Show Spoiler
Relevant portion in my XN file:
► Show Spoiler

Also, when I disable DFU in custom_defines.h I get the following error at runtime:
► Show Spoiler
niektb
Member++
Posts: 28
Joined: Tue Mar 26, 2019 8:38 am

Post by niektb »

Okay found it! Apparently it's a bad idea to start a task in the AudioHWInit function... Do you have a recommendation on how to do that? (should I modify the usb main function?)
User avatar
masaikemlol
Member
Posts: 8
Joined: Thu Jul 18, 2024 4:10 am

Post by masaikemlol »

I encountered the same error as you when following the AN01027 document. I found a possible solution: you just need to add -DQUAD_SPI_FLASH=1 to the BUILD_FLAGS line in the Makefile, next to -lquadflash.

like this

Code: Select all

# The flags passed to xcc when building the application
BUILD_FLAGS = -DFLASH_MAX_UPGRADE_SIZE=64*1024 -DQUAD_SPI_FLASH=1 -lquadflash -fcomment-asm -Xmapper --map -Xmapper MAPFILE -Wall -O3 -report -fsubword-select -save-temps -g -fxscope -DXSCOPE -DSDA_HIGH=2 -DSCL_HIGH=1 -DXUD_SERIES_SUPPORT=4 -march=xs2a -DUSB_TILE=tile[0] -DADAT_TX_USE_SHARED_BUFF=1 -DU208_ONLY
build info (This time the build succeeded with no errors, only warnings)

Code: Select all

Creating app_usb_aud_custom_XU208_HW.xe
Constraint check for tile[0]:
  Cores available:            8,   used:          8 .  OKAY
  Timers available:          10,   used:         10 .  OKAY
  Chanends available:        32,   used:         26 .  OKAY
  Memory available:       131072,   used:      55684 .  OKAY
    (Stack: 3692, Code: 37420, Data: 14572)
Constraints checks PASSED.
gpio_access.c: Warning: Undefined reference to 'p_gpio'
xmap: Warning: More than 6 cores used on a tile. Ensure this is not the case on tile running XUD.
xmap: Warning: port "XS1_PORT_1F" on tile[0] is not connected to any pins in this package.
xmap: Warning: port "XS1_PORT_1G" on tile[0] is not connected to any pins in this package.
xmap: Warning: port "XS1_PORT_1E" on tile[0] is not connected to any pins in this package.
xmap: Warning: port "XS1_PORT_1H" on tile[0] is not connected to any pins in this package.
xmap: Warning: port "XS1_PORT_1J" on tile[0] is not connected to any pins in this package.
xmap: Warning: port "XS1_PORT_1K" on tile[0] is not connected to any pins in this package.
xmap: Warning: port "XS1_PORT_1I" on tile[0] is not connected to any pins in this package.
xmap: Warning: port "XS1_PORT_4A" on tile[0] is not connected to any pins in this package.
Build Complete