Hi,
I'm going to try to answer all your questions. Hope I'll make it, so
early on a Sunday morning... ;-)
> i have replaced
> i2c.c and i2c.h in
> /devboard-R2_01/os/linux-2.6/arch/cris/arch-v10/drivers
> and
> etraxi2c.h in
>
/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01/include/asm-cris/etraxi2c.h
> with your new files right ?
That should be OK, yes.
> done: configure and make
> flash the board with option -f , restart, OK.
> but on next cat: no i2cdynamic, still i2cgvc
Well, I'm also continuously updating the I2C driver and the Wiki page
I was referring to is also a kind of "notepad" for me, next to a
guideline on how to update the FoxBoard with the new I2C driver.
In my current development (where I would like to have an OO approach
since it suites better my needs), I've renamed the driver name. I was
a bit "selfish" using my trigram as a device name in the past, now
I've updated it to i2cdynamic and i2cstatic. But that's currently
only in my environment, so you will still have i2cgvc into your cat
overview (cat /proc/devices).
> Do i have to :
> -----------snip---------------
> Summary
> * Rename the following files:
> /devboard-R2_01/packages/filesystem-R1_2_1/Makefile
> into
> /devboard-R2_01/packages/filesystem-R1_2_1/Makefile-original
> ..
> -----------snip---------------
> from the wiki site, isn't that done with the actions from !info.txt ?
No, it isn't. There's no such thing as a script (yet???) to do all
the stuff for you. I'll talk to John Crispin about that on how to do
this.
But be aware that John will incorporate the I2C driver version you
have into the new SDK (if it isn't the case already, didn't check it
yet). So, all the hassle will be done by him (thanks John!) and the
regular user should not be bothered by this any more...
To be honest, the article on my Wiki website is written in pieces and
I'm not saying there are no "holes" in the article.
I'm anyhow setting up a new environment and have to redo the exercise
myself, so I'll crosscheck the stuff I wrote and test it against the
reality once more.
So, forgive me if there currently would be any mistakes in the
article, I've done my best to circumvent them...
> when i run my programm it comes to the line
> --------------snip---------------------
> void writePCF8574(int pout)
> {
> printf( "Dev: - Action: writePCF8574 : %i \n", pout );
>
> unsigned char pcf8574value = 0x05;
>
> I2C_DATA i2cdata_pcf8574;
> struct timespec pcf8574_tv;
>
> /* 1 sec */
> pcf8574_tv.tv_sec = (time_t)1;
> pcf8574_tv.tv_nsec = (long)0;
>
> i2cdata_pcf8574.slave = 0x40;
> i2cdata_pcf8574.wlen = 1;
> i2cdata_pcf8574.wbuf[ 0 ] = 0xF0;
>
> if ( EI2CNOERRORS != ioctl( fd_i2c, _IO( ETRAXI2C_IOCTYPE,
> I2C_WRITE ), &i2cdata_pcf8574 ) )
> ---------------snip--------------------------
> i get this error:
>
> # IRP: c00f1920 SRP: c00f1caa DCCR: 00000400 USP: 9fa9bc1c MOF: 00000000
> r0: c01863a4 r1: 00000007 r2: b0000038 r3: c01863a4
> r4: c01863a4 r5: 00000003 r6: b0000038 r7: b0000038
> r8: 00000034 r9: 0000008e r10: 00000065 r11: 00000031
> r12: 00000002 r13: 000000c4 oR10: 00000065 sp: c1a99c04
> R_MMU_CAUSE: 355f3001
> Process i2cgvct (pid: 112, stackpage=c0452540)
>
> Code: c2 cb 6b d6 c2 d3 6d 96 06 30 81 92 (ff) 20 81 92 4c 96 3d 93 c0
> 9b c2 9b
> -----------------------------------------------------
>
> Also i get an error
> i2cexamplegvc.c:9:27: error: asm/i2c_errno.h: No such file or directory
> i2cexamplegvc.c:10:26: error: asm/etraxi2c.h: No such file or directory
> when i try to compile the sample.
> so i use the headers local, ok ?
This one I don't understand. You're apparently not able to compile
but you can run an executable. Can you explain more in detail?
Next to this, when compiling "user space programs", the compiler is
looking into /devboard_R2_01/target/cris-axis-linux-gnu/include/asm
for header files, not in the include dir of the kernel source tree.
So, make sure you have the necessary header files located into the
directory /asm of the above mentioned dir tree. You have to copy them
over there. Look into the file
/devboard_R2_01/tools/build-R2_12_4/Rules.axis for more info about
some default paths.
> and the option I2C_USES_PB_NOT_PB_I2C
> where do i set this? where is the right config.in ?
This is quite "cumbersome". First off, you don't have to change this
#define (it's not an option, but a compiler switch). I also didn't
change anything (well, almost anything) to the upper part of the
original I2C driver (the part that defines the registers, pins used,
compiler switches, etc...).
But if you want to know where that option is located, it's here:
/devboard_R2_01/include/config/etrax/i2c/uses/pb/not/pb/i2c.h
>
> and is it right you use pins
> PB6 (pin 38-J6) pin 1 <-> SDA (pin 1)
> PB7 (pin 37-J6) pin 2 --> SCL (pin 2)
> when the option is set ?
As said before, I didn't change anything wrt to this. But you stated
it right. Those pins are used.
>
> i hope the questions are not to stupid,
> but after tracking down this i2c issue from bitbang to this
> i am a bit tired, confused, and on time pressure.
Questions are never stupid, answers can...
> i am not a pro (now ;) in advanced linux mechanics.
>
> cat /proc/devices
> i get a device i2cgvc
> in the list. and on dmesg there is:
> I2C driver v2.2, (c) 1999-2004 Axis Communications AB
> ==> Improvements done by Geert Vancompernolle - December 2006
> I2C Major: 123 / I2C Name: i2cgvc
> I assume thats not your updated driver ? (Date)
Well, as said before, the Wiki is running a bit ahead on the current
state of my work. I hope to finish it one of the coming weeks
(including the OO approach) and to rework all the necessary stuff, if
time allows me to do so.
Currently, version 1.2 of the driver is the latest one releases.
> which headerfiles do i use to compile for this driver ?
You are able to compile the driver, so you should be OK. Regarding
your user space program, pls. make sure the necessary header files are
in /devboard_R2_01/target/cris-axis-linux-gnu/asm and *not* only in
the kernel source tree include directory.
Let me know how you proceed. Other people have already successfully
used this driver without problems, so you should be able to do the
same too... ;-)
Best rgds,
--Geert