Why aren't my compile options working?

New to XMOS and XCore? Get started here.
Wavelength
Member
Posts: 9
Joined: Mon Sep 24, 2018 9:56 pm

Why aren't my compile options working?

Postby Wavelength » Sun Sep 30, 2018 8:29 pm

All,

Yes I already asked this, but I have to wait for someone to approve it.

So my app is crashing mainly I think because my local source code is doing one thing and then all the module_usb_audio is doing something else.

So all the source code in module_usb_audio includes devicedefines.h which then includes customdefines.h which has the following simple define:

#define AUDIO_CLASS 2

Yet in main.xc this is code is set to #else, ie the class 2 code is greyed out:

#if (AUDIO_CLASS==2)
XUD_Manager(c_xud_out, ENDPOINT_COUNT_OUT, c_xud_in, ENDPOINT_COUNT_IN,
c_sof, epTypeTableOut, epTypeTableIn, p_usb_rst,
clk, 1, XUD_SPEED_HS, XUD_PWR_CFG);
#else
XUD_Manager(c_xud_out, ENDPOINT_COUNT_OUT, c_xud_in, ENDPOINT_COUNT_IN,
c_sof, epTypeTableOut, epTypeTableIn, p_usb_rst,
clk, 1, XUD_SPEED_FS, XUD_PWR_CFG);
#endif

Image
~~~

So this is a simple no DSD, Class 2, DAC only on an XU208.

In the makefile and in the customdefines is this statement:

#ifndef I2S_CHANS_DAC
#define I2S_CHANS_DAC (2)
#endif

and....

XCC_FLAGS = $(BUILD_FLAGS) -DI2S_CHANS_DAC=2 -DI2S_CHANS_ADC=0 -DNUM_USB_CHAN_OUT=2 -DNUM_USB_CHAN_IN=0 -DMIDI=0 -DSPDIF_TX=0 -DSPDIF_RX=0 -DADAT_TX=0 -DADAT_RX=0 -DDSD_CHANS_DAC=0 -DAUDIO_CLASS=2

Yet in endpoint0.xc all the channels in and out are greyed out.

I have done cleans and still they are greyed out.

~~~

Also in the past I was able to do some IO before we started paralleling the threads (yes threads they are not cores, unless you are using a 16 or 32 device which have 2 and 4 cores). The TC complains when I try and do any IO before the par threading. I kind of need to do a few things before letting the USB go and other threads. Any suggestions?

Thanks in a real bind any help would be appreciated.
Gordon
User avatar
george
New User
Posts: 2
Joined: Thu Aug 24, 2017 12:02 pm

Postby george » Wed Oct 03, 2018 9:38 am

I'd make a guess that the syntax highlighting is not aware of the Makefile.
If you add a #warning, you will be able to see which option is used when compiling.

Code: Select all

#if (AUDIO_CLASS==2)
#warning "AUDIO_CLASS is 2"
    XUD_Manager(c_xud_out, ENDPOINT_COUNT_OUT, c_xud_in, ENDPOINT_COUNT_IN,
        c_sof, epTypeTableOut, epTypeTableIn, p_usb_rst,
        clk, 1, XUD_SPEED_HS, XUD_PWR_CFG);
#else
#warning "AUDIO_CLASS is not 2"
    XUD_Manager(c_xud_out, ENDPOINT_COUNT_OUT, c_xud_in, ENDPOINT_COUNT_IN,
        c_sof, epTypeTableOut, epTypeTableIn, p_usb_rst,
        clk, 1, XUD_SPEED_FS, XUD_PWR_CFG);
#endif


When compiling, you should then see in the output, something along the lines of...

Code: Select all

Analyzing main.xc
../src/main.xc:xx:x: warning: "AUDIO_CLASS is 2"
#warning "AUDIO_CLASS is 2"
 ^
osch
Member
Posts: 12
Joined: Sun Sep 03, 2017 10:12 pm

Postby osch » Thu Oct 04, 2018 1:53 pm

What george said is correct. You cannot trust xTimeComposer highlighting.
Wavelength
Member
Posts: 9
Joined: Mon Sep 24, 2018 9:56 pm

Postby Wavelength » Tue Oct 09, 2018 5:01 pm

All,

I did six passes at the app note AN1027 on 3 different computers and have various problems crashes, etc... I don't think taking the XU216 source code and creating a XU208 is appropriate and this was a waste of about 3 weeks.

On the other hand the thread and source code from the XU208 thread here created stable code working on my hardware in less than 4 hours.

I understand now the highlighting, this did work in XDE, but then again the source tree was not span over tons of external folders and was all included in one place.

Thanks,
Gordon

Who is online

Users browsing this forum: No registered users and 10 guests