Please enable javascript, or click here to visit my ecommerce web site powered by Shopify.
Jump to: navigation, search

Difference between revisions of "Rock3/Debian"

(Common Hardware Interfaces, I2C, PWM, SPI, UART, CAN, etc)
 
(74 intermediate revisions by 6 users not shown)
Line 8: Line 8:
  
 
== Work with ROCK 3 Debian ==
 
== Work with ROCK 3 Debian ==
 +
 
=== Introduction to ROCK 3 Debian ===
 
=== Introduction to ROCK 3 Debian ===
[[File:ROCKPI4-Debian-desktop.png | 800px ]]
 
  
ROCK 3 Debian  is an easy to use desktop system. While working with ROCK 3 Debian, you will find it do well on playing music, Internet, Bluetooth, AI and so on.
+
This guide is available for official ROCK 3 Debian images.
 +
   
 +
ROCK 3 Debian is an easy to use desktop system. While working with ROCK 3 Debian, you will find it do well on playing music, Internet, BT, AI and so on.
  
 
ROCK 3 Debian uses '''systemd''' to manage system.
 
ROCK 3 Debian uses '''systemd''' to manage system.
  
Command prepended by $ means the command may be executed by an unprivileged user. And command prepended by # means the command may be executed by an privileged user. But the symbol, $ or #, is not part of the command.
+
Command prepended by $ means the command may be executed by an unprivileged user. And command prepended by # means the command may be executed by an privileged user. But the symbol, $ or #, is not part of the command.
=== Use System Tool Terminal ===
+
  
There are three kinds of tools for Terminal. They are LXTerminal, ""UXTerm"" and ""XTerm"". You are encouraged to choose your favorite one.
+
=== List of boards supported ===
Click on the icon, flying bird, on the bottom left in the ROCK3 Debian's main window, and click on the icon, System Tools to select your wanted Terminal tool. Here is the LXTerminal as an example.
+
 
If you try to experience more excitement, just as we want you to do that, you can type the following command to be a super user.
+
* ROCK 3A
  $ sudo su
+
* ROCK 3B
 +
* Radxa E23
 +
* Radxa E25
 +
* Radxa CM3 IO
  
[[File:terminal-LXTerminal.png | 800px ]]
 
 
=== Access from the Host PC/Laptop ===
 
=== Access from the Host PC/Laptop ===
  
 
==== Option 1: Serial console ====
 
==== Option 1: Serial console ====
  
Check [[rock3/dev/serial-console | Serial Console]]
+
See [[rock3/dev/serial-console | Serial Console]]
 +
 
 
==== Option 2: SSH ====
 
==== Option 2: SSH ====
 +
 
SSH server  is enabled on port 22 of ROCK 3 default image.  
 
SSH server  is enabled on port 22 of ROCK 3 default image.  
  
Please use [https://angryip.org/ angryip] or use this command '''"ifconfig"''' by serial console to find your board IP address.
+
Please use [https://angryip.org/ angryip] to find your board IP address.
 +
 
 +
$ ping ip-of-device
 +
$ ssh rock@ip-of-device
  
  $ ping ip-of-device
 
  $ ssh linaro@ip-of-device
 
 
=== Debian Default User Account ===
 
=== Debian Default User Account ===
  
 
Non-root User:
 
Non-root User:
  
  User Name : linaro
+
User Name : rock
  Password  : linaro
+
Password  : rock
  
===Desktop ===
+
=== Build ===
  
The preinstalled Desktop is xfce4.
+
{| class="wikitable"
=== Install and update  necessary packages ===
+
|-
 +
! XFCE4 Desktop || Server
 +
|-
 +
| * ROCK 3A<br>* ROCK 3B<br>* Radxa CM3 IO || * Radxa E23<br>* Radxa E25
 +
|}
  
Add Radxa APT, see [[rock3/radxa-apt | Radxa APT]].
+
=== Radxa APT ===
  
Install packages;
+
Radxa APT source includes stable one and testing one. Stable source includes stable packages while testing source includes latest but maybe unstable packages.
  
  $ sudo apt-get update
+
Radxa APT stable source is added by default while testing source is not added.
  $ sudo apt-get install -y rockchip-overlay
+
  $ sudo apt-get install -y linux-4.4-rock-3-latest
+
  
=== Network Connection ===
+
You can uncomment line like "deb http://apt.radxa.com/buster-testing/ buster main" in file /etc/apt/sources.list.d/apt-radxa-com.list to add testing source.
  
There are two methods for network connection. One is Ethernet and the other is WIFI.
+
See file /etc/apt/sources.list.d/apt-radxa-com.list
==== Ethernet Connection ====
+
You can use a network cable (one end connected to the external network port or route)  to connect your ROCK 3 to the network. The ROCK 3 will automatically configure the network for your surfing on the Internet.
+
  
===== To test the Ethernet, we need to follow the steps: =====
+
deb http://apt.radxa.com/buster-stable/ buster main
 +
deb http://apt.radxa.com/buster-testing/ buster main
  
* Check whether the Ethernet is normal by command, '''ifconfig''', which would show us a network card, eth0, and the Ethernet IP address. Also, use tool, ping, to connect to a normal domain.  
+
After adding testing source, you need to update APT and install your needed packages.
  
  $ ifconfig
+
$ sudo apt-get update
  $ ping www.baidu.com
+
  
* If failed to connect to a normal domain. , try
+
For more detail about Radxa APT, please see [[rock3/radxa-apt | Radxa APT]].
  
  $ sudo dhclient eth0
+
=== Upgrade necessary packages ===
  
==== WIFI Connection ====
+
Here is the example of upgrading rockchip-overlay and kernel packages.
When there is not a network cable for your ROCK Pi N10 the WIFI connection is another good choice. ROCK Pi N10 supports 2.4G/5G WIFI wireless network.
+
Pakcage linux-4.19-rock-3-latest provides the latest ROCK 3 kernel packages.
  
 +
$ sudo apt-get update
 +
$ sudo apt-get install -y rockchip-overlay
 +
$ sudo apt-get install -y linux-4.19-rock-3-latest
  
=== Check the DDR Menory ===
+
=== Check DDR size ===
Rock3a  has several different DDR memory sizes, such as 2G, 4G, 8G.
+
 
  $ free -h
+
ROCK 3 comes in several different DDR sizes, such as 1G, 2G, 4G, 8G, etc.
 +
Here shows 8GB RAM on ROCK 3A.
 +
 
 +
  root@rock-3a:~# free -h
 
               total        used        free      shared  buff/cache  available
 
               total        used        free      shared  buff/cache  available
 
  Mem:          '''7.4Gi'''        72Mi      7.1Gi        16Mi      182Mi      7.2Gi  
 
  Mem:          '''7.4Gi'''        72Mi      7.1Gi        16Mi      182Mi      7.2Gi  
 
  Swap:            0B          0B          0B
 
  Swap:            0B          0B          0B
For example, the DDR memory on this board is 8G.
+
 
 
=== Storage device ===
 
=== Storage device ===
  
Line 89: Line 101:
 
* uSD Card: /dev/mmcblk1
 
* uSD Card: /dev/mmcblk1
 
* NVME M.2 SDD:  /dev/nvme0n1
 
* NVME M.2 SDD:  /dev/nvme0n1
 +
 +
=== NPU ===
 +
 +
SoC RK3566/RK3568 is equipped with 0.8TOPS NPU.
 +
See [[rock3/dev/npu-run-test | NPU Run Test]] to test it on your ROCK 3 boards.
 +
 +
=== <span id="gpio">General purpose input-output (GPIO) </span> ===
 +
 +
* ROCK 3A has one 40-pin expansion header. To control them, see [[rock3/hardware/rock3a-gpio | ROCK 3A GPIO ]].
 +
 +
 +
 +
 +
 +
=== <span id="leds">LEDS </span> ===
 +
 +
<div class="bs-example bs-example-tabs">
 +
        <ul id="tabeth" class="nav nav-tabs nav-justified nav-tabs" style="margin:0;">
 +
            <li class="active" data-toggle="tab">[http://wiki.radxa.com/Nav_Tabs#leds-3a ROCK 3A]</li>
 +
            <li data-toggle="tab"> [http://wiki.radxa.com/Nav_Tabs#leds-3b ROCK 3B]</li>
 +
            <li data-toggle="tab"> [http://wiki.radxa.com/Nav_Tabs#leds-3c ROCK 3C]</li>
 +
            <li data-toggle="tab">[http://wiki.radxa.com/Nav_Tabs#leds-cm3io CM3 IO]</li>         
 +
        </ul>
 +
</div>
 +
        <div id="tabeth" class="tab-content">
 +
 +
            <div class="tab-pane active" id="leds-3a">
 +
 +
            </div>  <!--  id="leds-3a" end-->
 +
 +
          <div id="leds-3b" class="tab-pane">
 +
 +
          </div>  <!--  id="leds-3b" end-->
 +
          <div id="leds-3c" class="tab-pane">
 +
The two leds are configured as LED class devices, you can control them via /sys/class/leds/
 +
 +
Green: Flash twice per second after the kernel booting, it's called heartbeat.
 +
 +
Blue: On when there is  power
 +
 +
You can change the behaviour of each LED by using the echo command on their trigger property.
 +
root@rock-3c:/home/rock#  echo none > /sys/class/leds/user-led1/trigger
 +
root@rock-3c:/home/rock#  echo default-on > /sys/class/leds/user-led1/trigger
 +
root@rock-3c:/home/rock#  echo timer > /sys/class/leds/user-led1/trigger
 +
root@rock-3c:/home/rock#  echo heartbeat > /sys/class/leds/user-led1/trigger
 +
 +
You can use cat on the trigger property to list all the available values.
 +
root@rock-3c:/home/rock# cat /sys/class/leds/user-led1/trigger
 +
none rfkill-any rfkill-none kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock
 +
kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock mmc1 mmc2 mmc0 timer oneshot disk-activity disk-read disk-write ide-disk mtd 
 +
nand-disk [heartbeat] backlight gpio cpu cpu0 cpu1 cpu2 cpu3 activity default-on transient flash torch panic netdev rfkill0 rfkill1
 +
 +
 +
          </div>  <!--  id="leds-3c" end-->
 +
            <div class="tab-pane active" id="leds-cm3io">
 +
 +
            </div>  <!--  id="leds-cm3io" end-->
 +
 +
          </div>
 +
 +
=== <span id="common_hardware_interface">Common Hardware Interfaces, I2C, PWM, SPI, UART, CAN, etc</span> ===
 +
 +
The ROCK 3 system images use configuration file /boot/uEnv.txt or /boot/extlinux/extlinux.conf, if the  system you use has /boot/uEnv.txt file, you can see the following, if the system you use has /boot/extlinux/extlinux.conf, please refer to this  [[Rock3/extlinux | extlinu.conf]]  setting.
 +
 +
'''Warning: Remember there is only one line including item "overlays=" in file /boot/uEnv.txt.'''
 +
 +
To enable I2C, PWM, SPI, UART, CAN, etc, please see '''RK3566/RK3568 Available Overlay (ROCK 3A, ROCK 3B, Radxa CM3)''' part of [[rock3/Debian/device-tree-overlays | Device Tree Overlays]]
 +
<div class="bs-example bs-example-tabs">
 +
        <ul id="tabeth" class="nav nav-tabs nav-justified nav-tabs" style="margin:0;">
 +
            <li class="active" data-toggle="tab">[http://wiki.radxa.com/Nav_Tabs#common-hardware-interface-3a ROCK 3A]</li>
 +
            <li data-toggle="tab"> [http://wiki.radxa.com/Nav_Tabs#common-hardware-interface-3b ROCK 3B]</li>
 +
            <li data-toggle="tab"> [http://wiki.radxa.com/Nav_Tabs#common-hardware-interface-3c ROCK 3C]</li>
 +
            <li data-toggle="tab">[http://wiki.radxa.com/Nav_Tabs#common-hardware-interface-cm3io CM3 IO]</li>         
 +
        </ul>
 +
</div>
 +
        <div id="tabeth" class="tab-content">
 +
 +
            <div class="tab-pane active" id="common-hardware-interface-3a">
 +
 +
==== I2C ====
 +
 +
To enable I2C-2 (/dev/i2c-2), add item "rk3568-i2c2-m0" to the "overlays=" line.
 +
 +
  overlays=rk3568-i2c2-m0
 +
 +
To enable I2C-3 (/dev/i2c-3), add item "rk3568-i2c3-m0" to the "overlays=" line.
 +
 +
  overlays=rk3568-i2c3-m0
 +
 +
==== PWM ====
 +
 +
===== PWM0 =====
 +
====== Option 1: PWM0-M0 ======
 +
To enable PWM0-M0, add item "rk3568-pwm0-m0" to the "overlays=" line.
 +
 +
overlays=rk3568-pwm0-m0
 +
 +
The related directory <code>/sys/devices/platform/fdd70000.pwm/pwm/pwmchip*</code> will be created.
 +
And you can do the operation in the directory.
 +
 +
====== Option 2: PWM0-M1 ======
 +
To enable PWM0-M0, add item "rk3568-pwm0-m1" to the "overlays=" line.
 +
 +
overlays=rk3568-pwm0-m1
 +
 +
The related directory <code>/sys/devices/platform/fdd70000.pwm/pwm/pwmchip*</code> will be created.
 +
 +
===== PWM1=====
 +
===== PWM1-M1 =====
 +
To enable PWM11-M1, add item "rk3568-pwm1-m1" to the "overlays=" line.
 +
 +
overlays=rk3568-pwm1-m1
 +
 +
The related directory <code>/sys/devices/platform/fdd70010.pwm/pwm/pwmchip*</code> will be created.
 +
 +
==== SPI ====
 +
 +
==== UART ====
 +
System default enable uart2-m0 (/dev/ttyS2) to be debug console.
 +
 +
  overlays=rk3568-fiq-debugger-uart2m0
 +
 +
If you want to enable uart2-m0 (/dev/ttyS2) to be normal console, modify item "rk3568-uart2-m0" to the "overlays=" line.
 +
 +
  overlays=rk3568-uart2-m0
 +
 +
==== CAN ====
 +
 +
            </div> <!--  id="common-hardware-interface-3a" end-->
 +
 +
            <div id="common-hardware-interface-3b" class="tab-pane">
 +
 +
==== I2C ====
 +
 +
==== PWM ====
 +
 +
==== SPI ====
 +
 +
==== UART ====
 +
 +
==== CAN ====
 +
 +
 +
            </div> <!--  id="common-hardware-interface-3b" end-->
 +
 +
 +
            <div id="common-hardware-interface-cm3io" class="tab-pane">
 +
 +
==== I2C ====
 +
 +
==== PWM ====
 +
 +
==== SPI ====
 +
 +
==== UART ====
 +
 +
 +
            </div><!--  id="common-hardware-interface-cm3io" end-->
 +
        </div>
  
 
=== Test RTC Device ===
 
=== Test RTC Device ===
First, plug in RTC battery and power on.Check the rtc device:
 
root@linaro-alip:~# dmesg | grep rtc
 
[    0.328780] [drm] Cannot find any crtc or sizes
 
[    0.328964] [drm] Cannot find any crtc or sizes
 
[    0.749597] rk808-rtc rk808-rtc: registered as rtc0
 
[    0.751404] rk808-rtc rk808-rtc: setting system clock to 2017-08-04 09:00:02 UTC (1501837202)
 
  
Second, use the follow commands to set the system time and synchronization to the rtc clock.
+
ROCK 3A is equipped with one RTC IC hym8563.
  $ date -s "2021-08-17 20:03:00"
+
 
  $ hwclock -w
+
Firstly, plug in [[rock3/hardware/rtc | RTC battery]] to give power to RTC IC. Please note that we should keep the RTC battery in the RTC connector.
$ hwclock -r
+
 
  root@linaro-alip:~# hwclock -r
+
Plug in power adaper to power on ROCK 3A.
 +
 
 +
And confirm that the rtc hym8563 device is created.
 +
 
 +
root@rock3a:~# dmesg | grep rtc
 +
[    1.128345] rk808-rtc rk808-rtc: registered as rtc0
 +
[    1.130163] rk808-rtc rk808-rtc: setting system clock to 2017-08-04 09:00:05 UTC (1501837205)
 +
[    2.801453] rtc-hym8563 5-0051: rtc core: registered hym8563 as rtc1
 +
 
 +
Secondly, use the following commands to set the system time and synchronize it to rtc1.
 +
 
 +
  root@rock3a:~# date -s "2021-08-17 20:00:00"
 +
  root@rock3a:~# hwclock -w -f /dev/rtc1
 +
  root@rock3a:~# hwclock -r -f /dev/rtc1
 
  2021-08-17 20:00:04.745124+00:00
 
  2021-08-17 20:00:04.745124+00:00
  $ poweroff
+
  root@rock3a:~# poweroff
and then disconnect the power supply
+
 
Third, back to power after 10 mins and check whether the rtc clock run the same time
+
and then remove the power adapter.
$ hwclock -r
+
 
  root@linaro-alip:~# hwclock -r
+
Finally, 10 minutes later we power on ROCK 3A via Type-C Port and check the rtc clock.
 +
 
 +
  root@rock3a:~# hwclock -r -f /dev/rtc1
 
  2021-08-17 20:10:14.745124+00:00
 
  2021-08-17 20:10:14.745124+00:00
 +
 +
We see that rtc runs about 10 minutes also. That's good.
  
 
=== Test Audio Player===
 
=== Test Audio Player===
Download a wav audio file, and use the command to test.
+
 
  $ aplay -D plughw:1,0 xxx.wav
+
Download a wav audio file, and use the command to test the HP player.
 +
 
 +
  $ amixer -c 1 cset numid=1 3
 +
    numid=1,iface=MIXER,name='Playback Path'
 +
  ; type=ENUMERATED,access=rw------,values=1,items=11
 +
  ; Item #0 'OFF'
 +
  ; Item #1 'RCV'
 +
  ; Item #2 'SPK'
 +
  ; Item #3 'HP'
 +
  ; Item #4 'HP_NO_MIC'
 +
  ; Item #5 'BT'
 +
  ; Item #6 'SPK_HP'
 +
  ; Item #7 'RING_SPK'
 +
  ; Item #8 'RING_HP'
 +
  ; Item #9 'RING_HP_NO_MIC'
 +
  ; Item #10 'RING_SPK_HP'
 +
  : values=3
 
   
 
   
  root@linaro-alip:~# aplay -D plughw:1,0 6.wav  
+
  $ aplay -D plughw:1,0 test.wav
  xcb_connection_has_error() returned true
+
  Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
  Playing WAVE '6.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
+
   
=== Test USB Host ===
+
To test the Mic recording, please follow:
Plug in the U dish and use the command by serial console.
+
$ amixer -c 1 cset numid=2 1
$ '''dmesg | tail'''
+
$ arecord -Dhw:1,0 -d 10 -f cd -r 44100 -c 2 -t wav ./mic_test.wav      #this is a record command
  [  133.773558] usb 2-1: SerialNumber: CCYYB18M1CFKO4H4
+
  Recording WAVE './mic_test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
  [ 133.774332] usb-storage 2-1:1.0: USB Mass Storage device detected
+
$ aplay -D plughw:1,0 mic_test.wav
  [  133.774657] scsi host0: usb-storage 2-1:1.0
+
 
  [ 134.841096] scsi 0:0:0:0: Direct-Access    aigo    U350            1100 PQ: 0 ANSI: 6
+
=== Test USB Host Ports ===
  [ 134.846394] sd 0:0:0:0: [sda] 30720000 512-byte logical blocks: (15.7 GB/14.6 GiB)
+
 
  [ 134.847554] sd 0:0:0:0: [sda] Write Protect is off
+
There are two USB 2.0 host ports and two USB 3.0 host ports.
  [ 134.847635] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
+
 
  [  134.848824] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
+
Plug in U Disk and fire command ''lsblk''. Here /dev/sda is related to U Disk.
  '''[ 134.858173sda: sda1'''
+
 
  [ 134.861161] sd 0:0:0:0: [sda] Attached SCSI removable disk
+
<pre>
 +
root@rock-3a:~# lsblk
 +
NAME        MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
 +
sda            8:0    1 14.4G  0 disk
 +
|-sda1        8:1   1  200M  0 part
 +
`-sda2        8:2    1 14.2G  0 part
 +
mmcblk0      179:0    0 14.5G  0 disk
 +
|-mmcblk0p1 179:1    0 512M  0 part /boot
 +
`-mmcblk0p2  179:2   0  14G  0 part /
 +
mmcblk0boot0 179:32  0    4M  1 disk
 +
mmcblk0boot1 179:64  0    4M  1 disk
 +
</pre>
 +
 
 +
Mount U Disk.
 +
 
 +
<pre>
 +
root@rock-3a:~# mount /dev/sda2 /mnt/
 +
</pre>
 +
 
 +
Confirm that U Disk is mounted.
 +
 
 +
<pre>
 +
root@rock-3a:~# lsblk
 +
NAME        MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
 +
sda            8:0    1 14.4G  0 disk
 +
|-sda1        8:1    1  200M  0 part
 +
`-sda2        8:2   1 14.2G  0 part /mnt
 +
mmcblk0      179:0    0 14.5G  0 disk
 +
|-mmcblk0p1 179:1    0  512M 0 part /boot
 +
`-mmcblk0p2  179:2    0   14G  0 part /
 +
mmcblk0boot0 179:32  0   4M  1 disk
 +
mmcblk0boot1 179:64  0   4M  1 disk
 +
</pre>
 +
 
 +
 
 +
=== Control PWM Fan ===
 +
 
 +
There is one 3-pin PWM Fan header on ROCK 3A/3B/3C.
 +
 
 +
To control it, try the following steps.
 +
 
 +
* Step 1: Add rk3568-pwm8-m0-fan overlay
 +
 
 +
You need to add the item "rk3568-pwm8-m0-fan" to line "overlays=" in file /boot/uEnv.txt.
 +
For example.
 +
 
 +
root@rock-3a:~# cat /boot/uEnv.txt | grep overlays=
 +
overlays=rk3568-can1-m0 '''rk3568-pwm8-m0-fan'''
 +
 
 +
* Step 2: Reboot ROCK 3A/3B/3C  and confirm that the directory '''/sys/devices/platform/fe*.pwm''' related to pwm8 is created.
 +
 
 +
  root@rock-3a:~# ls /sys/devices/platform/fe6f0000.pwm
 +
  driver driver_override  modalias  of_node  power  pwm subsystem  uevent
 +
 
 +
* Step 3: Set PWM period, duty_cycle, polarity and enable with '''root permission'''.
 +
 
 +
root@rock-3a:~# echo 0 > /sys/devices/platform/fe*.pwm/pwm/pwmchip*/export
 +
root@rock-3a:~# echo 10000 > /sys/devices/platform/fe*.pwm/pwm/pwmchip*/pwm0/period
 +
root@rock-3a:~# echo 5000 > /sys/devices/platform/fe*.pwm/pwm/pwmchip*/pwm0/duty_cycle
 +
root@rock-3a:~# echo normal > /sys/devices/platform/fe*.pwm/pwm/pwmchip*/pwm0/polarity
 +
root@rock-3a:~# echo 1 > /sys/devices/platform/fe*.pwm/pwm/pwmchip*/pwm0/enable # Turn on fan
 +
root@rock-3a:~# echo 0 > /sys/devices/platform/fe*.pwm/pwm/pwmchip*/pwm0/enable # Turn off fan
 +
   
 +
          </div>  <!--  id="3b-bt" end-->
 +
=== Ethernet ===
 +
 
 +
<div class="bs-example bs-example-tabs">
 +
        <ul id="tabeth" class="nav nav-tabs nav-justified nav-tabs" style="margin:0;">
 +
            <li class="active" data-toggle="tab">[http://wiki.radxa.com/Nav_Tabs#3a ROCK 3A]</li>
 +
            <li data-toggle="tab"> [http://wiki.radxa.com/Nav_Tabs#3b ROCK 3B]</li>
 +
            <li data-toggle="tab">[http://wiki.radxa.com/Nav_Tabs#cm3io CM3 IO]</li>         
 +
        </ul>
 +
</div>
 +
        <div id="tabeth" class="tab-content">
 +
 
 +
            <div class="tab-pane active" id="3a">
 +
==== Ethernet for ROCK 3A ====
 +
 
 +
ROCK 3A is equipped with one 1G Ethernet port.
 +
You can use a network cable (one end connected to the external network port or route) to connect your ROCK 3 to the network.
 +
The ROCK 3 will automatically configure the network for your surfing on the Internet.
 +
 
 +
===== To test the Ethernet, we need to follow the steps: =====
 +
 
 +
* Switch to super user mode by command
 +
$ sudo su
 +
 
 +
* Check whether the Ethernet is normal by command, ifconfig, which would show us a network card, eth0, and the Ethernet IP address. Also, use tool, ping, to connect to a normal domain.
 +
 
 +
$ ifconfig
 +
$ ping www.baidu.com
 +
 
 +
* If failed to connect to a normal domain. , try
 +
 
 +
$ sudo dhclient eth0
 +
 
 +
            </div> <!--  id="3a" end-->
 +
 
 +
            <div id="3b" class="tab-pane">
 +
 
 +
==== Ethernet for ROCK 3B ====
 +
 
 +
ROCK 3B is equipped with two 1G Ethernet ports.
 +
You can use two network cable (one end connected to the external network port or route) to connect your ROCK 3B to the network.
 +
The ROCK 3B will automatically configure the network for your surfing on the Internet.
 +
 
 +
===== To test the Ethernet, we need to follow the steps: =====
 +
 
 +
* Switch to super user mode by command
 +
  $ sudo su
 +
 
 +
* Check whether the Ethernet is normal by command, ifconfig, which would show us two network card, eth0 and eth1, and the Ethernet IP address. Also, use tool, ping, to connect to a normal domain.
 +
 
 +
  $ ifconfig
 +
$ ping www.baidu.com
 +
 
 +
* If failed to connect to a normal domain. , try
 +
 
 +
$ sudo dhclient eth0
 +
$ sudo dhclient eth1
 +
 
 +
            </div>  <!--  id="3b" end-->
 +
 
 +
            <div id="cm3io" class="tab-pane">
 +
 
 +
==== Ethernet for CM3 IO Board ====
 +
 
 +
CM3 IO is equipped with one 1G Ethernet port.
 +
You can use a network cable (one end connected to the external network port or route) to connect your CM3 IO to the network.
 +
CM3 IO will automatically configure the network for your surfing on the Internet.
 +
 
 +
===== To test the Ethernet, we need to follow the steps: =====
 +
 
 +
* Switch to super user mode by command
 +
$ sudo su
 +
 
 +
* Check whether the Ethernet is normal by command, ifconfig, which would show us a network card, eth0, and the Ethernet IP address. Also, use tool, ping, to connect to a normal domain.
 +
 
 +
$ ifconfig
 +
$ ping www.baidu.com
 +
 
 +
* If failed to connect to a normal domain. , try
 +
 
 +
$ sudo dhclient eth0
 +
 
 +
            </div><!--  id="cm3io" end-->
 +
        </div>
 +
 
 +
=== WiFi ===
 +
 
 +
<div class="bs-example bs-example-tabs">
 +
        <ul id="tabeth" class="nav nav-tabs nav-justified nav-tabs" style="margin:0;">
 +
            <li class="active" data-toggle="tab">[http://wiki.radxa.com/Nav_Tabs#3a-wifi ROCK 3A]</li>
 +
            <li data-toggle="tab"> [http://wiki.radxa.com/Nav_Tabs#3b-wifi ROCK 3B]</li>
 +
            <li data-toggle="tab">[http://wiki.radxa.com/Nav_Tabs#cm3io-wifi CM3 IO]</li>         
 +
        </ul>
 +
</div>
 +
        <div id="tabeth" class="tab-content">
 +
 
 +
            <div class="tab-pane active" id="3a-wifi">
 +
==== WiFi for ROCK 3A ====
 +
 
 +
Table of wireless modules supported on ROCK 3A.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Model
 +
! Chip
 +
! WiFi
 +
! BT
 +
! Others
 +
|-
 +
| ROCK Pi Wireless Module A1
 +
| BCM43436B0
 +
| 2.4G, 36Mbps
 +
| 4.2
 +
|
 +
|-
 +
| ROCK Pi Wireless Module A2
 +
| BCM43456
 +
| 2.4G&5G, 200Mbps
 +
| 5.0
 +
|
 +
|-
 +
| ROCK Pi Wireless Module A3
 +
| BCM43598
 +
| 2.4G&5G, >400Mbps
 +
| 5.0
 +
| Support RSDB
 +
|-
 +
| ROCK Pi Wireless Module A6
 +
| BCM43752
 +
| 2.4G&5G, WiFi 6
 +
| 5.0
 +
|
 +
|-
 +
| Realtek RTL8723BE
 +
| RTL8723BE
 +
| 2.4G
 +
| 4.0
 +
|
 +
|-
 +
| Realtek RTL8822CE
 +
| RTL8822CE
 +
| 2.4G&5G
 +
| 5.0
 +
|
 +
|-
 +
| Intel 0MHK36
 +
| Intel 3165
 +
| 2.4G&5G
 +
| 4.2
 +
|
 +
|-
 +
| Intel 7265NGW
 +
| Intel 7265
 +
| 2.4G&5G
 +
| 4.2
 +
|
 +
|}
 +
 
 +
            </div> <!--  id="3a-wifi" end-->
 +
 
 +
            <div id="3b-wifi" class="tab-pane">
 +
==== WiFi for ROCK 3B====
 +
 
 +
Table of wireless modules supported on ROCK 3B.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Model
 +
! Chip
 +
! WiFi
 +
! BT
 +
! Others
 +
|-
 +
| AP7275S
 +
| BCM43752
 +
| 2.4G&5G, WiFi 6
 +
| 5.0
 +
|}
 +
 
 +
            </div>  <!--  id="3b-wifi" end-->
 +
 
 +
            <div id="cm3io-wifi" class="tab-pane">
 +
 
 +
==== WiFi for CM3 IO Board ====
 +
 
 +
            </div><!--  id="cm3io-wifi" end-->
 +
        </div>
 +
 
 +
==== To test the WIFI performance, we need to follow the steps: ====
 +
 
 +
* Switch to super user mode
 +
$ sudo su
 +
 
 +
* Open the WIFI
 +
$ nmcli r wifi on
 +
 
 +
* Scan WIFI
 +
$ nmcli dev wifi
 +
 
 +
* Connect to WIFI network
 +
$ nmcli dev wifi connect "wifi_name" password "wifi_password"
 +
 
 +
* Test WIFI perpormance by tool iperf3.
 +
 
 +
=== BT ===
 +
 
 +
<div class="bs-example bs-example-tabs">
 +
        <ul id="tabeth" class="nav nav-tabs nav-justified nav-tabs" style="margin:0;">
 +
            <li class="active" data-toggle="tab">[http://wiki.radxa.com/Nav_Tabs#3a-bt ROCK 3A]</li>
 +
            <li data-toggle="tab"> [http://wiki.radxa.com/Nav_Tabs#3b-bt ROCK 3B]</li>
 +
            <li data-toggle="tab"> [http://wiki.radxa.com/Nav_Tabs#3c-bt ROCK 3C]</li>
 +
            <li data-toggle="tab">[http://wiki.radxa.com/Nav_Tabs#cm3io-bt CM3 IO]</li>         
 +
        </ul>
 +
</div>
 +
        <div id="tabeth" class="tab-content">
 +
 
 +
            <div class="tab-pane active" id="3a-bt">
 +
==== BT for ROCK 3A ====
 +
 
 +
Table of wireless modules supported on ROCK 3A.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Model
 +
! Chip
 +
! WiFi
 +
! BT
 +
! Others
 +
|-
 +
| ROCK Pi Wireless Module A1
 +
| BCM43436B0
 +
| 2.4G, 36Mbps
 +
| 4.2
 +
|
 +
|-
 +
| ROCK Pi Wireless Module A2
 +
| BCM43456
 +
| 2.4G&5G, 200Mbps
 +
| 5.0
 +
|
 +
|-
 +
| ROCK Pi Wireless Module A3
 +
| BCM43598
 +
| 2.4G&5G, >400Mbps
 +
| 5.0
 +
| Support RSDB
 +
|-
 +
| ROCK Pi Wireless Module A6
 +
| BCM43752
 +
| 2.4G&5G, WiFi 6
 +
| 5.0
 +
|
 +
|-
 +
| Realtek RTL8723BE
 +
| RTL8723BE
 +
| 2.4G
 +
| 4.0
 +
|
 +
|-
 +
| Realtek RTL8822CE
 +
| RTL8822CE
 +
| 2.4G&5G
 +
| 5.0
 +
|
 +
|-
 +
| Intel 0MHK36
 +
| Intel 3165
 +
| 2.4G&5G
 +
| 4.2
 +
|
 +
|-
 +
| Intel 7265NGW
 +
| Intel 7265
 +
| 2.4G&5G
 +
| 4.2
 +
|
 +
|}
 +
 
 +
Radxa APT includes '''broadcom-wifibt-firmware''' package for Broadcom wireless modules and '''intel-wifibt-firmware''' package for Intel wireless modules.
 +
Take a look at your module and download the corresponding packages.
 +
 
 +
For example:
 +
 
 +
root@rock3a:~# apt-get update -y
 +
root@rock3a:~# apt-get install -y broadcom-wifibt-firmware intel-wifibt-firmware
 +
 
 +
Below is the example of testing Broadcom modules BT.
 +
 
 +
*Check BT service.
 +
  root@rock3a:~# systemctl status bluetooth
 +
*Run BT service if the BT service is inactive.
 +
  root@rock3a:~# systemctl start bluetooth
 +
*Check BT device.
 +
root@rock3a:~# hciconfig
 +
hci0:  Type: Primary  Bus: UART
 +
        BD Address: 10:2C:6B:49:D5:53  ACL MTU: 1021:8  SCO MTU: 64:1
 +
        UP RUNNING
 +
        RX bytes:850 acl:0 sco:0 events:58 errors:0
 +
        TX bytes:2814 acl:0 sco:0 commands:58 errors:0
 +
*Example: Connect to BT Speaker.
 +
*Install pulseaudio packages.
 +
root@rock3a:~# apt-get install -y pulseaudio-module-bluetooth pulseaudio
 +
*Run pulseaudio.
 +
root@rock3a:~# pulseaudio --start
 +
*Connect using bluetoothctl.
 +
root@rock3a:~# bluetoothctl
 +
[bluetooth]# default-agent
 +
[bluetooth]# power on
 +
[bluetooth]# scan on
 +
[bluetooth]# trust 41:42:1A:8D:A9:65      #BT-280
 +
  [bluetooth]# pair 41:42:1A:8D:A9:65
 +
  [bluetooth]# connect 41:42:1A:8D:A9:65
 +
*Play songs and enjoy it.
 +
 
 +
            </div> <!--  id="3a-bt" end-->
 +
 
 +
            <div id="3b-bt" class="tab-pane">
 +
 
 +
==== BT for ROCK 3B ====
 +
 
 +
Table of wireless modules supported on ROCK 3B.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Model
 +
! Chip
 +
! WiFi
 +
! BT
 +
! Others
 +
|-
 +
| AP7275S
 +
| BCM43752
 +
| 2.4G&5G, WiFi 6
 +
| 5.0
 +
|}
 +
 
 +
            </div>  <!--  id="3b-bt" end-->
 +
 
 +
            <div id="3c-bt" class="tab-pane">
 +
 
 +
==== BT for ROCK 3C ====
 +
 
 +
Table of wireless modules supported on ROCK 3C.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Model
 +
! Chip
 +
! WiFi
 +
! BT
 +
! Others
 +
|-
 +
| AP6256
 +
| BCM4345C0
 +
| 2.4G&5G, WiFi 6
 +
| 5.0
 +
|}
 +
 
 +
 
 +
root@rock3c:~# apt-get update -y
 +
root@rock3c:~# apt-get install -y broadcom-wifibt-firmware
 +
root@rock3c:~# vi /usr/bin/brcmbt_set_dev_fw.sh
 +
 
 +
change line 59 contents " FIRMWARE="$FIRMWARE/BCM4345C5.hcd/" to  " FIRMWARE="$FIRMWARE/BCM4345C0.hcd/" ,
 +
rock@rock-3c:~$ aplay -l
 +
**** List of PLAYBACK Hardware Devices ****
 +
card 0: rockchiphdmi [rockchip,hdmi], device 0: fe400000.i2s-i2s-hifi i2s-hifi-0 [fe400000.i2s-i2s-hifi i2s-hifi-0]
 +
  Subdevices: 1/1
 +
  Subdevice #0: subdevice #0
 +
  card 1: rockchiprk809co [rockchip,rk809-codec], device 0: fe410000.i2s-rk817-hifi rk817-hifi-0 [fe410000.i2s-rk817-hifi rk817-hifi-0]
 +
  Subdevices: 1/1
 +
  Subdevice #0: subdevice #0
 +
choose the "card 1: rockchiprk809co " as default sound card
 +
  rock@rock-3c:~$ vi .asoundrc
 +
  defaluts.ctl.card 1
 +
  defaults.pcm.card 1
 +
 +
then reboot system
 +
 +
rock@rock-3c:~$ hciconfig
 +
hci0:  Type: Primary  Bus: UART
 +
          BD Address: E8:FB:1C:34:C8:98  ACL MTU: 1021:8  SCO MTU: 64:1
 +
          UP RUNNING PSCAN
 +
          RX bytes:5773 acl:40 sco:0 events:509 errors:0
 +
          TX bytes:505168 acl:852 sco:0 commands:66 errors:0
 +
root@rock3a:~# pulseaudio --start
 +
*Connect using bluetoothctl.
 +
root@rock3a:~# bluetoothctl
 +
[bluetooth]# default-agent
 +
[bluetooth]# power on
 +
[bluetooth]# scan on
 +
[bluetooth]# trust 41:42:1A:8D:A9:65      #BT-280
 +
[bluetooth]# pair 41:42:1A:8D:A9:65
 +
[bluetooth]# connect 41:42:1A:8D:A9:65
 +
*Play songs and enjoy it.
 +
rock@rock-3c:~$ sudo apt-get install mplayer
 +
rock@rock-3c:~$ mplayer path_to_your_song
 +
 
 +
 
 +
            </div>  <!--  id="3c-bt" end-->
 +
 
 +
 
 +
 
 +
            <div id="cm3io-bt" class="tab-pane">
 +
 
 +
==== Bluetooth for CM3 IO Board ====
 +
 
 +
            </div><!--  id="cm3io-bt" end-->
 +
        </div>
 +
 
 +
=== Set up Docker ===
 +
 
 +
Please refer to this guide, [[rock3/dev/install-docker-engineer-on-docker | Install Docker Engine on Debian]].
 +
 
 +
=== Changelogs of [https://github.com/radxa/debos-radxa/releases ROCK 3 Debian Release] ===
 +
 
 +
==== 2021.11.15 ====
 +
 
 +
'''rock3a_debian_buster_xfce4_arm64_20211113_0127-gpt.img'''
 +
 
 +
* Kernel version: 4.19.193-16-rockchip-g0cca7bdf9cdb
 +
* U-Boot version: 2017.09-gf95bc56c33d-210525
 +
* Support Intel Wireless 3165 / 7265 modules
 +
* Support boot.scr and dt overlays
 +
 
 +
==== 2021.09.15 ====
 +
 
 +
'''rock3a_debian_buster_xfce4_arm64_20210914_0334-gpt.img'''
 +
 
 +
* Kernel version: 4.19.193-10-rockchip-g152e34a538b4
 +
* Package broadcom-wifibt-firmware version: 1.3
 +
* Package rockchip-overlay version: 2.9
 +
* Package rtl8723be-firmware version: 0.1
 +
 
 +
==== 2021.08.24 ====
 +
 
 +
'''rock3a_debian_buster_xfce4_arm64_20210824_0136-gpt.img'''
  
$ '''sudo mount /dev/sda1 /mnt'''
+
* Kernel version: 4.19.193-2-rockchip-g7cf7399ddb5c
$ '''lsblk'''
+
* U-Boot version: 2017.09-gbd2fa07970e-210525
root@linaro-alip:~# lsblk
+
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
+
sda            8:0    1 14.7G  0 disk
+
└─sda1        8:1    1 14.7G  0 part /mnt
+
If  /dev/sda1 is successfully mounted, this usb host is working properly.
+

Latest revision as of 06:10, 8 November 2022

    ROCK 3 >  Debian

Work with ROCK 3 Debian

Introduction to ROCK 3 Debian

This guide is available for official ROCK 3 Debian images.

ROCK 3 Debian is an easy to use desktop system. While working with ROCK 3 Debian, you will find it do well on playing music, Internet, BT, AI and so on.

ROCK 3 Debian uses systemd to manage system.

Command prepended by $ means the command may be executed by an unprivileged user. And command prepended by # means the command may be executed by an privileged user. But the symbol, $ or #, is not part of the command.

List of boards supported

  • ROCK 3A
  • ROCK 3B
  • Radxa E23
  • Radxa E25
  • Radxa CM3 IO

Access from the Host PC/Laptop

Option 1: Serial console

See Serial Console

Option 2: SSH

SSH server is enabled on port 22 of ROCK 3 default image.

Please use angryip to find your board IP address.

$ ping ip-of-device
$ ssh rock@ip-of-device

Debian Default User Account

Non-root User:

User Name : rock
Password  : rock

Build

XFCE4 Desktop Server
* ROCK 3A
* ROCK 3B
* Radxa CM3 IO
* Radxa E23
* Radxa E25

Radxa APT

Radxa APT source includes stable one and testing one. Stable source includes stable packages while testing source includes latest but maybe unstable packages.

Radxa APT stable source is added by default while testing source is not added.

You can uncomment line like "deb http://apt.radxa.com/buster-testing/ buster main" in file /etc/apt/sources.list.d/apt-radxa-com.list to add testing source.

See file /etc/apt/sources.list.d/apt-radxa-com.list

deb http://apt.radxa.com/buster-stable/ buster main
deb http://apt.radxa.com/buster-testing/ buster main

After adding testing source, you need to update APT and install your needed packages.

$ sudo apt-get update

For more detail about Radxa APT, please see Radxa APT.

Upgrade necessary packages

Here is the example of upgrading rockchip-overlay and kernel packages. Pakcage linux-4.19-rock-3-latest provides the latest ROCK 3 kernel packages.

$ sudo apt-get update
$ sudo apt-get install -y rockchip-overlay
$ sudo apt-get install -y linux-4.19-rock-3-latest

Check DDR size

ROCK 3 comes in several different DDR sizes, such as 1G, 2G, 4G, 8G, etc. Here shows 8GB RAM on ROCK 3A.

root@rock-3a:~# free -h
              total        used        free      shared  buff/cache   available
Mem:          7.4Gi        72Mi       7.1Gi        16Mi       182Mi       7.2Gi 
Swap:            0B          0B          0B

Storage device

  • eMMC: /dev/mmcblk0
  • uSD Card: /dev/mmcblk1
  • NVME M.2 SDD: /dev/nvme0n1

NPU

SoC RK3566/RK3568 is equipped with 0.8TOPS NPU. See NPU Run Test to test it on your ROCK 3 boards.

General purpose input-output (GPIO)

  • ROCK 3A has one 40-pin expansion header. To control them, see ROCK 3A GPIO .



LEDS

The two leds are configured as LED class devices, you can control them via /sys/class/leds/

Green: Flash twice per second after the kernel booting, it's called heartbeat.

Blue: On when there is power

You can change the behaviour of each LED by using the echo command on their trigger property.

root@rock-3c:/home/rock#  echo none > /sys/class/leds/user-led1/trigger 
root@rock-3c:/home/rock#  echo default-on > /sys/class/leds/user-led1/trigger 
root@rock-3c:/home/rock#  echo timer > /sys/class/leds/user-led1/trigger 
root@rock-3c:/home/rock#  echo heartbeat > /sys/class/leds/user-led1/trigger 

You can use cat on the trigger property to list all the available values.

root@rock-3c:/home/rock# cat /sys/class/leds/user-led1/trigger 
none rfkill-any rfkill-none kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock 
kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock mmc1 mmc2 mmc0 timer oneshot disk-activity disk-read disk-write ide-disk mtd  
nand-disk [heartbeat] backlight gpio cpu cpu0 cpu1 cpu2 cpu3 activity default-on transient flash torch panic netdev rfkill0 rfkill1 


Common Hardware Interfaces, I2C, PWM, SPI, UART, CAN, etc

The ROCK 3 system images use configuration file /boot/uEnv.txt or /boot/extlinux/extlinux.conf, if the system you use has /boot/uEnv.txt file, you can see the following, if the system you use has /boot/extlinux/extlinux.conf, please refer to this extlinu.conf setting.

Warning: Remember there is only one line including item "overlays=" in file /boot/uEnv.txt.

To enable I2C, PWM, SPI, UART, CAN, etc, please see RK3566/RK3568 Available Overlay (ROCK 3A, ROCK 3B, Radxa CM3) part of Device Tree Overlays

I2C

To enable I2C-2 (/dev/i2c-2), add item "rk3568-i2c2-m0" to the "overlays=" line.

 overlays=rk3568-i2c2-m0

To enable I2C-3 (/dev/i2c-3), add item "rk3568-i2c3-m0" to the "overlays=" line.

 overlays=rk3568-i2c3-m0

PWM

PWM0
Option 1: PWM0-M0

To enable PWM0-M0, add item "rk3568-pwm0-m0" to the "overlays=" line.

overlays=rk3568-pwm0-m0

The related directory /sys/devices/platform/fdd70000.pwm/pwm/pwmchip* will be created. And you can do the operation in the directory.

Option 2: PWM0-M1

To enable PWM0-M0, add item "rk3568-pwm0-m1" to the "overlays=" line.

overlays=rk3568-pwm0-m1

The related directory /sys/devices/platform/fdd70000.pwm/pwm/pwmchip* will be created.

PWM1
PWM1-M1

To enable PWM11-M1, add item "rk3568-pwm1-m1" to the "overlays=" line.

overlays=rk3568-pwm1-m1

The related directory /sys/devices/platform/fdd70010.pwm/pwm/pwmchip* will be created.

SPI

UART

System default enable uart2-m0 (/dev/ttyS2) to be debug console.

 overlays=rk3568-fiq-debugger-uart2m0

If you want to enable uart2-m0 (/dev/ttyS2) to be normal console, modify item "rk3568-uart2-m0" to the "overlays=" line.

 overlays=rk3568-uart2-m0

CAN

I2C

PWM

SPI

UART

CAN


I2C

PWM

SPI

UART

Test RTC Device

ROCK 3A is equipped with one RTC IC hym8563.

Firstly, plug in RTC battery to give power to RTC IC. Please note that we should keep the RTC battery in the RTC connector.

Plug in power adaper to power on ROCK 3A.

And confirm that the rtc hym8563 device is created.

root@rock3a:~# dmesg | grep rtc
[    1.128345] rk808-rtc rk808-rtc: registered as rtc0
[    1.130163] rk808-rtc rk808-rtc: setting system clock to 2017-08-04 09:00:05 UTC (1501837205)
[    2.801453] rtc-hym8563 5-0051: rtc core: registered hym8563 as rtc1

Secondly, use the following commands to set the system time and synchronize it to rtc1.

root@rock3a:~# date -s "2021-08-17 20:00:00"
root@rock3a:~# hwclock -w -f /dev/rtc1
root@rock3a:~# hwclock -r -f /dev/rtc1
2021-08-17 20:00:04.745124+00:00
root@rock3a:~# poweroff

and then remove the power adapter.

Finally, 10 minutes later we power on ROCK 3A via Type-C Port and check the rtc clock.

root@rock3a:~# hwclock -r -f /dev/rtc1
2021-08-17 20:10:14.745124+00:00

We see that rtc runs about 10 minutes also. That's good.

Test Audio Player

Download a wav audio file, and use the command to test the HP player.

$ amixer -c 1 cset numid=1 3
   numid=1,iface=MIXER,name='Playback Path'
 ; type=ENUMERATED,access=rw------,values=1,items=11
 ; Item #0 'OFF'
 ; Item #1 'RCV'
 ; Item #2 'SPK'
 ; Item #3 'HP'
 ; Item #4 'HP_NO_MIC'
 ; Item #5 'BT'
 ; Item #6 'SPK_HP'
 ; Item #7 'RING_SPK'
 ; Item #8 'RING_HP'
 ; Item #9 'RING_HP_NO_MIC'
 ; Item #10 'RING_SPK_HP'
 : values=3

$ aplay -D plughw:1,0 test.wav
Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo

To test the Mic recording, please follow:

$ amixer -c 1 cset numid=2 1
$ arecord -Dhw:1,0 -d 10 -f cd -r 44100 -c 2 -t wav ./mic_test.wav      #this is a record command
  Recording WAVE './mic_test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
$ aplay -D plughw:1,0 mic_test.wav

Test USB Host Ports

There are two USB 2.0 host ports and two USB 3.0 host ports.

Plug in U Disk and fire command lsblk. Here /dev/sda is related to U Disk.

root@rock-3a:~# lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda            8:0    1 14.4G  0 disk 
|-sda1         8:1    1  200M  0 part 
`-sda2         8:2    1 14.2G  0 part 
mmcblk0      179:0    0 14.5G  0 disk 
|-mmcblk0p1  179:1    0  512M  0 part /boot
`-mmcblk0p2  179:2    0   14G  0 part /
mmcblk0boot0 179:32   0    4M  1 disk 
mmcblk0boot1 179:64   0    4M  1 disk

Mount U Disk.

root@rock-3a:~# mount /dev/sda2 /mnt/

Confirm that U Disk is mounted.

root@rock-3a:~# lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda            8:0    1 14.4G  0 disk 
|-sda1         8:1    1  200M  0 part 
`-sda2         8:2    1 14.2G  0 part /mnt
mmcblk0      179:0    0 14.5G  0 disk 
|-mmcblk0p1  179:1    0  512M  0 part /boot
`-mmcblk0p2  179:2    0   14G  0 part /
mmcblk0boot0 179:32   0    4M  1 disk 
mmcblk0boot1 179:64   0    4M  1 disk 


Control PWM Fan

There is one 3-pin PWM Fan header on ROCK 3A/3B/3C.

To control it, try the following steps.

  • Step 1: Add rk3568-pwm8-m0-fan overlay

You need to add the item "rk3568-pwm8-m0-fan" to line "overlays=" in file /boot/uEnv.txt. For example.

root@rock-3a:~# cat /boot/uEnv.txt | grep overlays=
overlays=rk3568-can1-m0 rk3568-pwm8-m0-fan
  • Step 2: Reboot ROCK 3A/3B/3C and confirm that the directory /sys/devices/platform/fe*.pwm related to pwm8 is created.
root@rock-3a:~# ls /sys/devices/platform/fe6f0000.pwm
driver	driver_override  modalias  of_node  power  pwm	subsystem  uevent
  • Step 3: Set PWM period, duty_cycle, polarity and enable with root permission.
root@rock-3a:~# echo 0 > /sys/devices/platform/fe*.pwm/pwm/pwmchip*/export
root@rock-3a:~# echo 10000 > /sys/devices/platform/fe*.pwm/pwm/pwmchip*/pwm0/period
root@rock-3a:~# echo 5000 > /sys/devices/platform/fe*.pwm/pwm/pwmchip*/pwm0/duty_cycle
root@rock-3a:~# echo normal > /sys/devices/platform/fe*.pwm/pwm/pwmchip*/pwm0/polarity
root@rock-3a:~# echo 1 > /sys/devices/platform/fe*.pwm/pwm/pwmchip*/pwm0/enable # Turn on fan
root@rock-3a:~# echo 0 > /sys/devices/platform/fe*.pwm/pwm/pwmchip*/pwm0/enable # Turn off fan
   
          </div>  

Ethernet

Ethernet for ROCK 3A

ROCK 3A is equipped with one 1G Ethernet port. You can use a network cable (one end connected to the external network port or route) to connect your ROCK 3 to the network. The ROCK 3 will automatically configure the network for your surfing on the Internet.

To test the Ethernet, we need to follow the steps:
  • Switch to super user mode by command
$ sudo su
  • Check whether the Ethernet is normal by command, ifconfig, which would show us a network card, eth0, and the Ethernet IP address. Also, use tool, ping, to connect to a normal domain.
$ ifconfig
$ ping www.baidu.com
  • If failed to connect to a normal domain. , try
$ sudo dhclient eth0

Ethernet for ROCK 3B

ROCK 3B is equipped with two 1G Ethernet ports. You can use two network cable (one end connected to the external network port or route) to connect your ROCK 3B to the network. The ROCK 3B will automatically configure the network for your surfing on the Internet.

To test the Ethernet, we need to follow the steps:
  • Switch to super user mode by command
$ sudo su
  • Check whether the Ethernet is normal by command, ifconfig, which would show us two network card, eth0 and eth1, and the Ethernet IP address. Also, use tool, ping, to connect to a normal domain.
$ ifconfig
$ ping www.baidu.com
  • If failed to connect to a normal domain. , try
$ sudo dhclient eth0
$ sudo dhclient eth1

Ethernet for CM3 IO Board

CM3 IO is equipped with one 1G Ethernet port. You can use a network cable (one end connected to the external network port or route) to connect your CM3 IO to the network. CM3 IO will automatically configure the network for your surfing on the Internet.

To test the Ethernet, we need to follow the steps:
  • Switch to super user mode by command
$ sudo su
  • Check whether the Ethernet is normal by command, ifconfig, which would show us a network card, eth0, and the Ethernet IP address. Also, use tool, ping, to connect to a normal domain.
$ ifconfig
$ ping www.baidu.com
  • If failed to connect to a normal domain. , try
$ sudo dhclient eth0

WiFi

WiFi for ROCK 3A

Table of wireless modules supported on ROCK 3A.

Model Chip WiFi BT Others
ROCK Pi Wireless Module A1 BCM43436B0 2.4G, 36Mbps 4.2
ROCK Pi Wireless Module A2 BCM43456 2.4G&5G, 200Mbps 5.0
ROCK Pi Wireless Module A3 BCM43598 2.4G&5G, >400Mbps 5.0 Support RSDB
ROCK Pi Wireless Module A6 BCM43752 2.4G&5G, WiFi 6 5.0
Realtek RTL8723BE RTL8723BE 2.4G 4.0
Realtek RTL8822CE RTL8822CE 2.4G&5G 5.0
Intel 0MHK36 Intel 3165 2.4G&5G 4.2
Intel 7265NGW Intel 7265 2.4G&5G 4.2

WiFi for ROCK 3B

Table of wireless modules supported on ROCK 3B.

Model Chip WiFi BT Others
AP7275S BCM43752 2.4G&5G, WiFi 6 5.0

WiFi for CM3 IO Board

To test the WIFI performance, we need to follow the steps:

  • Switch to super user mode
$ sudo su
  • Open the WIFI
$ nmcli r wifi on
  • Scan WIFI
$ nmcli dev wifi
  • Connect to WIFI network
$ nmcli dev wifi connect "wifi_name" password "wifi_password"
  • Test WIFI perpormance by tool iperf3.

BT

BT for ROCK 3A

Table of wireless modules supported on ROCK 3A.

Model Chip WiFi BT Others
ROCK Pi Wireless Module A1 BCM43436B0 2.4G, 36Mbps 4.2
ROCK Pi Wireless Module A2 BCM43456 2.4G&5G, 200Mbps 5.0
ROCK Pi Wireless Module A3 BCM43598 2.4G&5G, >400Mbps 5.0 Support RSDB
ROCK Pi Wireless Module A6 BCM43752 2.4G&5G, WiFi 6 5.0
Realtek RTL8723BE RTL8723BE 2.4G 4.0
Realtek RTL8822CE RTL8822CE 2.4G&5G 5.0
Intel 0MHK36 Intel 3165 2.4G&5G 4.2
Intel 7265NGW Intel 7265 2.4G&5G 4.2

Radxa APT includes broadcom-wifibt-firmware package for Broadcom wireless modules and intel-wifibt-firmware package for Intel wireless modules. Take a look at your module and download the corresponding packages.

For example:

root@rock3a:~# apt-get update -y
root@rock3a:~# apt-get install -y broadcom-wifibt-firmware intel-wifibt-firmware

Below is the example of testing Broadcom modules BT.

  • Check BT service.
root@rock3a:~# systemctl status bluetooth
  • Run BT service if the BT service is inactive.
root@rock3a:~# systemctl start bluetooth
  • Check BT device.
root@rock3a:~# hciconfig
hci0:   Type: Primary  Bus: UART
       BD Address: 10:2C:6B:49:D5:53  ACL MTU: 1021:8  SCO MTU: 64:1
       UP RUNNING 
       RX bytes:850 acl:0 sco:0 events:58 errors:0
       TX bytes:2814 acl:0 sco:0 commands:58 errors:0
  • Example: Connect to BT Speaker.
  • Install pulseaudio packages.
root@rock3a:~# apt-get install -y pulseaudio-module-bluetooth pulseaudio
  • Run pulseaudio.
root@rock3a:~# pulseaudio --start
  • Connect using bluetoothctl.
root@rock3a:~# bluetoothctl
[bluetooth]# default-agent 
[bluetooth]# power on
[bluetooth]# scan on
[bluetooth]# trust 41:42:1A:8D:A9:65       #BT-280
[bluetooth]# pair 41:42:1A:8D:A9:65
[bluetooth]# connect 41:42:1A:8D:A9:65
  • Play songs and enjoy it.

BT for ROCK 3B

Table of wireless modules supported on ROCK 3B.

Model Chip WiFi BT Others
AP7275S BCM43752 2.4G&5G, WiFi 6 5.0

BT for ROCK 3C

Table of wireless modules supported on ROCK 3C.

Model Chip WiFi BT Others
AP6256 BCM4345C0 2.4G&5G, WiFi 6 5.0


root@rock3c:~# apt-get update -y
root@rock3c:~# apt-get install -y broadcom-wifibt-firmware
root@rock3c:~# vi /usr/bin/brcmbt_set_dev_fw.sh

change line 59 contents " FIRMWARE="$FIRMWARE/BCM4345C5.hcd/" to " FIRMWARE="$FIRMWARE/BCM4345C0.hcd/" ,

rock@rock-3c:~$ aplay -l 
**** List of PLAYBACK Hardware Devices ****
card 0: rockchiphdmi [rockchip,hdmi], device 0: fe400000.i2s-i2s-hifi i2s-hifi-0 [fe400000.i2s-i2s-hifi i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: rockchiprk809co [rockchip,rk809-codec], device 0: fe410000.i2s-rk817-hifi rk817-hifi-0 [fe410000.i2s-rk817-hifi rk817-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

choose the "card 1: rockchiprk809co " as default sound card

rock@rock-3c:~$ vi .asoundrc
defaluts.ctl.card 1
defaults.pcm.card 1

then reboot system

rock@rock-3c:~$ hciconfig 
hci0:   Type: Primary  Bus: UART
          BD Address: E8:FB:1C:34:C8:98  ACL MTU: 1021:8  SCO MTU: 64:1
          UP RUNNING PSCAN 
          RX bytes:5773 acl:40 sco:0 events:509 errors:0
          TX bytes:505168 acl:852 sco:0 commands:66 errors:0
root@rock3a:~# pulseaudio --start
  • Connect using bluetoothctl.
root@rock3a:~# bluetoothctl
[bluetooth]# default-agent 
[bluetooth]# power on
[bluetooth]# scan on
[bluetooth]# trust 41:42:1A:8D:A9:65       #BT-280
[bluetooth]# pair 41:42:1A:8D:A9:65
[bluetooth]# connect 41:42:1A:8D:A9:65
  • Play songs and enjoy it.
rock@rock-3c:~$ sudo apt-get install mplayer 
rock@rock-3c:~$ mplayer path_to_your_song



Bluetooth for CM3 IO Board

Set up Docker

Please refer to this guide, Install Docker Engine on Debian.

Changelogs of ROCK 3 Debian Release

2021.11.15

rock3a_debian_buster_xfce4_arm64_20211113_0127-gpt.img

  • Kernel version: 4.19.193-16-rockchip-g0cca7bdf9cdb
  • U-Boot version: 2017.09-gf95bc56c33d-210525
  • Support Intel Wireless 3165 / 7265 modules
  • Support boot.scr and dt overlays

2021.09.15

rock3a_debian_buster_xfce4_arm64_20210914_0334-gpt.img

  • Kernel version: 4.19.193-10-rockchip-g152e34a538b4
  • Package broadcom-wifibt-firmware version: 1.3
  • Package rockchip-overlay version: 2.9
  • Package rtl8723be-firmware version: 0.1

2021.08.24

rock3a_debian_buster_xfce4_arm64_20210824_0136-gpt.img

  • Kernel version: 4.19.193-2-rockchip-g7cf7399ddb5c
  • U-Boot version: 2017.09-gbd2fa07970e-210525