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

yes, in all RockPi image use the same MAC. in radxa rock it modify in "parameter" txt, raspberry also

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.deb
sudo chmod +x device-tree-compiler_1.4.7-3_arm64.deb
sudo apt install device-tree-compiler_1.4.7-3_arm64.deb

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

Armbian_5.88_Rockpi-4b_Debian_stretch_default_4.4.180

what pin is w1 default pin ?

i not find /boot/dtb/rockchip/overlay

 

i try armbianEnv.txt
overlays=w1-gpio
param_w1_pin=GPIO4_D2

 

and

root@rockpi:/# lsmod
Module                  Size  Used by
w1_therm               16384  0
w1_gpio                16384  0
wire                   32768  2 w1_gpio,w1_therm

 

but nothing /sys/bus/w1/devices/

Share this post


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

i not find /boot/dtb/rockchip/overlay


Somebody needs to develop this feature, but since relation between developers and users wishes are extremely extreme, you can't use this feature unless you do it.

Here https://github.com/armbian/sunxi-DT-overlays you can observe overlays project made for Allwinner chips. As an example.

Share this post


Link to post
Share on other sites

Debian Buster with Armbian Linux 4.4.184-rockchip64

 

dev/ttyS2 , dev/ttyS4 not works, only read

dev /ttyUSB0 woks fine

 

root@rockpi:~# digitemp_DS9097U -i -s /dev/ttyS4 -c digitemp.conf
DigiTemp v3.7.2 Copyright 1996-2018 by Brian C. Lane
GNU General Public License v2.0 - http://www.digitemp.com
Error 5: DS2480B Adapter Not Detected
Error 10: Read COM Failed
 

root@rockpi:~# digitemp_DS9097U -i -s /dev/ttyUSB0 -c digitemp.conf
DigiTemp v3.7.2 Copyright 1996-2018 by Brian C. Lane
GNU General Public License v2.0 - http://www.digitemp.com
Turning off all DS2409 Couplers
.
Searching the 1-Wire LAN
28208071030000A0 : DS18B20 Temperature Sensor
ROM #0 : 28208071030000A0

 

owfs works i2c adapter but not serial DS2480B, digitemp also.......maybe old systems

passive readers works both ...ttyS2 and ....ttyS4

 

only with latest stretch-bionic ttyS4 works DS2480B....ttyS2 not

 

and onewire works also now

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
4 4