Migrating from XHRA to XU208

Sub forums for various specialist XMOS applications. e.g. USB audio, motor control and robotics.
User avatar
Wavelength
Active Member
Posts: 51
Joined: Mon Sep 24, 2018 9:56 pm

Re: Migrating from XHRA to XU208

Postby Wavelength » Sat Aug 31, 2019 8:09 pm

Gang,

So what am I doing wrong here??? steps I took in both these new installs macOS 10.14.6 or Windows 10 on a Intel NUCi7/16G/500GBssd
a) Download install xtools
b) Download UAC2, create folder under user/myname/xmos place everything there.
c) Download xhra->208 zip file and place the zip file in sw_usb_audio
d) Install java
e) create folder in sw_usb_audio for workspace... lets call it wp_xhra
f) run xTime, point workspace to xp_xhra
g) Import->General->Existing Project into Workspace
h) Select the ZIP file, select both items and let it rip.
i) do a clean

Errors in audiohw.xc
DeviceDefines.h not found
i2c_shared.h not found
dsd_support.h not found

Ok well at least Windows and macOS are somewhat consistent now.

Anyone please tell me what steps I did wrong. If I can get either of these new installs working, maybe I can figure out what's wrong with this system.

Thanks,
Gordon
Wavelength Audio, ltd.
User avatar
Wavelength
Active Member
Posts: 51
Joined: Mon Sep 24, 2018 9:56 pm

Postby Wavelength » Sat Aug 31, 2019 8:33 pm

More...

I did remember somewhere here in the tread that the xhra code needed to be in the root directory of the sw_usb_audio and when you import it will put it in that folder (i.e. xp_xhra).

So I created another work space folder copied the project into the root and then imported the existing project into that new work space.

I got a lot further than I over the last 4 weeks... still don't know why my project is freaking out!

This happens with either the original audio.xc or the updated one:

C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio_new.xc: Error: Multiple definition of 'audio.savedstate'
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio.xc: Error: first defined here
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio_new.xc: Error: Multiple definition of '_Saudio_0.savedstate'
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio.xc: Error: first defined here
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio_new.xc: Error: Multiple definition of 'dsdMode'
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio.xc: Error: first defined here
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio_new.xc: Error: Multiple definition of 'audio'
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio.xc: Error: first defined here
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio_new.xc: Error: Multiple definition of 'testct_byref'
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio.xc: Error: first defined here
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio_new.xc: Error: Multiple definition of 'testct_byref.nstackwords'
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio.xc: Error: first defined here
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio_new.xc: Error: Multiple definition of 'testct_byref.maxcores'
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio.xc: Error: first defined here
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio_new.xc: Error: Multiple definition of 'testct_byref.maxtimers'
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio.xc: Error: first defined here
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio_new.xc: Error: Multiple definition of 'testct_byref.maxchanends'
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio.xc: Error: first defined here
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio_new.xc: Error: Multiple definition of 'audio.nstackwords'
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio.xc: Error: first defined here
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio_new.xc: Error: Multiple definition of 'audio.maxcores'
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio.xc: Error: first defined here
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio_new.xc: Error: Multiple definition of 'audio.maxtimers'
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio.xc: Error: first defined here
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio_new.xc: Error: Multiple definition of 'audio.maxchanends'
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio.xc: Error: first defined here
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio_new.xc: Error: Multiple definition of '_Saudio_0'
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio.xc: Error: first defined here
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio_new.xc: Error: Multiple definition of '_Saudio_0.nstackwords'
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio.xc: Error: first defined here
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio_new.xc: Error: Multiple definition of '_Saudio_0.maxcores'
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio.xc: Error: first defined here
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio_new.xc: Error: Multiple definition of '_Saudio_0.maxtimers'
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio.xc: Error: first defined here
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio_new.xc: Error: Multiple definition of '_Saudio_0.maxchanends'
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio.xc: Error: first defined here
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio_new.xc: Error: Multiple definition of 'g_adcVal'
C:/Users/GordonNUCi7/xmos/sc_usb_audio/module_usb_audio/audio.xc: Error: first defined here

~~~
Ok going home too frustrated!
Thanks,
Gordon
Wavelength Audio, ltd.
User avatar
Wavelength
Active Member
Posts: 51
Joined: Mon Sep 24, 2018 9:56 pm

Postby Wavelength » Sun Sep 01, 2019 7:23 pm

Gang,

Quick update... so on my original dev machine I was able to get everything to compile for the original project. I had to add a serial number string because my original project has that enabled. I copied that folder to a back up then started replacing files figuring one of them would set of my errors in my project. Makefile first... ok worked.... then the XN file with my io and stuff, still ok. Then audiohw.xc, audiostream.xc, gpio, hostactive no problems. Then I changed the make file to exclude DFU, SPDIF_TX and I2C because the shared stuff didn't work for some of my devices. Then I added my wai2c.xc and wai2c.h files into the project. Everything compiles... but when it goes to link it cannot find my 3 procedures in wai2c.xc:

wai2c_init basically puts the 1 bit ports in the SCL, SDA and initializes them to 1.
wai2c_rd_reg read an I2C register in a device for x amount of bytes
wai2c_wr_reg write an I2C register in a device for x amount of bytes

So in the hidden build folder I see the assembler file wai2c.s, if I open that I see these:
wai2c_init: # @wai2c_init
wai2c_rd_reg: # @wai2c_rd_reg
wai2c_wr_reg: # @wai2c_wr_reg

All 3 are global variables in the ASM file?

These are basically the only 3 procedures that are new. Any idea why the linker would not find them even though they are compiled?

I am so close to getting this to work, anyone around today? Oh doesn't look like it, great!

Thanks,
Gordon
Wavelength Audio, ltd.
User avatar
Wavelength
Active Member
Posts: 51
Joined: Mon Sep 24, 2018 9:56 pm

Postby Wavelength » Sun Sep 01, 2019 7:35 pm

Back to square 1.... did a clean and now back to the original error endpoint0.xc dfu_types.h not found.

So I did notice that none of the replaced files (i.e. audiohw, audiostream, gpio, wai2c etc...) had .o files meaning even through the compiler compiled them to .s (assembler), the assembler was never run against them to make .o files and therefore the linker did not link these. Because there was original .o files from the original build of the xhra code then that is why it linked with only the 3 errors.

Ok more info that I wanted to think about, but lets see if I can look at this a little more. What's another hour of work to figure this out.

Thanks,
Gordon
Wavelength Audio, ltd.
User avatar
Wavelength
Active Member
Posts: 51
Joined: Mon Sep 24, 2018 9:56 pm

Postby Wavelength » Sun Sep 01, 2019 9:44 pm

All,

So I really have 2 problems now that I spent some 60 hours on this. Only took 4 hours to get this to work before.

a) If I remove modules from the makefile then I get the dfu_types.h error in endpoint0.c

b) The bigger problem seems to be that I have an invalid project path that kills a lot of the directives in the customdefines.h

~~~
Description Resource Path Location Type
Invalid project path: Include path not found (lib_i2c). app_usb_aud_xu208_xhra pathentry Path Entry Problem
~~~
All the modules are in the ../.. folder. Going to see if the same thing happens in Windows.

Ok signing off for today, 2 days till the show... no closer than I was in July!
Thanks,
Gordon
Wavelength Audio, ltd.
User avatar
Wavelength
Active Member
Posts: 51
Joined: Mon Sep 24, 2018 9:56 pm

Postby Wavelength » Sun Sep 01, 2019 9:57 pm

All,

Same thing with Windows... none of the directives in customdefines.h are working, defaulting to UAC instead UAC2 and everything else.

Thanks,
Gordon
Wavelength Audio, ltd.
User avatar
Wavelength
Active Member
Posts: 51
Joined: Mon Sep 24, 2018 9:56 pm

Postby Wavelength » Mon Sep 02, 2019 7:45 pm

All,

Ok total weirdness as this happens on all 3 of my machines. So under Properties->C/C++ General->Path and Symbols I noticed the error: The selected folder does not exist or not accessible. This accounted for the 89 warnings that I was getting. Interesting I backed up the project folder then did a restore defaults which basically wipes everything clean and I am down to 32 not found errors. Which is much better but, basically everything I am using.

Since the project is compiling and building the project now I went to the hidden build folder and I see all the modules and sub modules are in there, compiled and so forth.

drwxr-xr-x 3 gordonrankin staff 96 Sep 2 12:20 _m_dfu
drwxr-xr-x 3 gordonrankin staff 96 Sep 2 12:20 _m_i2c_shared
drwxr-xr-x 3 gordonrankin staff 96 Sep 2 12:20 _m_i2c_single_port
drwxr-xr-x 3 gordonrankin staff 96 Sep 2 12:20 _m_locks
drwxr-xr-x 3 gordonrankin staff 96 Sep 2 12:20 _m_spdif_tx
drwxr-xr-x 37 gordonrankin staff 1184 Sep 2 12:20 _m_usb_audio
drwxr-xr-x 3 gordonrankin staff 96 Sep 2 12:20 _m_usb_device
drwxr-xr-x 3 gordonrankin staff 96 Sep 2 12:20 _m_usb_shared
drwxr-xr-x 3 gordonrankin staff 96 Sep 2 12:20 _m_xud

Also it seems that all the files are compiled, but I am still not getting the right directives in main.xc to show up after a clean. UAC2 is the main one.

So I opened main.xc.d file inside _m_usb_audio and it shows that it has dependencies for customdefines.h

.build/_m_usb_audio/main.xc.d .build/_m_usb_audio/main.xc.o .build/_m_usb_audio/main.xc.pca.xml: \
../../sc_usb_audio/module_usb_audio/main.xc \
../../sc_xud/module_xud/include/xud.h \
../../sc_xud/module_xud/include/xud_defines.h \
../../sc_usb_audio/module_usb_audio/devicedefines.h \
../../sw_usb_audio/XU208WA/src/core/customdefines.h \
../../sc_usb_audio/module_usb_audio/uac_hwresources.h \
../../sc_usb_audio/module_usb_audio/endpoint0/endpoint0.h \
../../sc_usb_audio/module_dfu/src/dfu_interface.h \
../../sc_usb/module_usb_shared/src/usb_std_requests.h \
../../sc_usb/module_usb_shared/src/usb_defs.h \
../../sc_usb_audio/module_usb_audio/usb_buffer/usb_buffer.h \
../../sc_usb_audio/module_usb_audio/usb_buffer/decouple.h \
../../sc_usb_audio/module_usb_audio/audio.h \
../../sc_usb_audio/module_usb_audio/clocking.h

~~~
Maybe all this is a wash and maybe I should try it on the hardware and see what comes up???
Thanks,
Gordon
Wavelength Audio, ltd.
User avatar
Wavelength
Active Member
Posts: 51
Joined: Mon Sep 24, 2018 9:56 pm

Postby Wavelength » Mon Sep 02, 2019 10:04 pm

All,

So today I checked and I have the same problem with all 3 of my development machines MBP 15, MBP 13, Windows 10. So I was fishing around in my office and found a sample of all this that worked back in OCT of last year.

Ok, so I used Time Machine pulled that version of code and entire folder structure back in. I did a build and same problem, 104 warnings about folder not found in path.

This is on 3 completely different machines, what could be wrong.

Thanks,
Gordon
Wavelength Audio, ltd.
User avatar
Wavelength
Active Member
Posts: 51
Joined: Mon Sep 24, 2018 9:56 pm

Postby Wavelength » Tue Sep 03, 2019 10:05 pm

All,

Ok off to Denver in the AM, going with the old code and boards which has some things that need fixing but at least the product works.

Sent off everything to XMOS support and probably never hear from them again. Did get the warnings and folder problems down to 32 by hitting restore defaults in Properties->C/C++ General->Paths and Symbols. But of course those are now the ones I need for the damn thing to work. The other 57 were just folders I did not need for my app.

Tried running the version that compiles now and off course I get a fault almost right off the bat. Was able to check my new code I added to the old product works fine. Wish I could use my new boards for the show.

Oh well, thanks
Gordon
Wavelength Audio, ltd.
sleepfox
Member++
Posts: 16
Joined: Fri Jun 01, 2018 5:03 pm

Postby sleepfox » Sun Sep 08, 2019 5:01 am

akp wrote:
Thu Aug 29, 2019 2:21 pm
You shouldn't have any problem using 12MHz for system clock. You will need to edit the .xn file and that should be it. Refer to Sec 7 of https://www.xmos.com/download/XU208-256 ... (1.16).pdf -- the XU208 in TQ64 will boot with any clock from 9 - 25MHz. And note that the only clocks that will work with the USB PHY enabled are 24MHz and 12MHz. So then if you just change Oscillator="24MHz" to Oscillator="12MHz" in the xn file it will probably work tickety-boo.
Thank you very much. :)

Who is online

Users browsing this forum: No registered users and 0 guests