Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Oct 2022 17:26:07 +0200
From:      Axel Rau <Axel.Rau@chaos1.de>
To:        hardware@freebsd.org, freebsd-hackers@freebsd.org
Subject:   Re: Accessing I2C-Bus via ELV USB-I2C
Message-ID:  <35D556D7-56EC-4295-93D6-80A4CFE6DCE9@Chaos1.DE>
In-Reply-To: <996df5c0-ffa7-f1bf-a9e2-6dd47d7b49e6@Chaos1.DE>
References:  <996df5c0-ffa7-f1bf-a9e2-6dd47d7b49e6@Chaos1.DE>

next in thread | previous in thread | raw e-mail | index | archive | help
--Apple-Mail=_B4FAB519-BB9C-4D16-82A3-B8D44681F591
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=utf-8

=46rom time to time the I2C layer on top of the uart locks up
and can=E2=80=99t be recovered via its built in reset command.
Initialialization at [1]:2564 is missing the greeting message.

looking at the traffic with
	usbdump -d ugen1.3 -v -v -v -s 1024 > usb.txt
I=E2=80=99m missing some response data from the I2C controller.

Questions:
1. On usbdump, why is the hexdump mssing on some lines like
	frame[0] WRITE <n> bytes  ?

2. Do we have a tool to dump traffic directly on the uart layer?


Any help appreciated, Axel

[1]: https://github.com/mc3/home2l/blob/master/brownies/brownies.C
	

> Am 27.04.2022 um 23:08 schrieb Axel Rau <Axel.Rau@chaos1.de>:
>=20
> Next journey starts:
>=20
> For the home2l project, I need a supported I2C interface via USB.
> I got this one:
> https://de.elv.com/elv-usb-ic-interface-usb-i2c-092255?fs=3D1805459039
> Unfortunately it shows up as a serial device on FreeBSD:
>=20
> ugen0.2: <Silicon Labs ELV USB-I2C-Interface> at usbus0, cfg=3D0 =
md=3DHOST spd=3DFULL (12Mbps) pwr=3DON (500mA)
>=20
>  bLength =3D 0x0012
>  bDescriptorType =3D 0x0001
>  bcdUSB =3D 0x0110
>  bDeviceClass =3D 0x0000  <Probed by interface class>
>  bDeviceSubClass =3D 0x0000
>  bDeviceProtocol =3D 0x0000
>  bMaxPacketSize0 =3D 0x0040
>  idVendor =3D 0x10c4
>  idProduct =3D 0xea60
>  bcdDevice =3D 0x0100
>  iManufacturer =3D 0x0001  <Silicon Labs>
>  iProduct =3D 0x0002  <ELV USB-I2C-Interface>
>  iSerialNumber =3D 0x0003  <B5AAP0EEUK6A3CIZ>
>  bNumConfigurations =3D 0x0001
>=20
> In loader.conf, I have:
> uslcom_load=3D"YES"
> iic_load=3D"YES"
> iicbus_loa
>=20
> But the i2c utility does not show a new bus.
>=20
> From dmesg:
> root@axels-bsdbox:~ # dmesg | grep iic
> ig4iic0: <Intel Sunrise Point-H I2C Controller-0> mem 0xdf230000-0xdf23=
0fff irq 16 at device 21.0 on pci0
> ig4iic0: Using MSI
> iicbus0: <Philips I2C bus (ACPI-hinted)> on ig4iic0
> iic0: <I2C generic I/O> on iicbus0
> ig4iic1: <Intel Sunrise Point-H I2C Controller-1> mem 0xdf22f000-0xdf22=
ffff irq 17 at device 21.1 on pci0
> ig4iic1: Using MSI
> iicbus1: <Philips I2C bus (ACPI-hinted)> on ig4iic1
> iic1: <I2C generic I/O> on iicbus1
> root@axels-bsdbox:~ # dmesg | grep I2C
> ig4iic0: <Intel Sunrise Point-H I2C Controller-0> mem 0xdf230000-0xdf23=
0fff irq 16 at device 21.0 on pci0
> iicbus0: <Philips I2C bus (ACPI-hinted)> on ig4iic0
> iic0: <I2C generic I/O> on iicbus0
> ig4iic1: <Intel Sunrise Point-H I2C Controller-1> mem 0xdf22f000-0xdf22=
ffff irq 17 at device 21.1 on pci0
> iicbus1: <Philips I2C bus (ACPI-hinted)> on ig4iic1
> iic1: <I2C generic I/O> on iicbus1
> ugen0.2: <Silicon Labs ELV USB-I2C-Interface> at usbus0
> uslcom0: <ELV USB-I2C-Interface> on usbus0
>=20
> They provide a (linux) driver ("Treiber") which seems to implement the =
I2C protocoll on top of the serial interface.
> Do we have such a driver on FreeBSD, or exist other supported I2C =
devices to be plugged into USB?
>=20
> Any help appreciated,
> Axel


=2D--
PGP-Key: CDE74120  =E2=98=80  computing @ chaos claudius


--Apple-Mail=_B4FAB519-BB9C-4D16-82A3-B8D44681F591
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=utf-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbs=
p-mode: space; line-break: after-white-space;" class=3D"">From time to =
time the I2C layer on top of the uart locks up<div class=3D"">and can=E2=80=
=99t be recovered via its built in reset command.</div><div class=3D"">In=
itialialization at [1]:2564 is missing the greeting message.</div><div =
class=3D""><br class=3D""></div><div class=3D""><span style=3D"font-famil=
y: Monaco; font-size: 11px; background-color: rgb(255, 255, 255);" =
class=3D"">looking at the traffic with</span></div><div class=3D""><span =
style=3D"font-family: Monaco; font-size: 11px; background-color: =
rgb(255, 255, 255);" class=3D""><span class=3D"Apple-tab-span" style=3D"w=
hite-space:pre">	</span>usbdump -d ugen1.3 -v -v -v -s 1024 &gt; =
usb.txt</span></div><div class=3D"">I=E2=80=99m missing some response =
data from the I2C controller.</div><div class=3D""><br class=3D""></div><=
div class=3D"">Questions:</div><div class=3D"">1. On usbdump, why is the =
hexdump mssing on some lines like</div><div class=3D""><span class=3D"App=
le-tab-span" style=3D"white-space:pre">	</span><span style=3D"font-family=
: Menlo-Regular;" class=3D"">frame[0] WRITE &lt;n&gt; bytes &nbsp;?</span=
></div><div class=3D""><span style=3D"font-family: Menlo-Regular;" =
class=3D""><br class=3D""></span></div><div class=3D"">2. Do we have a =
tool to dump traffic directly on the uart layer?</div><div class=3D""><br=
 class=3D""></div><div class=3D""><br class=3D""></div><div class=3D""><d=
iv>Any help appreciated, Axel</div><div><br class=3D""></div><div>[1]:&nb=
sp;<a href=3D"https://github.com/mc3/home2l/blob/master/brownies/brownies=
.C" class=3D"">https://github.com/mc3/home2l/blob/master/brownies/brownie=
s.C</a></div><div><span class=3D"Apple-tab-span" style=3D"white-space:pre=
">	</span></div><div><br class=3D""><blockquote type=3D"cite" class=3D"">=
<div class=3D"">Am 27.04.2022 um 23:08 schrieb Axel Rau &lt;<a href=3D"ma=
ilto:Axel.Rau@chaos1.de" class=3D"">Axel.Rau@chaos1.de</a>&gt;:</div><br =
class=3D"Apple-interchange-newline"><div class=3D""><div class=3D"">Next =
journey starts:<br class=3D""><br class=3D"">For the home2l project, I =
need a supported I2C interface via USB.<br class=3D"">I got this one:<br =
class=3D""><a href=3D"https://de.elv.com/elv-usb-ic-interface-usb-i2c-092=
255?fs=3D1805459039" class=3D"">https://de.elv.com/elv-usb-ic-interface-u=
sb-i2c-092255?fs=3D1805459039</a><br class=3D"">Unfortunately it shows =
up as a serial device on FreeBSD:<br class=3D""><br class=3D"">ugen0.2: =
&lt;Silicon Labs ELV USB-I2C-Interface&gt; at usbus0, cfg=3D0 md=3DHOST =
spd=3DFULL (12Mbps) pwr=3DON (500mA)<br class=3D""><br class=3D""> =
&nbsp;bLength =3D 0x0012<br class=3D""> &nbsp;bDescriptorType =3D =
0x0001<br class=3D""> &nbsp;bcdUSB =3D 0x0110<br class=3D""> &nbsp;bDevic=
eClass =3D 0x0000 &nbsp;&lt;Probed by interface class&gt;<br class=3D""> =
&nbsp;bDeviceSubClass =3D 0x0000<br class=3D""> &nbsp;bDeviceProtocol =
=3D 0x0000<br class=3D""> &nbsp;bMaxPacketSize0 =3D 0x0040<br class=3D"">=
 &nbsp;idVendor =3D 0x10c4<br class=3D""> &nbsp;idProduct =3D 0xea60<br =
class=3D""> &nbsp;bcdDevice =3D 0x0100<br class=3D""> &nbsp;iManufacturer=
 =3D 0x0001 &nbsp;&lt;Silicon Labs&gt;<br class=3D""> &nbsp;iProduct =3D =
0x0002 &nbsp;&lt;ELV USB-I2C-Interface&gt;<br class=3D""> &nbsp;iSerialNu=
mber =3D 0x0003 &nbsp;&lt;B5AAP0EEUK6A3CIZ&gt;<br class=3D""> &nbsp;bNumC=
onfigurations =3D 0x0001<br class=3D""><br class=3D"">In loader.conf, I =
have:<br class=3D"">uslcom_load=3D"YES"<br class=3D"">iic_load=3D"YES"<br=
 class=3D"">iicbus_loa<br class=3D""><br class=3D"">But the i2c utility =
does not show a new bus.<br class=3D""><br class=3D"">From dmesg:<br =
class=3D"">root@axels-bsdbox:~ # dmesg | grep iic<br class=3D"">ig4iic0: =
&lt;Intel Sunrise Point-H I2C Controller-0&gt; mem 0xdf230000-0xdf230fff =
irq 16 at device 21.0 on pci0<br class=3D"">ig4iic0: Using MSI<br =
class=3D"">iicbus0: &lt;Philips I2C bus (ACPI-hinted)&gt; on ig4iic0<br =
class=3D"">iic0: &lt;I2C generic I/O&gt; on iicbus0<br class=3D"">ig4iic1=
: &lt;Intel Sunrise Point-H I2C Controller-1&gt; mem 0xdf22f000-0xdf22fff=
f irq 17 at device 21.1 on pci0<br class=3D"">ig4iic1: Using MSI<br =
class=3D"">iicbus1: &lt;Philips I2C bus (ACPI-hinted)&gt; on ig4iic1<br =
class=3D"">iic1: &lt;I2C generic I/O&gt; on iicbus1<br class=3D"">root@ax=
els-bsdbox:~ # dmesg | grep I2C<br class=3D"">ig4iic0: &lt;Intel Sunrise =
Point-H I2C Controller-0&gt; mem 0xdf230000-0xdf230fff irq 16 at device =
21.0 on pci0<br class=3D"">iicbus0: &lt;Philips I2C bus (ACPI-hinted)&gt;=
 on ig4iic0<br class=3D"">iic0: &lt;I2C generic I/O&gt; on iicbus0<br =
class=3D"">ig4iic1: &lt;Intel Sunrise Point-H I2C Controller-1&gt; mem =
0xdf22f000-0xdf22ffff irq 17 at device 21.1 on pci0<br class=3D"">iicbus1=
: &lt;Philips I2C bus (ACPI-hinted)&gt; on ig4iic1<br class=3D"">iic1: =
&lt;I2C generic I/O&gt; on iicbus1<br class=3D"">ugen0.2: &lt;Silicon =
Labs ELV USB-I2C-Interface&gt; at usbus0<br class=3D"">uslcom0: &lt;ELV =
USB-I2C-Interface&gt; on usbus0<br class=3D""><br class=3D"">They =
provide a (linux) driver ("Treiber") which seems to implement the I2C =
protocoll on top of the serial interface.<br class=3D"">Do we have such =
a driver on FreeBSD, or exist other supported I2C devices to be plugged =
into USB?<br class=3D""><br class=3D"">Any help appreciated,<br class=3D"=
">Axel<br class=3D""></div></div></blockquote><br class=3D""></div><br =
class=3D""><div class=3D"">
<div dir=3D"auto" style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, =
0); letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; -webkit-tex=
t-stroke-width: 0px; text-decoration: none; word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><div=
 dir=3D"auto" style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); =
letter-spacing: normal; text-align: start; text-indent: 0px; text-transfo=
rm: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-wid=
th: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode:=
 space; line-break: after-white-space;" class=3D""><div style=3D"color: =
rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode:=
 space; line-break: after-white-space;" class=3D""><div style=3D"color: =
rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode:=
 space; line-break: after-white-space;" class=3D""><div style=3D"color: =
rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-li=
gatures: normal; font-variant-position: normal; font-variant-caps: =
normal; font-variant-numeric: normal; font-variant-alternates: normal; =
font-variant-east-asian: normal; font-weight: normal; letter-spacing: =
normal; line-height: normal; orphans: 2; text-align: -webkit-auto; =
text-indent: 0px; text-transform: none; white-space: normal; widows: 2; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word;=
 -webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><di=
v class=3D"">---<br class=3D"">PGP-Key:&nbsp;CDE74120 &nbsp;=E2=98=80 =
&nbsp;computing @ chaos claudius</div></div></div></div></div></div>
</div>
<br class=3D""></div></body></html>

--Apple-Mail=_B4FAB519-BB9C-4D16-82A3-B8D44681F591--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?35D556D7-56EC-4295-93D6-80A4CFE6DCE9>