lib_i2c dependencies?

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
soundhound
Member++
Posts: 18
Joined: Thu Mar 08, 2018 4:07 pm

lib_i2c dependencies?

Post by soundhound »

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?


User avatar
CousinItt
Respected Member
Posts: 360
Joined: Wed May 31, 2017 6:55 pm

Post by CousinItt »

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

Post by soundhound »

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

Post by soundhound »

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: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

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
Attachments
xmos_i2c2.png
xmos_i2c2.png (13.55 KiB) Viewed 1464 times
xmos_i2c2.png
xmos_i2c2.png (13.55 KiB) Viewed 1464 times
xmos_i2c1.png
xmos_i2c1.png (14.32 KiB) Viewed 1464 times
xmos_i2c1.png
xmos_i2c1.png (14.32 KiB) Viewed 1464 times
soundhound
Member++
Posts: 18
Joined: Thu Mar 08, 2018 4:07 pm

Post by soundhound »

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?!
Post Reply