Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

I2C problems #21

Open
WalterPrech opened this issue May 27, 2022 · 2 comments
Open

I2C problems #21

WalterPrech opened this issue May 27, 2022 · 2 comments

Comments

@WalterPrech
Copy link

I followed the instructions to build a yocto dunfell image for a Rockchip Pi 4b.

I build a console image
~/yocto/poky/build $ bitbake -k radxa-console-image

Testing i2c without connecting any i2c slaves get the following results:

i2cdetect -l  
i2c-0	i2c       	rk3x-i2c                        	I2C adapter
i2c-1	i2c       	rk3x-i2c                        	I2C adapter
i2c-9	i2c       	DesignWare HDMI                 	I2C adapter

i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: UU UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: 50 51 52 53 54 55 56 57 -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --  

i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

i2cdetect -y 9
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: 30 -- -- -- -- -- -- 37 -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

If I connect some i2c-slaves, the result is exactly the same.

The i2c-address 0x18 should be shown for the connected sensor.

What's going wrong? Do I have to activate some settings and if yes where?

@jack-ma
Copy link
Member

jack-ma commented May 30, 2022

What sensor are you connecting and which pins on ROCK Pi do you connect? I suspect it's the voltage level issue.

@WalterPrech
Copy link
Author

I use the "blue" pins (pin 27 and 28).

In the meanwhile I figured out, that there were no overlays and no hw_intfc.conf file created in the build. And so no i2c was enabled.

I make a patch to rk3399-rock-pi-4.dtsi and added:

+&i2c2 {
+        clock-frequency = <400000>;
+        i2c-scl-rising-time-ns = <168>;
+        i2c-scl-falling-time-ns = <4>;
+        status = "okay";
+};

Now I can attach i2c-2 and get the sensors data.

Also it's a problem, that LINUX_VERSION = "4.4.154" is used. This should be 5.10 or higher.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants