Including libraries for xc Project with XTC Tools in VScode

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
Gemüsesaft
New User
Posts: 3
Joined: Tue Aug 17, 2021 1:20 pm

Including libraries for xc Project with XTC Tools in VScode

Post by Gemüsesaft »

Hi,
I'm still a XMOS newbie and I'm trying to write a simple I2S in, I2S out program, but I already fail at the point of including the necessary I2S Library.

I'm working as recommended by XMOS with the latest release of XTC Tools in VScode. Everything is set up and the environment variables are set.

I've downloaded the library from the XMOS website and added it to the workspace.

Then I've tried to build the program with a build.sh as described in the XTC Tools documentation and with an Makefile, both without success.
Every time I get an error that says "can't find i2s.h".

I've also tried to add a path to the library as include path in the cpp_properties.json.

I'm wondering how to use these downloaded libraries with VScode and XTC Tools.

Also I find it very frustrating to work with the recommendations for new designs that XMOS gives, for example the “new” C language that one should use.
For me there is not nearly enough documentation to understand how I can create C programs that make use of the XC libraries from XMOS.
And even if I go to XC, as I've done it, I still can't work out how I can work with these libraries in VScode.

I hope some one can help me out, I would really appreciate that!
Thank you very much in advance! :)

Kind regards
Till


User avatar
aclassifier
Respected Member
Posts: 483
Joined: Wed Apr 25, 2012 8:52 pm
Contact:

Post by aclassifier »

Hi,

the below may be of zero help to you, but then it might not:

If you are a newbie then you don't go from xC? If you did, they have indeed written a cheat sheet: https://www.xmos.ai/documentation/XM-01 ... tml#cheat

The include not to be found I have also experienced some time when I probably haven't imported a library as I should with xTIMEcomposer 14.4.1 etc. I then have resolved it successively with the usual -I (which I'm sure know about):
XCC_FLAGS += -I/Users/teig/workspace/lib_rfm69_xc/api

The old makefile also would include the below, which is the main mechanism
USED_MODULES = lib_i2c lib_logging lib_rfm69_xc
--
Øyvind Teig
Trondheim (Norway)
https://www.teigfam.net/oyvind/home/
Gemüsesaft
New User
Posts: 3
Joined: Tue Aug 17, 2021 1:20 pm

Post by Gemüsesaft »

Thank you for your response!

No I’ve started directly with C.
I’ve already tried the compiler flags you mentioned, with no success.
I also included the USED_MODULES line in my Makefile, the time I tried it with xmake.

A week ago I switched to the older IDE xTimeComposer 14.
Now it works a lot better, although not nearly as nice as with software from other manufacturers as Microchip or STM.

After 3 days I’ve managed to include a library without build errors.. yay..
User avatar
aclassifier
Respected Member
Posts: 483
Joined: Wed Apr 25, 2012 8:52 pm
Contact:

Post by aclassifier »

Gemüsesaft wrote: Wed Sep 01, 2021 7:19 am A week ago I switched to the older IDE xTimeComposer 14.
Now it works a lot better, although not nearly as nice as with software from other manufacturers as Microchip or STM.
Me too! Here: 14.4.1 on a reserved machine! (disclaimer: no ads, no gifts, just fun and expenses)

But I am also looking forwards to learning XTC some time, like when the future is here for real with XCORE.AI silicon. I really can't wait.

Like the xcore.ai Explorer Board (which I have a snapshot of here) - but all the XMOS pages of it point towards the future is here pages.
--
Øyvind Teig
Trondheim (Norway)
https://www.teigfam.net/oyvind/home/
Post Reply