4 4
mboehmer

Rock PI 4

Recommended Posts

root@rockpi:~# dmesg|grep serial
[    1.965909] ff180000.serial: ttyS0 at MMIO 0xff180000 (irq = 38, base_baud = 1500000) is a 16550A
[    1.969249] ff1a0000.serial: ttyS2 at MMIO 0xff1a0000 (irq = 39, base_baud = 1500000) is a 16550A
[    1.972774] ff370000.serial: ttyS1 at MMIO 0xff370000 (irq = 41, base_baud = 1500000) is a 16550A

what pin is "ttyS0" ?

 

when "okay"

serial@ff1b0000 {
  ....................................
        pinctrl-0 = < 0x42 >;
        status = "disabled";
        phandle = < 0xd9 >;

 

network fall

Share this post


Link to post
Share on other sites
1 hour ago, atula said:

serial@ff1b0000 {
  ....................................
        pinctrl-0 = < 0x42 >;

This UART is UART3, and according to DT, it is pins GPIO3_B6 and GPIO3_B7 ...

But be aware that those pins are used on most of the boards for the Ethernet GMAC !

Since we still don't have access to RockPi4B schematic, it is a bit hard to confirm ...

 

If you are looking for serial@ff180000, it is UART0, than the pins are GPIO2_C0 and GPIO2_C1, which on some board is a UART connected to BlueTooth.

 

If you are looking at the UART available on Header at usual pin 8/10, it is GPIO4_C3 and GPIO4_C4, which is the UART2 located in node serial@ff1a0000.

Share this post


Link to post
Share on other sites
1 hour ago, atula said:

what pin is w1 default pin ?

The rockchip-w1-gpios.dtbo overlay has it hard coded to GPIO1_A4, which is available on both RockPro64 and NanoPCT4, but unfortunately not availaible on RockPi4B ...

For RockPi4B, you will have to either do yourself a custom build with a patch that change this pin, or decompile/edit/recompile de overlay itself.

In longer terms, I will try to make the "param_w1_pin" available and working in /boot/armbianEnv.txt, but it can take while ...

Share this post


Link to post
Share on other sites
5 hours ago, atula said:

what pin is w1 default pin ?

Finally, the "param_w1_pin" management task didn't took too long ... ;)

 

Commits needed :

https://github.com/armbian/build/commit/aba46df74255c7684112a921014dab75bafd3414

https://github.com/armbian/build/commit/e4e34c7f15b33a3a186033a0c40555c208f035ee

 

I've tested it by providing "param_w1_pin=GPIO4_C5"  as an alternate pin on RockPro64, and it is now working ... :rolleyes:

 

EDIT : additional commits for other RK3399 boards have been added ...

Share this post


Link to post
Share on other sites

w1 works "param_w1_pin=GPIO4_D5"  ok

 

how to find i2c

 

root@rockpi:~# dmesg|grep i2c
[    1.543735] i2c /dev entries driver

and
root@rockpi:~# ls /dev/*i2c*
/dev/i2c-0  /dev/i2c-1	/dev/i2c-3  /dev/i2c-4

i2cdetect find nothing

Share this post


Link to post
Share on other sites
4 hours ago, atula said:

i2cdetect find nothing

Which I2C are you using, the one on the RockPi Header ? It is I2C7, which need the new overlay just committed ...

Which device did you connect to that bus ?

Share this post


Link to post
Share on other sites

GPIO2_A7, GPIO2_B0,  like raspberry

or GPIO2_A0, GPIO2_A1

or ?

 

BMP280, ds2482, ds2483 and ADS115...

 

+

i have two, rockpi4a and rockpi4b, how i repare MAC adress

Share this post


Link to post
Share on other sites
41 minutes ago, atula said:

GPIO2_A7, GPIO2_B0,  like raspberry

or GPIO2_A0, GPIO2_A1

or ?

Right ! I2C7 is on GPIO2_A7/GPIO2_B0 ... (but what do you mean by "like raspberry" ?)

50 minutes ago, atula said:

i have two, rockpi4a and rockpi4b, how i repare MAC adress

What do you mean ?

Share this post


Link to post
Share on other sites

two same addresses do not work on the same network, the other must be different (dhcp IP)

 

"/dev/i2c-0 /dev/i2c-1 /dev/i2c-3 /dev/i2c-4" none is working

Share this post


Link to post
Share on other sites
14 minutes ago, atula said:

two same addresses do not work on the same network, the other must be different (dhcp IP)

I understand, but are those two RockPi has the same MAC ?

 

14 minutes ago, atula said:

"/dev/i2c-0 /dev/i2c-1 /dev/i2c-3 /dev/i2c-4" none is working

As I said, the I2C on the RockPi header are not one of those, it is I2C7 ! You need to enable it either in Main DT or using a overlay for the node i2c@ff160000

Share this post


Link to post
Share on other sites

WD Black 500GB, PCIe, 3400/2500 MB/s - SSD- M.2 works  only Armbian_5.67_Rockpi4b_Debian_stretch_default_4.4.154_desktop_20181210-gpt.img.gz

i'll test later other (Kingston 240GB A1000, PCIe NVMe, 1500/1000 MB/s -SSD) SSD disks, other armbian images not working this M.2 SSD disk

 

Armbian_5.73.190128_Rockpi-4b_Debian_stretch_dev_4.20.0.img PCIe NVMe not work

 

can i download Armbian_5.67_Rockpi4b_Debian_stretch_default_4.4.154_desktop_20181210-gpt.img.gz without a desktop this img?

Share this post


Link to post
Share on other sites
11 minutes ago, atula said:

Armbian_5.73.190128_Rockpi-4b_Debian_stretch_dev_4.20.0.img

That is normal that RockPi-4B doesn't work with PCIe, it is not part of current DT !

Maybe in the future ...

Share this post


Link to post
Share on other sites
On 3/6/2019 at 4:17 PM, martinayotte said:

This UART is UART3, and according to DT, it is pins GPIO3_B6 and GPIO3_B7 ...

But be aware that those pins are used on most of the boards for the Ethernet GMAC !

Since we still don't have access to RockPi4B schematic, it is a bit hard to confirm ...

 

If you are looking for serial@ff180000, it is UART0, than the pins are GPIO2_C0 and GPIO2_C1, which on some board is a UART connected to BlueTooth.

 

If you are looking at the UART available on Header at usual pin 8/10, it is GPIO4_C3 and GPIO4_C4, which is the UART2 located in node serial@ff1a0000.

i have rockpi 4 A model without bluetooth, its possible  use serial@ff180000 UART0  gpio like  GPIO4_D5,  (RX)

Share this post


Link to post
Share on other sites
11 minutes ago, atula said:

i have rockpi 4 A model without bluetooth, its possible  use serial@ff180000 UART0  gpio like  GPIO4_D5,  (RX)

What do you mean ?

I don't have Model A schematic ... Is the GPIO2_C0/GPIO2_C1 are available on some header pins ? ... It is not the case for Model B ...

Share this post


Link to post
Share on other sites
On 3/1/2019 at 4:32 PM, martinayotte said:

 

You need to install DT compiler from : http://ftp.debian.org/debian/pool/main/d/device-tree-compiler/device-tree-compiler_1.4.7-3_arm64.deb

 

Backup /boot/dtb/rockchip/rk3399-rockpi4b.dtb into /boot/dtb/rockchip/rk3399-rockpi4b.dtb-ORIG

 

Decompile the DTB into DTS :


dtc -@ -I dtb -O dts -o rk3399-rockpi4b.dts-4.20.0 /boot/dtb/rockchip/rk3399-rockpi4b.dtb

Edit the file rk3399-rockpi4b.dts-4.20.0 by changing all the serial node from "disabled" to "okay", then recompile DTB :


dtc -@ -I dts -O dtb -o /boot/dtb/rockchip/rk3399-rockpi4b.dtb rk3399-rockpi4b.dts-4.20.0

 

2

Thank you very much, this helped a lot!
 

some details who may help others: (note: I'm not an expert)
install DT compiler version from the above link, not from online mirrors.
to do so cd into temp directory, curl or wget the above url and chown +x the file as executable
Then install with apt

cd /tmp
wget http://ftp.debian.org/debian/pool/main/d/device-tree-compiler/device-tree-compiler_1.4.7-3_arm64.
sudo chown +x device-tree-compiler_1.4.7-3_arm64
sudo apt install device-tree-compiler_1.4.7-3_arm64

decompile DTB to DTS as mentioned above.

 

open the decompiled file and lookup for the interface in the aliases section (e.g. i2c7)
You will find the address (e.g. i2c@ff160000)
scroll down now to this address and verify that status is set to okay

status = "okay";

if not change and re-compile to DTB

 

As I'm not an expert I wonder if it's possible to change or increase the i2c baudrate to 400 kHz ?

I found descriptions to add 

dtparam=i2c_arm=on,i2c_baudrate=400000

to /boot/config.txt

As Armbian hasn't this config file I tried to add the same line to /boot/armbianEnv.txt but it doesn't seem to have any effect.

Share this post


Link to post
Share on other sites
2 hours ago, gufmar said:

Then install with apt


cd /tmp
wget http://ftp.debian.org/debian/pool/main/d/device-tree-compiler/device-tree-compiler_1.4.7-3_arm64.
sudo chown +x device-tree-compiler_1.4.7-3_arm64
sudo apt install device-tree-compiler_1.4.7-3_arm64

The normal way to install is to do "dpkg -i device-tree-compiler_1.4.7-3_arm64.deb" ...

2 hours ago, gufmar said:

increase the i2c baudrate to 400 kHz ?

It should be done within the DT using "clock-frequency = <400000>;" in the i2c node, nearby the "status"

Share this post


Link to post
Share on other sites
On 4/8/2019 at 4:13 PM, martinayotte said:

It should be done within the DT using "clock-frequency = <400000>;" in the i2c node, nearby the "status"

perfect solution. works fine. thank you!

 

For thus who try to C&P the above clock-frequency string: Attention it contains non-standard space chars after the number. So compiling to dtb fil fail with an error. Better use

 

clock-frequency = <400000>;

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
4 4