Date: Sun, 6 Mar 2022 23:18:15 +0100 From: Milan Obuch <freebsd-arm@dino.sk> To: freebsd-arm@freebsd.org Subject: Re: PCF8574 I2C configuration for 14.0-CURRENT on a RPi2B Message-ID: <20220306231815.6ea9b3b2@zeta.dino.sk> In-Reply-To: <20220306181231.4801A1A059FB@mlmmj.nyi.freebsd.org> References: <20220306181231.4801A1A059FB@mlmmj.nyi.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 06 Mar 2022 18:11:50 UTC Don Kuenz <mail@crcomp.net> wrote: > Greetings, > > My RPi2B GPIO header connects to a PCF8574 I2C adapter with these > pins: > > RPi2B PCF8574 > --------------- ------- > Pin 2 - +5VDC <-> VCC > Pin 3 - GPIO 2 <-> SDA > Pin 5 - GPIO 3 <-> SCL > Pin 39 - Gnd <-> GND > > /boot/loader.conf contains these lines: > > root@generic:/boot # cat /boot/loader.conf > # Configure USB OTG; see usb_template(4). > hw.usb.template=3 > umodem_load="YES" > # Disable the beastie menu and color > beastie_disable="YES" > loader_color="NO" > gpioiic_load="YES" > > and /boot/msdos/config.txt looks like this: > > root@generic:/boot # cat /boot/msdos/config.txt > init_uart_clock=3000000 > enable_uart=1 > kernel=u-boot.bin > kernel7=u-boot.bin > dtoverlay=mmc > / { > gpioiic0 { > compatible = "i2c-gpio"; > pinctrl-names = "default"; > pinctrl-0 = <&pinctrl_gpioiic0>; > scl-gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>; > sda-gpios = <&gpio3 5 GPIO_ACTIVE_HIGH>; > status = "okay"; > }; > }; > > Nothing happens: > > root@generic:/boot # i2c -sv > dev: /dev/iic0, addr: 0x0, r/w: r, offset: 0x00, width: 8, count: 1 > Error opening I2C controller (/dev/iic0): No such file or directory > > What's missing? Thank you in advance. > Hi, could you show us what's in /dev directory? Probably no iic0 file there. Also, you did not write which kernel are you using. For /dev/iic0 to appear, you need either 'device iic' in your kernel config or load it dynamically via 'kldload iic', in addition to working i2c controller. Showing your 'dmesg' output helps to determine what's going on, along with DTB used as well. All this are just basic hints what and where to look for, there are probably other as well, but I hope this helps. Regards, Milan
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20220306231815.6ea9b3b2>