Re: PCF8574 I2C configuration for 14.0-CURRENT on a RPi2B

From: Mark Millard <marklmi_at_yahoo.com>
Date: Sun, 06 Mar 2022 22:14:54 UTC
On 2022-Mar-6, at 10:11, Don Kuenz <mail@crcomp.net> wrote:

> 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

config.txt seems fine up to here. But I've never seen
anything indicating that the following notation is
valid for config.txt files:

> / {
>  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";
>  };
> };

If you have a reference indicating otherwise, I'd
be interested to know what it is.

The notation seems to be source code for part of a
.dtb or .dtbo file. As I understand, there is a
separate toolchain involved in producing the binary
file(s) for such ( dtc ) and there is separate
place to put such .dtbo binary files on the msdos
file system: overlays/ .

I've never made my own .dtbo and so am not able to
help with the details. But I expect that producing
and using a .dtbo file is the general direction
of what needs to change for this part of what you
were doing.

"man dtc" should work for getting some information
about the dtc tool and how to use it.

> 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.




===
Mark Millard
marklmi at yahoo.com