SU1_ADC_ENABLE=1 build error Topic is solved

If you have a simple question and just want an answer.
User avatar
bowerymarc
Active Member
Posts: 40
Joined: Mon Dec 30, 2013 7:29 am

SU1_ADC_ENABLE=1 build error

Post by bowerymarc »

I'm trying to compile app_usb_aud_skc_u16_audio8 with target 2io_spdifin_spdifout and enabling the ADC (#define SU1_ADC_ENABLE=1 in customdefines.h) and get this compilation error:

Code: Select all

Compiling audio.xc
sw_usb_audio-[sw]_6.15.2rc1/sc_usb_audio/module_usb_audio/audio.xc:987:25: error: use of undeclared identifer `xs1_su'
    r = write_periph_32(xs1_su, 2, 0x20, 1, data);
                        ^~~~~~
I searched the entire sw_usb_audio-[sw]_6.15.2rc1 directory and couldn't find any file defining xs1_su, so it seems a bug? If so what should I change it to to get the ADC to function?


View Solution
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am

Post by infiniteimprobability »

Hi - support for the xs1-u series ADC will been taken out of the reference design from version 6.16, I think because it did have bugs and most new designs are xcore-200.

However, to address your question
r = write_periph_32(xs1_su, 2, 0x20, 1, data);
the first argument is the tile reference (see xs1.h fro the prototype). This is defined in the xn file:
<Declarations>
<Declaration>tileref tile[2]</Declaration>
<Declaration>tileref usb_tile</Declaration>
</Declarations>
so try using the tileref that is in your xn file.
User avatar
bowerymarc
Active Member
Posts: 40
Joined: Mon Dec 30, 2013 7:29 am

Post by bowerymarc »

bugs? is there an errata? does the ADC work because I'm planning to use it.

I checked xp_skc_u16-audio8.xn and see that the adc service is initialized on 'usb_tile' so I think that's what should be in there. Please verify, I think it's a bug.

Apparently there aren't regression tests done before release, for example stepping through all valid builds and defines to insure error-free compilations.

As long as xmos continues to sell the XS1, I expect it to be supported, including bug fixes and forum support. I don't want to hear 'you should have used this newer chip'. The whole point of DFU is to support ongoing development and innovation.

thanks,
Marc
User avatar
larry
Respected Member
Posts: 275
Joined: Fri Mar 12, 2010 6:03 pm

Post by larry »

To build with SU1_ADC_ENABLE, use usb_tile as tileref in write_periph_32 (instead of xs1_su) and move xs1_su_adc_service inside the top level par in main.xc (currently it is outside).

I have submitted these as a bug report.

I believe all configurations are build tested (e.g. 2ioxx as listed in makefiles of individual apps), but not all options in customdefines. There are too many combinations. It sounds like SU1_ADC_ENABLE could be another config, e.g. "2ioxx_adc".
User avatar
bowerymarc
Active Member
Posts: 40
Joined: Mon Dec 30, 2013 7:29 am

Post by bowerymarc »

Thanks - I wouldn't have caught moving that statement into the par (the closing backed right above it).

Since the xmos code is in github, there are a bunch of Continuous-Integration servers that could be set up which could be used to automate compiling all the combinations of flags whenever a branch is ready for a merge, and on the main branch for regression testing... just a though.

thanks again!
Marc