Page 1 of 3

Build error USB Audio Reference Design

Posted: Sat Nov 09, 2019 12:50 pm
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

Re: Build error USB Audio Reference Design

Posted: Sat Nov 09, 2019 2:23 pm
by mon2
Hi. Locate the file quadflashlib.c and comment out the routine fl_connect -> save the file and build again. Post your results.

Re: Build error USB Audio Reference Design

Posted: Thu Nov 14, 2019 10:57 am
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

Re: Build error USB Audio Reference Design

Posted: Thu Nov 14, 2019 1:42 pm
by mon2
Your makefile is making references to code that is raising the error.

Proceed to trace through the names inside the makefile.

Re: Build error USB Audio Reference Design

Posted: Thu Nov 14, 2019 1:55 pm
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

Re: Build error USB Audio Reference Design

Posted: Thu Nov 14, 2019 2:41 pm
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.

Re: Build error USB Audio Reference Design

Posted: Fri Nov 15, 2019 4:51 pm
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].

Re: Build error USB Audio Reference Design

Posted: Wed Nov 20, 2019 1:09 pm
by niektb
Tried downgrading to an older version of xTimeComposer (14.1.2 I believe) but that didn't make a difference either :/

Re: Build error USB Audio Reference Design

Posted: Sat Nov 30, 2019 1:29 pm
by niektb
Am I the only one experiencing the issue?

Re: Build error USB Audio Reference Design

Posted: Sat Dec 07, 2019 10:45 am
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?)