Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Apr 2019 11:19:12 +0300
From:      Daniel Braniss <danny@cs.huji.ac.il>
To:        Oleksandr Tymoshenko <gonzo@bluezbox.com>
Cc:        Emmanuel Vadot <manu@bidouilliste.com>, "freebsd-arm@freebsd.org" <arm@freebsd.org>
Subject:   Re: i2c still not working for me
Message-ID:  <FCA4E00E-455A-46BF-AD78-E20E1E997BFC@cs.huji.ac.il>
In-Reply-To: <20190409171604.GA4581@bluezbox.com>
References:  <12F641C3-9FAA-4A3A-BA18-A7302F3A0F5E@cs.huji.ac.il> <20190409095819.c560dbc156c46e5ca0244e3e@bidouilliste.com> <23A47048-642A-481C-B7BE-B61E55F82955@cs.huji.ac.il> <20190409171604.GA4581@bluezbox.com>

next in thread | previous in thread | raw e-mail | index | archive | help


> On 9 Apr 2019, at 20:16, Oleksandr Tymoshenko <gonzo@bluezbox.com> =
wrote:
>=20
> Daniel Braniss (danny@cs.huji.ac.il <mailto:danny@cs.huji.ac.il>) =
wrote:
>>=20
>>=20
>>> On 9 Apr 2019, at 10:58, Emmanuel Vadot <manu@bidouilliste.com> =
wrote:
>>>=20
>>> On Tue, 9 Apr 2019 10:50:22 +0300
>>> Daniel Braniss <danny@cs.huji.ac.il> wrote:
>>>=20
>>>> Hi,
>>>> after the latest changes to i2c there is a small improvement,
>>>> i2c -s finds the device but complains:
>>>>=20
>>>> root@neo-14:~ # i2c -s
>>>> Hardware may not support START/STOP scanning; trying less-reliable =
read method.
>>>> Scanning I2C devices on /dev/iic0: 24
>>>>=20
>>>> but nothing else works.
>>>>=20
>>>> I?ll try and connect my saleae signal analyzer later, but  in the =
meantime this is what I get
>>>> on the console:
>>>> [?]
>>>> iichb0: twsi_control_clear: read val=3D58
>>>> iichb0: twsi_control_clear: write val=3D40
>>>> iichb0: TWSI_WRITE: Writing 40 to c
>>>> iichb0: twsi_start: twsi_start: slave=3D48
>>>> iichb0: twsi_locked_start: send start
>>>> iichb0: TWSI_READ: read 58 from c
>>>> iichb0: twsi_control_set: read val=3D58
>>>> iichb0: twsi_control_set: write val=3D68
>>>> iichb0: TWSI_WRITE: Writing 68 to c
>>>> iichb0: twsi_poll_ctrl: Waiting for ctrl r.
>>>> eg to match mask 8
>>>> iichb0: TWSI_READ: read 48 from c
>>>> gic0: iichb0: Spurious interrupt detected: last irq: 32 on CPU1
>>>> twsi_poll_ctrl: done
>>>> gic0: iichb0: Spurious interrupt detected: last irq: 32 on CPU1
>>>> TWSI_READ: read 8 from 10
>>>> iichb0: twsi_locked_start: status=3D8
>>>> iichb0: TWSI_WRITE: Writing 48 to 8
>>>> gic0: Spurious interrupt detected: last irq: 32 on CPU1
>>>> iichb0: TWSI_READ: read 48 from c
>>>> gic0: iichb0: Spurious interrupt detected: last irq: 32 on CPU1
>>>> twsi_control_clear: read val=3D48
>>>> gic0: iichb0: Spurious interrupt detected: last irq: 32 on CPU1
>>>> twsi_control_clear: write val=3D40
>>>> gic0: iichb0: Spurious interrupt detected: last irq: 32 on CPU1
>>>> TWSI_WRITE: Writing 40 to c
>>>> gic0: Spurious interrupt detected: last irq: 32 on CPU1
>>>> iichb0: twsi_poll_ctrl: Waiting for ctrl reg to match mask 8
>>>> gic0: iichb0: Spurious interrupt detected: last irq: 32 on CPU1
>>>> TWSI_READ: read 48 from c
>>>> iichb0: twsi_poll_ctrl: done
>>>> iichb0: TWSI_READ: read 8 from 10
>>>> iichb0: twsi_locked_start: no ACK (status: 08) after sending slave =
address
>>>> gic0: iichb0: Spurious interrupt detected: last irq: 32 on CPU1
>>>> twsi_stop: twsi_stop
>>>> [?]
>>>>=20
>>>> BTW, the hardware is NanoPi-neo and it?s running Current 345984
>>>>=20
>>>> thanks,
>>>> 	danny
>>>>=20
>>>=20
>>> Based on the function names you are using directly stop/start/etc =
...
>>> My changes were only for i2c_transfer (I2CRDWR ioctls)
>>>=20
>>=20
>> ok, this will show my ignorance, but could you send me some sample =
code that uses I2CRDWR?
>> btw, the device i=E2=80=99m trying out is an RFID reader pn533, which =
works with a modified driver =E2=80=A6
>=20
> Sample code for TMP102 sensor that uses RDWR ioctl:
>=20
> =
https://github.com/gonzoua/freebsd-embedded-demos/blob/master/libtmp102/tm=
p102.c =
<https://github.com/gonzoua/freebsd-embedded-demos/blob/master/libtmp102/t=
mp102.c>


thanks gonzo!
I already got to talk to the PN533, so the iic driver is now working,
now for some more coding (the pn533 is a bit more complicated than the =
thermal chip :-)
thanks,
	danny


>=20
>=20
> --=20
> gonzo




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FCA4E00E-455A-46BF-AD78-E20E1E997BFC>