Re: RPI4/8GB i2c not working?

Klaus Küchemann via freebsd-arm <[email protected]>
Newsgroups gmane.os.freebsd.devel.arm
Message-ID <[email protected]>

> Am 10.03.2021 um 18:26 schrieb Klaus Küchemann <[email protected]>:
> 
> 
> Also possibly some things cood depend on loaded overlays/config.txt 
> and which corresponding GPIO-pins are configured 
> 

So let's give adding devices & gpio-pins  a shot with an example :

1.: we place e.g. the following files in dtb/overlays into the msdos-partition :

i2c1.dtbo
i2c3.dtbo
i2c4.dtbo
i2c6.dtbo

2.: in config.txt  we add them and assign pins to them: 
---
dtoverlay=i2c1,pins_2_3
dtoverlay=i2c3,pins_4_5
dtoverlay=i2c4,pins_6_7
dtoverlay=i2c6,pins_0_1
--

3.: reboot the machine :

root@generic:~ # dmesg
.....

iicbus1: <OFW I2C bus> on iichb1
iic1: <I2C generic I/O> on iicbus1
iicbus2: <OFW I2C bus> on iichb2
iic2: <I2C generic I/O> on iicbus2
iicbus3: <OFW I2C bus> on iichb3
iic3: <I2C generic I/O> on iicbus3
...

root@generic:~ # ls /dev
...
iic0
iic1  
iic2
iic3   
..
              
That's totally exciting   ! :-) Ha Ha 


4.: so let's probe again, this time on /dev/iic2 :

root@generic:~ # ktrace -t+ i2c -s -f /dev/iic2

root@generic:~ # kdump
….
1246 i2c      RET   open 3
  1246 i2c      CALL  read(0x3,0x4027cc18,0x80)
  1246 i2c      GIO   fd 3 read 128 bytes
       0x0000 4568 6e74 0100 0000 8000 0000 d500 0000  |Ehnt............|
       0x0010 0000 0000 d400 0000 0000 0000 0000 0000  |................|
       0x0020 0000 0000 0000 0000 0000 0000 0000 0000  |................|
       0x0030 0000 0000 0000 0000 0000 0000 0000 0000  |................|
       0x0040 0000 0000 0000 0000 0000 0000 0000 0000  |................|
       0x0050 0000 0000 0000 0000 0000 0000 0000 0000  |................|
       0x0060 0000 0000 0000 0000 0000 0000 0000 0000  |................|
       0x0070 0000 0000 0000 0000 0000 0000 0000 0000  |................|
  1246 i2c      RET   read 128/0x80
...


Wow, everything works as expected !   :-) 

I have no clue what happens when you assign the wrong pins to the wrong voltage ;-) Ha Ha 

K.


_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.