lib_i2c dependencies?

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
soundhound
Member++
Posts: 18
Joined: Thu Mar 08, 2018 4:07 pm

lib_i2c dependencies?

Postby soundhound » Tue Feb 26, 2019 5:13 pm

the module_build_info file doesn't mention anything about exporting the header file i2c.h
as mentioned in the manual about EXPORT_SOURCE_DIRS.

would this be why trying to compile a project that depends on the lib_i2c module barf on not finding i2c.h ?
why would this module not export the all-important header file?
CousinItt
Experienced Member
Posts: 124
Joined: Wed May 31, 2017 6:55 pm

Postby CousinItt » Tue Feb 26, 2019 7:10 pm

I've had similar problems and I've not really got to the bottom of why it happens, but I have a couple of things that have worked for me (either together or separately). I'm assuming you are building from the IDE, added lib_i2c to the USED_MODULES section of your makefile, and have included i2c.h in your source file(s).

1) Try opening the lib_i2c project in the project explorer (but still having your project as the current project).

2) Try Clean Project before Build Project.

HTH.
soundhound
Member++
Posts: 18
Joined: Thu Mar 08, 2018 4:07 pm

Postby soundhound » Tue Feb 26, 2019 8:02 pm

that didn't do it for me.
A year ago I think I copied over the i2c.h file just to get this bastard going (at the very start!)
in my ignorance, I blundered in and did a xmake clean and it was swept away somehow.
I cannot even compile a re-installed app_i2c_simple_demo now so I assume there is something broken in eclipse that got trodden on.
this pile of shit didn't work out of the box and it is still as fragile as fuck.
otherwise intelligent h/w designers thought it was a good idea to put their efforts into one of the buggest(!) productivity pits ever?
soundhound
Member++
Posts: 18
Joined: Thu Mar 08, 2018 4:07 pm

Postby soundhound » Tue Feb 26, 2019 9:32 pm

I see these sorts of problems have been blowing around the forum for a few years, I started last year, I see you, CousinItt, at least a year earlier.
Perhaps it has something to do with the previous incarnation of Xmos,
as in Xcore, when there was some momentum around community libraries.
but since the winds changed a completely different bunch of sources have been developed under a more restrictive license (lib_xxx).
probably the staff don't give a fuck any more and would rather the sc_xxx bit-rotted into oblivion.
my own first interest was in lib_i2c, the new stuff, but it turned out
there was no multi-master support, whereas the older sc_i2c did that and more.
why did they go backwards?
and why make the module_xxx/sc_xxx stuff available through xT if it doesn't compile any more and isn't supported?
it doesn't do xmos any credit.
User avatar
mon2
XCore Legend
Posts: 1433
Joined: Thu Jun 10, 2010 11:43 am

Postby mon2 » Wed Feb 27, 2019 1:45 pm

Hi. Start with an example project that uses I2C and allow that project to import all necessary dependencies and then tweak the project to suit. That is a quick way to use this library.

For example,

AN00156

1) Launch xTimecomposer

2) Examples (left side of menu)

3) Search bar, enter "I2C"

4) Double click the How to use I2C master library [AN00156]

5) Compile Project -> this will lead to the import of other required libraries -> allow for the import. Project should compile correctly. Proceed to test as-is or tweak to make it your own.


Also see here:

https://www.xmos.com/developer/download ... .0rc3).pdf
You do not have the required permissions to view the files attached to this post.
soundhound
Member++
Posts: 18
Joined: Thu Mar 08, 2018 4:07 pm

Postby soundhound » Tue Mar 05, 2019 5:23 pm

thanks mon2.
I been trying the like on different platforms.
my problems started with 14.3.2 on windows XP - according to the latest xT User Guide XP on SP3 is supported but I have since found via company contact it isn't
any longer but should still work.
I created a minimal app that used the lib_i2s module, which itself references lib_xassert and lib_logging
and tried compiling on the cmdline:

Checking build modules
Using build modules: lib_i2s(2.3.0) lib_xassert(3.0.0) lib_logging(2.1.0)
Analyzing debug_printf.c
/home/dev/projects/xmos/lib_logging/lib_logging/src/debug_printf.c:2:10: fatal error:
'debug_print.h' file not found
#include <debug_print.h>
^
1 error generated.

I then upgraded to 14.3.3 and same deal.
I then installed xT in a VirtualBox/linux Ubuntu VM along with the minimalist app directory (and libs) and (though slow) the compilation succeeded.
so I suspected a problem with XP shell compatibility.
I then installed on an amd64/Ubuntu system along with app directory (and libs).
And it didn't work!
got the same error.
I have been looking into the Makefile.common/common1 files but it is heavy going.
all I can say at the moment is that the different installs' xmake invocations are generating different variable contents (as defined by those makefiles). whether these makefiles are shelling out to OS tools I don't know.

so it doesn't look like a problem with using XP after all.
two additional linux systems, 32bit and 64bit, fresh, up-to-date, xT installs, a one line app, a boilerplate makefile with USED_MODULES=lib_i2s.

any ideas?!

Who is online

Users browsing this forum: No registered users and 1 guest