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

Build error USB Audio Reference Design

Post by niektb »

Hello all! I'm trying to port the USB Audio 2.0 Reference Software to my custom hardware (using this guide: https://www.xmos.com/download/AN01027:- ... .0rc1).pdf)
I followed all the steps but I still get a build error when building the project:

Code: Select all

Creating smartDAC_USB_proto.xe
quadflashlib.c: Error: Type of symbol `fl_connect' has mismatch with previous definition:
     found: `signed int fl_connect(struct { unsigned int qspiCS; unsigned int qspiSCLK; unsigned int qspiSIO; unsigned int qspiClkblk; } *)' in file `quadflashlib.c'
  previous: `signed int fl_connect(struct { unsigned int spiMISO; unsigned int spiSS; unsigned int spiCLK; unsigned int spiMOSI; unsigned int spiClkblk; } *)' in file `flashlib_user.c'
xmake[1]: *** [bin//smartDAC_USB_proto.xe] Error 1
xmake: *** [bin//smartDAC_USB_proto.xe] Error 2
Anybody got an idea on how to fix this? My full project can be found here: https://gitlab.com/software-ontwikkelin ... _USB_proto
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am

Post by mon2 »

Hi. Locate the file quadflashlib.c and comment out the routine fl_connect -> save the file and build again. Post your results.
niektb
Member++
Posts: 28
Joined: Tue Mar 26, 2019 8:38 am

Post by niektb »

well, tried finding it but it doesn't actually exist on my system... Only a quadflashlib.h exists in C:\Program Files (x86)\XMOS\xTIMEcomposer\Community_14.3.3\target\include
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am

Post by mon2 »

Your makefile is making references to code that is raising the error.

Proceed to trace through the names inside the makefile.
niektb
Member++
Posts: 28
Joined: Tue Mar 26, 2019 8:38 am

Post by niektb »

Not sure what you ask me to do, do you mean that I should find which build flag causes the error?

if I remove -lquadflash from the build flags then I get:

Code: Select all

Creating smartDAC_USB_proto.xe
flashlib_user.c: Error: Undefined reference to 'fl_connect'
flash_interface.c: Error: Undefined reference to 'fl_deleteImage'
flashlib_user.c: Error: Undefined reference to 'fl_disconnect'
flash_interface.c: Error: Undefined reference to 'fl_endWriteImage'
flash_interface.c: Error: Undefined reference to 'fl_getFactoryImage'
flash_interface.c: Error: Undefined reference to 'fl_getNextBootImage'
flash_interface.c: Error: Undefined reference to 'fl_readImagePage'
flash_interface.c: Error: Undefined reference to 'fl_setProtection'
flash_interface.c: Error: Undefined reference to 'fl_startImageAdd'
flash_interface.c: Error: Undefined reference to 'fl_startImageRead'
flash_interface.c: Error: Undefined reference to 'fl_writeImagePage'
xmake[1]: *** [bin//smartDAC_USB_proto.xe] Error 1
xmake: *** [bin//smartDAC_USB_proto.xe] Error 2
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am

Post by mon2 »

Hi. Your project is importing in many other XMOS supplied code. Inside this project, there appears to be a mismatch of the declaration of fl_connect().

Search inside your project file folder for

quadflashlib.c

and

flashlib_user.c (review this one and comment out the fl_connect routine and then cut and paste the routine from quadflashlib.c here)


and you should be able to locate the offending declaration.

Then proceed to comment out that code block (for starters) and attempt to compile again. From my quick view, believe that you have multiple references to this routine and the declarations do not match so the compiler is raising an error.

Code: Select all

Creating smartDAC_USB_proto.xe
quadflashlib.c: Error: Type of symbol `fl_connect' has mismatch with previous definition:
     found: `signed int fl_connect(struct { unsigned int qspiCS; unsigned int qspiSCLK; unsigned int qspiSIO; unsigned int qspiClkblk; } *)' in file `quadflashlib.c'
  previous: `signed int fl_connect(struct { unsigned int spiMISO; unsigned int spiSS; unsigned int spiCLK; unsigned int spiMOSI; unsigned int spiClkblk; } *)' in file `flashlib_user.c'
xmake[1]: *** [bin//smartDAC_USB_proto.xe] Error 1
xmake: *** [bin//smartDAC_USB_proto.xe] Error 2
So from above, the source code files to review are:

quadflashlib.c

and

flashlib_user.c


Post your results.
niektb
Member++
Posts: 28
Joined: Tue Mar 26, 2019 8:38 am

Post by niektb »

I can't just bypass the whole DFU flash thingie? (cos I don't need it anyways)

like i mentioned before, I searched my entire system but quadflashlib.c doesn't exist at all...

edit: and when i comment the calls to fl_connect in flashlib_user.c I get the error:

Code: Select all

flash_interface.c: Error: Undefined reference to 'fl_setProtection'
edit: can comment out fl_setProtection call as well, then I get:

Code: Select all

Creating smartDAC_USB_proto.xe
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.
Constraint check for tile[0]:
  Cores available:            8,   used:          9 .  FAILED
  Timers available:          10,   used:         11 .  FAILED
  Chanends available:        32,   used:         26 .  OKAY
  Memory available:       262144,   used:      43580 .  OKAY
    (Stack: 3452, Code: 28888, Data: 11240)
Error: Constraints check FAILED for tile[0].
niektb
Member++
Posts: 28
Joined: Tue Mar 26, 2019 8:38 am

Post by niektb »

Tried downgrading to an older version of xTimeComposer (14.1.2 I believe) but that didn't make a difference either :/
niektb
Member++
Posts: 28
Joined: Tue Mar 26, 2019 8:38 am

Post by niektb »

Am I the only one experiencing the issue?
niektb
Member++
Posts: 28
Joined: Tue Mar 26, 2019 8:38 am

Post by niektb »

i must be doin' something stupid right? i keep trying to start from scratch and every time I get stuck at build errors with the flash. Is it because the guide i followed isn't suited for XUF chips? (so with built-in flash?)