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

Difference between revisions of "Rock5/5b/singleindex"

< Rock5‎ | 5b
 
(7 intermediate revisions by one other user not shown)
Line 165: Line 165:
 
Check [[rock5/linux/debian#wifi-connection | WIFI Connection]].
 
Check [[rock5/linux/debian#wifi-connection | WIFI Connection]].
  
==== 7.Bluetooth ====
+
==== 7.BT ====
  
Check [[rock5/linux/debian#bluetooth | Bluetooth]].
+
Check [[rock5/linux/debian#BT | BT]].
  
 
==== 8.LED ====
 
==== 8.LED ====
Line 186: Line 186:
  
 
Development for GPIO. ROCK 5B supports libmraa GPIO library, click [[rock5/dev/libmraa | here]] to get more information.
 
Development for GPIO. ROCK 5B supports libmraa GPIO library, click [[rock5/dev/libmraa | here]] to get more information.
 +
 +
 +
== Downloads ==
 +
 +
Official ROCK Pi system images can also be downloaded from
 +
 +
* '''[http://rock.sh/rockpi-baidupan ROCK Pi  BaiduPan]'''
 +
* '''[https://github.com/radxa/debos-radxa/releases/latest ROCK 5 Image Release]''' - The latest system images.
 +
 +
For usernames and passwords please check the [https://wiki.radxa.com/Rock/FAQ#What.27s_the_user_and_password_in_Lubuntu FAQ].
 +
 +
<div class="col-md-12">
 +
====<span class="label forest"><i class="fa fa-wrench" ></i> Tools</span>====
 +
<div class="table-responsive">
 +
<table class="table table-hover table-bordered table-striped">
 +
<tr>
 +
  <th>Description</th>
 +
  <th>Linux</th>
 +
  <th>MacOS</th>
 +
  <th>Windows</th>
 +
</tr>
 +
<tr>
 +
  <td><small>Etcher - A user friendly Image Writer</small></td>
 +
  <td>[https://github.com/balena-io/etcher/releases/download/v1.4.9/balena-etcher-electron-1.4.9-linux-x64.zip Linux 64bit]  |  [https://github.com/balena-io/etcher/releases/download/v1.4.9/balena-etcher-electron-1.4.9-linux-ia32.zip Linux 32bit]</td>
 +
  <td>[https://github.com/balena-io/etcher/releases/download/v1.4.9/balenaEtcher-1.4.9.dmg balenaEtcher-1.4.9.dmg]</td>
 +
  <td>[https://github.com/balena-io/etcher/releases/download/v1.4.9/balenaEtcher-Setup-1.4.9-x86.exe balenaEtcher-Setup-1.4.9-x86.exe]</td>
 +
</tr>
 +
</table>
 +
</div>
 +
</div>
 +
 +
<div class="col-md-12">
 +
====<span class="label forest"><i class="fa fa-android" ></i> Official Images</span>====
 +
<div class="table-responsive">
 +
<table class="table table-hover table-bordered table-striped">
 +
<tr>
 +
  <th>Distribution</th>
 +
  <th>Supoprted Boards</th>
 +
  <th>Description</th>
 +
</tr>
 +
 +
<tr>
 +
  <td>[[File:Android-Logo.jpg | 200px | link=https://github.com/radxa/manifests]]</td>
 +
 +
    <td>
 +
 +
    </td>
 +
    <td>
 +
 +
  </td>
 +
 +
</tr>
 +
 +
<tr>
 +
  <td>[[File:Debian-logo.png | 200px | link=https://github.com/radxa-build]]</td>
 +
  <td>
 +
* [https://github.com/radxa-build/rock-5b/releases/latest ROCK 5B]
 +
  </td>
 +
  <td>
 +
Debian Product.
 +
 +
[https://wiki.radxa.com/Rock5/linux/debian Install Wiki.]
 +
 +
Debian Bullseye(11).
 +
 +
[https://github.com/radxa/debos-radxa/releases/latest Change Log].
 +
  </td>
 +
</tr>
 +
 +
 +
<tr>
 +
  <td>[[File:Ubuntu_logo.png | 200px | link=https://github.com/radxa-build]]</td>
 +
  <td>
 +
* [https://github.com/radxa-build/rock-3b/releases/latest ROCK 5B]
 +
  </td>
 +
  <td>
 +
Ubuntu Server Product.
 +
 +
[https://wiki.radxa.com/Rock5/linux/ubuntu Install Wiki.]
 +
 +
Ubuntu Server 20.04.
 +
 +
[https://github.com/radxa/debos-radxa/releases/latest Change Log].
 +
  </td>
 +
</tr>
 +
 +
</table>
 +
</div>
 +
</div>
 +
 +
<div class="col-md-12">
 +
 +
====<span class="label forest" style="margin-bottom:5px;"><i class="fa fa-linux"></i> Third Party Images</span>====
 +
 +
</div>
 +
 +
<div class="col-md-12">
 +
 +
====<span class="label forest" style="margin-bottom:5px;"><i class="fa fa-linux"></i> Community Built Images</span>====
 +
 +
</div>
 +
 +
== Installation ==
 +
 +
=== Install Rockchip flashing tools ===
 +
 +
ROCK 5 supports ''maskrom mode'', which is a special operation mode for CPU to wait for command from USB OTG port. The Linux/macOS PC tool we use to communicate with ROCK 5 in ''maskrom mode'' are '''rkdeveloptool on Linux/macOS PC''' and '''RKDevTool on Windows PC'''.
 +
 +
==== Part one: RKDevTool on Windows ====
 +
 +
===== Step 1:Install RKDevTool =====
 +
The tool is provided in a compressed package. First, download the compressed package of this tool, and click the download link [https://dl.radxa.com/tools/windows/RKDevTool_Release_v2.81.zip (RKDevTool_Release_v2.81.zip)]. After downloading, unzip it. Installation step is completed.
 +
 +
===== Step 2:Install driver =====
 +
Using the RK driver assistant tool to install the driver.
 +
 +
There’s no need to connect your Rockchip device during this procedure just download and extract [https://dl.radxa.com/tools/windows/DriverAssitant_v5.0.zip RKDriverAssistant.zip]
 +
 +
Then double click on DriverInstall.exe in the RKDriverAssistant directory to start the utility. If you installed the Rockchip USB drivers for any other Rockchip devices already, make sure you click “Uninstall Driver” first.
 +
 +
[[File:RK_Driver_Assistant_Install_Uninstall.jpg]]
 +
 +
Then click “Install Driver”to install the driver. And restart PC.
 +
 +
==== Part two: rkdeveloptool on Linux ====
 +
 +
For Linux, we build the latest rkdeveloptool (version '''>=1.32'''), from source code.
 +
 +
To build rkdeveloptool on a Debian based Linux distribution, follow the instruction below:
 +
 +
Install build dependency:
 +
  sudo apt-get install libudev-dev libusb-1.0-0-dev dh-autoreconf
 +
 +
Clone the source code and build:
 +
  git clone https://github.com/rockchip-linux/rkdeveloptool
 +
  cd rkdeveloptool
 +
  autoreconf -i
 +
  ./configure
 +
  make
 +
 +
If you encounter compile error like below
 +
  ./configure: line 4269: syntax error near unexpected token `LIBUSB1,libusb-1.0'
 +
  ./configure: line 4269: `PKG_CHECK_MODULES(LIBUSB1,libusb-1.0)'
 +
 +
You should install pkg-config libusb-1.0
 +
  sudo apt-get install pkg-config libusb-1.0
 +
 +
Then re-run
 +
  autoreconf -i
 +
  ./configure
 +
  make
 +
 +
Now you have rkdeveloptool executable at the current directory.
 +
  sudo cp rkdeveloptool /usr/local/bin/
 +
  sudo ldconfig
 +
 +
Make sure that its version is 1.32.or later
 +
 +
  rkdeveloptool -v
 +
  rkdeveloptool ver 1.32
 +
 +
==== Part three: rkdeveloptool on macOS(Intel & Apple Silicon) ====
 +
 +
To build rkdeveloptool on macOS, you need [https://brew.sh/ homebrew](or similar package manager) to install required packages.
 +
 +
Install build dependency:
 +
  brew install automake autoconf libusb
 +
 +
Clone the source code and build:
 +
  git clone https://github.com/rockchip-linux/rkdeveloptool
 +
  cd rkdeveloptool
 +
  autoreconf -i
 +
  ./configure
 +
  make
 +
 +
If you encounter compile error like below
 +
  ./configure: line 5384: syntax error near unexpected token `LIBUSB1,libusb-1.0'
 +
  ./configure: line 5384: `PKG_CHECK_MODULES(LIBUSB1,libusb-1.0)'
 +
 +
You should install pkg-config libusb-1.0
 +
  brew install pkg-config
 +
 +
Then re-run
 +
  autoreconf -i
 +
  ./configure
 +
  make
 +
 +
Now you have rkdeveloptool executable at the current directory.
 +
 +
  sudo cp rkdeveloptool /opt/homebrew/bin/
 +
 +
Make sure that its version is 1.32 or later.
 +
 +
  rkdeveloptool -v
 +
  rkdeveloptool ver 1.32
 +
 +
=== Install the image to microSD ===
 +
 +
This guide describes how to write images to microSD and erase microSD card for ROCK 5 serial boards.
 +
 +
==== Part one: Write one system image to microSD ====
 +
 +
In part one let's focus on writing one system image to microSD. Here we test it with ROCK 5B board.
 +
 +
=====Step one: Requirements =====
 +
 +
* ROCK 5B board with power supply
 +
* a microSD card, larger than 8GB, class 10 or better
 +
* a microSD card reader, either a USB card reader or the SD card reader on laptop
 +
*  a PC/laptop running Windows or Linux or MacOS
 +
 +
=====Step two: Download necessary tools and image =====
 +
 +
* Etcher is the tool we use to write image. Download the right Etcher for your PC from [[rock5/downloads | ROCK 5 Downloads]] page and install it. Check [https://www.balena.io/etcher/  Etcher website] for more info about Etcher.
 +
* Choose the image you want to install from [[rock5/downloads | ROCK 5 Downloads]] page.
 +
 +
Here we use the following image for writing.
 +
 +
rock-5b-debian-bullseye-xfce4-arm64-20220615-1045-gpt.img.xz
 +
 +
=====Step three: Write the image to microSD card =====
 +
 +
* Insert the microSD Card into microSD Card Reader, which connects to host computer.
 +
 +
* Run the application. For example double click balenaEtcher-1.7.9-x64.AppImage on Ubuntu 20.04:
 +
 +
* In the etcher window, we click button Select image.
 +
 +
[[File:etcher-rock-5b-1.png]]
 +
 +
* In the etcher window, we click button Select Drive.
 +
 +
[[File:etcher-rock-5b-2.png]]
 +
 +
* In the etcher window, we click button Flash.
 +
 +
[[File:etcher-rock-5b-3.png]]
 +
 +
* In the etcher window, it shows us Flash Complete!
 +
 +
[[File:etcher-rock-5b-4.png]]
 +
 +
Done! Now you have successfully installed the OS image on microSD card.
 +
 +
==== Part two: Erase microSD ====
 +
 +
When microSD is written with Android (or Linux) images before, now we change to Linux( or Android). It's recommended that you erase microSD first. Then write the target images.
 +
 +
==== Part three: Write U-Boot images to microSD ====
 +
 +
In part three let's take a look know to write U-Boot images to microSD.
 +
We have prebuilt u-boot images built via rockchip-bsp SDK.
 +
They're idbloader.img and u-boot.itb.
 +
 +
On Linux PC:
 +
 +
<pre>
 +
$ sudo dd  if=./idbloader.img  of=/dev/sdX  seek=64
 +
$ sudo dd  if=./u-boot.itb  of=/dev/sdX  seek=16384
 +
</pre>
 +
 +
On Mac PC:
 +
 +
<pre>
 +
% sudo dd  if=./idbloader.img  of=/dev/diskX  seek=64
 +
% sudo dd  if=./u-boot.itb  of=/dev/diskX  seek=16384
 +
</pre>
 +
 +
 +
== Hardware ==
 +
 +
Technical information about ROCK 5 Series hardware
 +
 +
=== ROCK 5B ===
 +
 +
*[[rock5/hardware/5b | ROCK 5 Model B]]
 +
** [https://dl.radxa.com/rock5/docs/hw/5b/ v1.1 schematic pdf] - Download Schematic of ROCK 5 Model B
 +
** [https://dl.radxa.com/rock5/docs/hw/5b/ v1.1 2D Top&Bottom dxf] - Download 2D CAD of ROCK 5 Model B
 +
** [https://dl.radxa.com/rock5/docs/hw/5b/  v1.1 CAM pdf] - Download components Position Reference of ROCK 5 Model B
 +
 +
* [[rock5/hardware/5b/gpio | ROCK 5B GPIO]]
 +
 +
* Compliance
 +
** [https://dl.radxa.com/rock5 CE RED] - EU
 +
 +
=== Datasheets ===
 +
 +
* Datasheet
 +
** [https://dl.radxa.com/rock5/docs/hw/datasheet/Rockchip-RK3568-Datasheet-V1.0-20201210.pdf RK3588 datasheet] - The SoC of ROCK 5
 +
** [https://dl.radxa.com/rock5/docs/hw/datasheet/Rockchip-RK3568-Datasheet-V1.0-20201210.pdf RK3588'''S''' datasheet] - The SoC of ROCK 5 in small package
 +
 +
** RK3588 TRM(Technical Reference Manual) [https://dl.radxa.com/rock5/hw/datasheet/Rockchip%20RK3588%20TRM%20V1.0-Part1-20220309.pdf Part 1](56.6MB, 2287pages), [https://dl.radxa.com/rock5/hw/datasheet/Rockchip%20RK3588%20TRM%20V1.0-Part2%2020220309.pdf Part 2](55.6MB, 3694 pages)- The detail about RK3588(s)
 +
** [https://dl.radxa.com/rock5/docs/hw/datasheet/RK809-datasheet-v1.01.pdf RK809] - The PMIC
 +
** [https://dl.radxa.com/rock5/docs/hw/datasheets/RTL8211F-CG-Datasheet.pdf RTL8211F] - The ethernet phy
 +
** [https://dl.radxa.com/rock5/docs/hw/datasheets/IP2315-datasheet-cn-V1.0.pdf IP2315] - Charging IC with integrated input fast charge protocol
 +
 +
=== Accessories ===
 +
 +
* [[rock5/hardware/wifi | WiFi/BT Cards]]
 +
* [[rock5/hardware/emmc | eMMC module]]
 +
* [[Rock5/hardware/usb3_eMMC_reader | USB3 eMMC Reader]]
 +
* [[rock5/hardware/rtc | RTC battery]]
 +
 +
* Official heatsink
 +
** [https://dl.radxa.com/rockpi4/docs/hw/heatsink-1225-al-1.stp 3D drawing] - 3D model of official heatsink
 +
* [[rock5/hardware/display | Display]]
 +
* [[rock5/hardware/camera/ | Camera module]]
 +
 +
* [[rock5/hardware/HATs | HATs]]
 +
** [[rock5/hardware/PoE | PoE HAT]]
 +
** [[Dual_Quad_SATA_HAT | Dual/Quad SATA HAT]]
 +
** [[Penta_SATA_HAT | Penta SATA HAT]]
 +
 +
* [[rock5/hardware/spi_flash |  SPI Flash]]
 +
 +
* [[Device-tree-overlays | Device Tree Overlays]]
  
 
== Radxa OS ==
 
== Radxa OS ==
Line 250: Line 566:
 
  $ sudo apt-get update
 
  $ sudo apt-get update
 
  $ sudo apt-get install -y rockchip-overlay
 
  $ sudo apt-get install -y rockchip-overlay
 +
 +
 +
=== Partition table ===
 +
 +
{| class="wikitable"
 +
! Part Number || Offset || Name ||  Description
 +
|-
 +
|(raw) || 32KB  || loader1 || First stage loader
 +
|-
 +
|(raw) || 8MB  || loader2 || U-boot image
 +
|-
 +
| 1 || 16MB || boot ||Kernel partition, bootable
 +
|-
 +
| 2 || 528MB ||rootfs || Rootfs
 +
|}
  
 
=== Ethernet ===
 
=== Ethernet ===
Line 305: Line 636:
 
* eMMC: /dev/mmcblk1
 
* eMMC: /dev/mmcblk1
 
* NVME M.2 SDD:  /dev/nvme0n1
 
* NVME M.2 SDD:  /dev/nvme0n1
 +
 +
== Development ==
 +
 +
=== Serial console ===
 +
 +
ROCK 5 exports a dedicated  serial console, which can access the low level debug message.
 +
 +
==== Requirement ====
 +
 +
* ROCK 5
 +
* USB Type-C power adapter and USB Type-C charging data cable
 +
* Host PC with Windows or Linux
 +
* USB to TTL serial cable
 +
** The definition of each pin of USB to TTL cable is showing like this:
 +
 +
[[File:usb2ttl-cable-definition.jpeg | 500px ]]
 +
 +
===== Note =====
 +
 +
* The default baudrate of ROCK 5 is 1500000(1.5Mbps), please check if your USB to TTL cable support 1.5Mbps baudrate. Some model of [https://www.silabs.com/products/interface/usb-bridges CP210X] and [http://www.prolific.com.tw/US/ShowProduct.aspx?pcid=41 PL2303x]  have baudrate limitation,and the [http://www.ftdichip.com/Products/ICs/FT232R.htm FT232RL] have some [https://forum.radxa.com/t/u-boot-cant-boot-with-serial-console-attached/7684/ power issue](20211112), please check the specified model. We also tested that some cable does not work well. Make sure choose a high quality one. The instructions below use a [http://wch-ic.com/products/CH340.html CH340_series] based cable.
 +
 +
* It seems that the serial tool on macOS platform can not support custom baudrate such as 1.5Mbps due to driver restriction. If you know how to set custom baudrate on macOS, please add an item here to show your findings.
 +
 +
==== Connection ====
 +
 +
Connect the USB to TTL serial cable as below. '''Don't connect the red wire.'''
 +
 +
{| class="wikitable"
 +
|-
 +
! ROCK 5 || <---> || USB to TTL cable
 +
|-
 +
| RX(pin 10) || <---> || Green wire
 +
|-
 +
| TX(pin 8) || <---> || White wire
 +
|-
 +
| GND(pin 6) || <---> || Black wire
 +
|}
 +
 +
[[File:5b-serial-connection.jpeg | 500px ]]
 +
 +
==== Serial setting on host PC ====
 +
 +
The default serial setting for ROCK 5 u-boot and kernel console is:
 +
 +
    baudrate: 1500000
 +
    data bit: 8
 +
    stop bit: 1
 +
    parity  : none
 +
    flow control: none
 +
 +
===== Linux =====
 +
 +
Minicom is the serial tool that supports wide range baud rate.
 +
 +
Install minicom:
 +
 +
    sudo apt-get update
 +
    sudo apt-get install minicom
 +
 +
Plug in the USB to TTL cable, kernel `dmesg | tail` should show the following device:
 +
 +
    [1036835.654076] usb 1-6.4.3: new full-speed USB device number 103 using xhci_hcd
 +
    [1036835.755730] usb 1-6.4.3: New USB device found, idVendor=0403, idProduct=6001
 +
    [1036835.755732] usb 1-6.4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
 +
    [1036835.755733] usb 1-6.4.3: Product: USB <-> Serial
 +
    [1036835.755734] usb 1-6.4.3: Manufacturer: FTDI
 +
    [1036835.756728] ftdi_sio 1-6.4.3:1.0: FTDI USB Serial Device converter detected
 +
    [1036835.756750] usb 1-6.4.3: Detected FT232BM
 +
    [1036835.757195] usb 1-6.4.3: FTDI USB Serial Device converter now attached to ttyUSB0
 +
 +
'''/dev/ttyUSB0''' is our device here.
 +
 +
====== Setup minicom======
 +
 +
First add current user to plugdev group to use minicom without sudo or root.
 +
 +
    sudo usermod -a -G plugdev $USER
 +
 +
Edit your '''~/.bashrc''' and add the following line with some default parameter
 +
 +
    alias minicom='minicom -w -t xterm -l -R UTF-8'
 +
 +
Login to a new terminal to take effect.
 +
 +
Create and edit file '''~/.minirc.rock5''', add the following content:
 +
 +
    pu port            /dev/ttyUSB0
 +
    pu baudrate        1500000
 +
    pu bits            8
 +
    pu parity          N
 +
    pu stopbits        1
 +
    pu rtscts          No
 +
 +
Now run '''minicom rock5''' to use the config above and connects to the ROCK 5 serial console.
 +
 +
===== Windows =====
 +
 +
Putty is also great serial tool that supports wide range baud rate.
 +
 +
Plug in the USB to TTL cable to you windows PC. Viewing the  '''device manager''' you can find the '''COM number'''. Here it is '''COM3'''.
 +
 +
Launch the application Putty on your windows PC. And do the setting as follows:
 +
 +
For category '''Session''', set '''serial line''' as COM3, '''speed''' ad 1500000, '''connection type''' as Serial.
 +
 +
Write '''rock5''' in the '''Saved Sessions''' column and press '''Save'''.
 +
 +
[[File:putty-setting-session.jpg | 500px ]]
 +
 +
For category '''Connection---Serial''', do the setting:
 +
 +
[[File:putty-setting-serial.jpg | 500px ]]
 +
 +
Once finish the setting, press '''Open''' button to start.
 +
 +
===== macOS =====
 +
 +
====== Tool picocom ======
 +
 +
Install picocom
 +
 +
<pre>
 +
% brew install --build-from-source radxa/picocom/picocom
 +
</pre>
 +
 +
Start picocom
 +
 +
<pre>
 +
% picocom -b 1500000 -d 8 /dev/tty.usbserial-2130
 +
</pre>
 +
 +
==== FAQs ====
 +
 +
====1.While using debug console, there is system startup information on the screen, but the keyboard cannot be used to input text?====
 +
 +
One of the reason would be the wrong setting of the serial tool, such as the Hardware Flow Control, etc. Here we should disable the Hardware Flow Control.
 +
 +
 +
=== Build ROCK 5B Debian ===
 +
 +
==== Get the source code ====
 +
 +
You need Git to get multiple git repositories to build the image.
 +
 +
Install Git if you don't have it.
 +
 +
sudo apt-get update
 +
sudo apt-get install git
 +
 +
Clone the source code
 +
 +
mkdir ~/rk3588-sdk && cd ~/rk3588-sdk
 +
git clone -b stable-5.10-rock5 https://github.com/radxa/u-boot.git
 +
git clone -b stable-5.10-rock5 https://github.com/radxa/kernel.git
 +
git clone -b master https://github.com/radxa/rkbin.git
 +
git clone -b debian https://github.com/radxa/build.git
 +
git clone -b main https://github.com/radxa/debos-radxa.git
 +
 +
And you will get
 +
 +
build  kernel  rkbin u-boot
 +
 +
Directories usage introductions:
 +
 +
* build:
 +
** Some script files and configuration files for building u-boot, kernel and rootfs.
 +
* kernel:
 +
** kernel source code, current version is 4.19.193.
 +
* rkbin:
 +
** Prebuilt Rockchip binaries, include first stage loader and ATF(Arm Trustzone Firmware).
 +
* u-boot:
 +
** u-boot as the second stage bootloader
 +
 +
==== Install toolchain ====
 +
 +
wget https://dl.radxa.com/tools/linux/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.gz
 +
sudo tar zxvf gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.gz -C /usr/local/
 +
 +
Add the following line to the end of file ~/.bashrc
 +
 +
export PATH="/usr/local/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/linux-x86/aarch64/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin:$PATH"
 +
 +
And source ~/.bashrc
 +
 +
source ~/.bashrc
 +
 +
Check the version of toolchain
 +
 +
<pre>
 +
radxa@x86-64:~$ which aarch64-none-linux-gnu-gcc
 +
/usr/local/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/linux-x86/aarch64/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc
 +
 +
radxa@x86-64:~$ aarch64-none-linux-gnu-gcc -v
 +
Using built-in specs.
 +
COLLECT_GCC=aarch64-none-linux-gnu-gcc
 +
COLLECT_LTO_WRAPPER=/usr/local/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/linux-x86/aarch64/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/../libexec/gcc/aarch64-none-linux-gnu/10.3.1/lto-wrapper
 +
Target: aarch64-none-linux-gnu
 +
Configured with: /data/jenkins/workspace/GNU-toolchain/arm-10/src/gcc/configure --target=aarch64-none-linux-gnu --prefix= --with-sysroot=/aarch64-none-linux-gnu/libc --with-build-sysroot=/data/jenkins/workspace/GNU-toolchain/arm-10/build-aarch64-none-linux-gnu/install//aarch64-none-linux-gnu/libc --with-bugurl=https://bugs.linaro.org/ --enable-gnu-indirect-function --enable-shared --disable-libssp --disable-libmudflap --enable-checking=release --enable-languages=c,c++,fortran --with-gmp=/data/jenkins/workspace/GNU-toolchain/arm-10/build-aarch64-none-linux-gnu/host-tools --with-mpfr=/data/jenkins/workspace/GNU-toolchain/arm-10/build-aarch64-none-linux-gnu/host-tools --with-mpc=/data/jenkins/workspace/GNU-toolchain/arm-10/build-aarch64-none-linux-gnu/host-tools --with-isl=/data/jenkins/workspace/GNU-toolchain/arm-10/build-aarch64-none-linux-gnu/host-tools --enable-fix-cortex-a53-843419 --with-pkgversion='GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)'
 +
Thread model: posix
 +
Supported LTO compression algorithms: zlib
 +
gcc version 10.3.1 20210621 (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29))
 +
</pre>
 +
 +
==== Install other build tools ====
 +
 +
sudo apt-get install device-tree-compiler libncurses5 libncurses5-dev build-essential libssl-dev mtools bc python dosfstools
 +
 +
==== Build u-boot ====
 +
 +
Need to checkout branch to '''stable-5.10-rock5'''.
 +
 +
Build u-boot with default '''rock-5b-rk3588_defconfig'''.
 +
 +
cd ~/rk3588-sdk
 +
./build/mk-uboot.sh k3588-rock-5b    #For ROCK 5B
 +
 +
The generated images will be copied to out/u-boot folder
 +
 +
ls out/u-boot/
 +
idbloader.img  rk3588_spl_loader_v1.07.111.bin  spi  u-boot.itb
 +
 +
==== Apply u-boot ====
 +
 +
1. you should check file in out/u-boot should be like this:   
 +
 +
ls out/u-boot/
 +
idbloader.img  rk3588_spl_loader_v1.07.111.bin  spi  u-boot.itb
 +
 +
2. flash u-boot to you storage 
 +
 +
sudo dd if=./idbloader.img of=/path/to/storage/device bs=512 seek=64
 +
sudo dd if=./u-boot.itb of=/path/to/storage/device bs=512 seek=16384
 +
 +
==== Build kernel ====
 +
 +
Need to checkout branch to '''stable-5.10-rock5'''.
 +
 +
Build kernel with default '''rockchip_linux_defconfig'''.
 +
 +
cd ~/rk3588-sdk
 +
./build/mk-kernel.sh rk3588-rock-5b    #For ROCK 5B
 +
 +
===== Change kernel config =====
 +
 +
Optionally, if you want to change the default kernel config
 +
 +
cd ~/rk3588-sdk
 +
cd kernel
 +
export ARCH=arm64
 +
export CROSS_COMPILE=aarch64-none-linux-gnu-
 +
make rockchip_linux_defconfig
 +
make menuconfig
 +
make savedefconfig
 +
cp defconfig arch/arm64/configs/rockchip_linux_defconfig
 +
cd ..
 +
./build/mk-kernel.sh rk3588-rock-5b    #For ROCK 5B
 +
 +
You will get the kernel image and dtb file
 +
 +
ls out/kernel/
 +
Image  rk3588-rock-5b.dtb
 +
 +
==== Build kernel deb package ====
 +
 +
The kernel package build can pack the kernel, device tree, modules and firmware into Debian packages, which makes it easier to install on the ROCK 5.
 +
 +
./build/pack-kernel.sh -d rockchip_linux_defconfig -r 10 # rockchip_linux_defconfig: kernel defconfig; 1: release number
 +
 +
The generated packages will be copied to out/packages directory.
 +
 +
ls out/packages/
 +
linux-5.10.66-10-rockchip-ge5013df5e066_5.10.66-10-rockchip_arm64.changes
 +
linux-image-5.10.66-10-rockchip-ge5013df5e066-dbg_5.10.66-10-rockchip_arm64.deb
 +
linux-headers-5.10.66-10-rockchip-ge5013df5e066_5.10.66-10-rockchip_arm64.deb
 +
linux-libc-dev_5.10.66-10-rockchip_arm64.deb
 +
linux-image-5.10.66-10-rockchip-ge5013df5e066_5.10.66-10-rockchip_arm64.deb
 +
 +
When you want to install specified kernel packages to your OS, try the following steps.
 +
 +
copy linux-image-5.10.66-10-rockchip-ge5013df5e066-dbg_5.10.66-10-rockchip_arm64.deb to your ROCK 5.
 +
 +
Install them on ROCK 5.
 +
 +
# dpkg -i linux-image-5.10.66-10-rockchip-ge5013df5e066-dbg_5.10.66-10-rockchip_arm64.deb
 +
 +
==== Generate system image ====
 +
 +
Remove old ROCK 5B U-boot and Kernel packages.
 +
 +
$ cd ~/rk3588-sdk/debos-radxa
 +
 +
$ ls rootfs/packages/arm64/kernel/*5.10.66*
 +
rootfs/packages/arm64/kernel/linux-headers-5.10.66-6-rockchip-gbb60f4aeba31_5.10.66-6-rockchip_arm64.deb
 +
rootfs/packages/arm64/kernel/linux-image-5.10.66-6-rockchip-gbb60f4aeba31_5.10.66-6-rockchip_arm64.deb
 +
 +
$ ls rootfs/packages/arm64/u-boot/rock-5b*
 +
rootfs/packages/arm64/u-boot/rock-5b-rk-ubootimg_2017.09-g592fa62ffe2-220419_all.deb
 +
 +
Copy new ROCK 5B U-boot and Kernel packages to the specified place.
 +
Like Kernel packages in rootfs/packages/arm64/kernel/ and U-boot package in rootfs/packages/arm64/u-boot
 +
 +
Set up Docker
 +
 +
$ cd ~/rk3588-sdk/debos-radxa
 +
$ ./docker/dev-shell
 +
 +
Build image in Docker container.
 +
 +
# ./build.sh -c rk3588 -b rock-5b -m debian -d bullseye -v xfce4 -a arm64 -f gpt
 +
 +
The generated system images will be copied to ~/rk3588-sdk/debos-radxa/output directory.
 +
 +
 +
== FAQs ==
 +
 +
=== General ===
 +
 +
===== Q: Rock 5B will have WiFi 6E support. Does the new rock 5b board come with a (6E) wifi chip. Or will this be purchased separately? =====
 +
: WiFi Card is not included by default since different users require different WiFi speed.

Latest revision as of 03:38, 29 September 2022

Contents

Welcome to the ROCK 5B Documentation

Getting Started

This guide is designed for ROCK 5B enthusiast. The purpose is to learn about ROCK 5B as well as how to prepare and set up for basic use. When you get a board, you need to know what model it is and which hardware version it is. The information is printed in the top side of the board. We will introduce the board information as much as possible.

Close look of ROCK 5B

  • ROCK 5B front view

Rock-5b-front.png

  • ROCK 5B front with an angle view

Rock-5b-angle.jpeg

  • ROCK 5B back view

Rock-5b-back.png

Features

What you need

Necessary

  • ROCK 5B main board
  • One of the Storage media below:
    • microSD, larger than 8GB
    • eMMC module, larger than 8GB
  • Power supply
    • The ROCK 5B is powered by Type-C port and has a wide range of input voltage, from 5V to 21V. ROCK 5B supports USB Type-C PD 2.0 with 9V/2A, 12V/2A, 15V/2A and 20V/2A.
    • The Type-C cable you using needs to support data communication. We call it USB Type-C charging data cable.
  • USB Keyboard and Mouse
    • With four USB-A connectors, ROCK 5B can be equipped with a full sized keyboard and mouse.
  • Monitor and HDMI Cable
    • ROCK 5B is equipped with a full sized HDMI connector. HDMI capable monitor is recommended.
    • HDMI EDID display data is used to determine the best display resolution. On monitors and TVs that support 1080p (or 4K/8K) this resolution will be selected. If 1080p is not supported the next available resolution reported by EDID will be used. This selected mode will work with MOST but not all monitors/TVs.
  • USB to TTL serial cable
    • ROCK 5B exports a dedicated serial console for CPU, which can access the low level debug message.
  • USB type A to typec C cable
    • If you want to write image on ROCK 5B from USB OTG port or use fastboot/adb commands you need an USB typec A to type C cable to connect ROCK 5B and PC.

Optional

  • microSD Card Reader
    • For flashing the image into microSD Card
  • USB type A to type C cable
    • This is needed for fastboot/adb commands.
  • USB to TTL serial cable
    • This is needed for serial console.
  • Ethernet cable
    • ROCK 5B supports Internet access via Ethernet.
    • An Ethernet cable is used to connect your ROCK 5B to a local network and the Internet.
  • Camera Module
    • ROCK 5B supports camera function.
  • LCD Module
    • ROCK 5B supports LCD display function.
  • Audio cable
    • Audio can be played through speaker or headphones using a standard 3.5mm jack.

Starting the board for the first time

ROCK 5B can be started with eMMC Module or μSD Card. Now, you are presented with three options when installing your new operating system onto your ROCK 5B.

Prepare

  • When starting system with eMMC Module

(Option a) Inster the eMMC Module into ROCK Pi eMMC USB Reader. Then plug the ROCK Pi eMMC USB Reader into host PC.

(Option b) Insert eMMC Module into eMMC to μSD card converter board. Insert the converter board into μSD Card Reader. Then plug the Card Reader into host PC.

  • When starting system with μSD Card

(Option c) Insert the μSD Card into μSD Card Reader. Then plug the Card Reader into host PC.

Write Image

  • Download the official Ubuntu/Debian system image from Downloads.
  • Download the flash tool, etcher, from Downloads. Choose the right version for your host operation system. Here we operate on host Ubuntu 20.04.
  • After unpacking the package, we run the tool by double-clicking BalenaEtcher icon.

If you get an error message: "No polkit authentication agent found" you can try and start it with sudo, but do know that this is running the tool as root.

  • In the etcher window, click Select image.

Etcher-rock-5b-1.png

  • In the etcher window, click Select Drive.

Etcher-rock-5b-2.png

  • In the etcher window, click Flash.

Etcher-rock-5b-3.png

  • In the etcher window, once it shows us Flash Complete! It is done and can be put into the RockPi.

Etcher-rock-5b-4.png

3. Boot the board

  • Now insert the system storage media, μSD Card or eMMC Module into the socket on the board.
  • (Optional) Use the USB to TTL serial cable to setup a connection between PC and ROCK 5B board. See Serial Console.
  • Power on ROCK 5B by adapter with type C port.
  • ROCK 5B will boot with the green power LED on. And after a while, another blue LED starts blinking.

4. Access from the Host PC/Laptop

Option 1: HDMI monitor and Mouse

You would see Desktop on HDMI monitor.

Option 2: Serial console

Check Serial Console

Option 3: SSH

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

Please use angryip to find your board IP address.

To access ROCK 5B by SSH, try

ping rock-5b.local
ssh rock@rock-5b.local

or if your router/network doesn't support Local Domain, you need to check your network/router administrator page and look for the ROCK 5B ip address.

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

Note: You can also get the IP of ROCK 5B from option 1 if you can not access network administrator page.

5.Network state

  • Look at network configure:
$ sudo ifconfig
  • Test network:
$ ping -c 5 www.google.com

6.WIFI Connection

Check WIFI Connection.

7.BT

Check BT.

8.LED

ROCK 5B has Power LED and User LED.

  • Power LED

The power LED is green. It is always on when ROCK 5B is given power by default,

  • User LED

The user LED is blue. By default, its blink status shows the running kernel.

9.GPIO

ROCK 5B has one 40-pin expansion headers. Each pin is distinguished by color, more information click ROCK 5B GPIO.

Development for GPIO. ROCK 5B supports libmraa GPIO library, click here to get more information.


Downloads

Official ROCK Pi system images can also be downloaded from

For usernames and passwords please check the FAQ.

Tools

Description Linux MacOS Windows
Etcher - A user friendly Image Writer Linux 64bit | Linux 32bit balenaEtcher-1.4.9.dmg balenaEtcher-Setup-1.4.9-x86.exe

Official Images

Distribution Supoprted Boards Description
Android-Logo.jpg
Debian-logo.png

Debian Product.

Install Wiki.

Debian Bullseye(11).

Change Log.

Ubuntu logo.png

Ubuntu Server Product.

Install Wiki.

Ubuntu Server 20.04.

Change Log.

Third Party Images

Community Built Images

Installation

Install Rockchip flashing tools

ROCK 5 supports maskrom mode, which is a special operation mode for CPU to wait for command from USB OTG port. The Linux/macOS PC tool we use to communicate with ROCK 5 in maskrom mode are rkdeveloptool on Linux/macOS PC and RKDevTool on Windows PC.

Part one: RKDevTool on Windows

Step 1:Install RKDevTool

The tool is provided in a compressed package. First, download the compressed package of this tool, and click the download link (RKDevTool_Release_v2.81.zip). After downloading, unzip it. Installation step is completed.

Step 2:Install driver

Using the RK driver assistant tool to install the driver.

There’s no need to connect your Rockchip device during this procedure just download and extract RKDriverAssistant.zip

Then double click on DriverInstall.exe in the RKDriverAssistant directory to start the utility. If you installed the Rockchip USB drivers for any other Rockchip devices already, make sure you click “Uninstall Driver” first.

RK Driver Assistant Install Uninstall.jpg

Then click “Install Driver”to install the driver. And restart PC.

Part two: rkdeveloptool on Linux

For Linux, we build the latest rkdeveloptool (version >=1.32), from source code.

To build rkdeveloptool on a Debian based Linux distribution, follow the instruction below:

Install build dependency:

 sudo apt-get install libudev-dev libusb-1.0-0-dev dh-autoreconf

Clone the source code and build:

 git clone https://github.com/rockchip-linux/rkdeveloptool
 cd rkdeveloptool
 autoreconf -i
 ./configure
 make

If you encounter compile error like below

 ./configure: line 4269: syntax error near unexpected token `LIBUSB1,libusb-1.0'
 ./configure: line 4269: `PKG_CHECK_MODULES(LIBUSB1,libusb-1.0)'

You should install pkg-config libusb-1.0

 sudo apt-get install pkg-config libusb-1.0

Then re-run

 autoreconf -i
 ./configure
 make

Now you have rkdeveloptool executable at the current directory.

 sudo cp rkdeveloptool /usr/local/bin/
 sudo ldconfig

Make sure that its version is 1.32.or later

 rkdeveloptool -v
 rkdeveloptool ver 1.32

Part three: rkdeveloptool on macOS(Intel & Apple Silicon)

To build rkdeveloptool on macOS, you need homebrew(or similar package manager) to install required packages.

Install build dependency:

 brew install automake autoconf libusb

Clone the source code and build:

 git clone https://github.com/rockchip-linux/rkdeveloptool
 cd rkdeveloptool
 autoreconf -i
 ./configure
 make

If you encounter compile error like below

 ./configure: line 5384: syntax error near unexpected token `LIBUSB1,libusb-1.0'
 ./configure: line 5384: `PKG_CHECK_MODULES(LIBUSB1,libusb-1.0)'

You should install pkg-config libusb-1.0

 brew install pkg-config

Then re-run

 autoreconf -i
 ./configure
 make

Now you have rkdeveloptool executable at the current directory.

 sudo cp rkdeveloptool /opt/homebrew/bin/

Make sure that its version is 1.32 or later.

 rkdeveloptool -v
 rkdeveloptool ver 1.32

Install the image to microSD

This guide describes how to write images to microSD and erase microSD card for ROCK 5 serial boards.

Part one: Write one system image to microSD

In part one let's focus on writing one system image to microSD. Here we test it with ROCK 5B board.

Step one: Requirements
  • ROCK 5B board with power supply
  • a microSD card, larger than 8GB, class 10 or better
  • a microSD card reader, either a USB card reader or the SD card reader on laptop
  • a PC/laptop running Windows or Linux or MacOS
Step two: Download necessary tools and image

Here we use the following image for writing.

rock-5b-debian-bullseye-xfce4-arm64-20220615-1045-gpt.img.xz
Step three: Write the image to microSD card
  • Insert the microSD Card into microSD Card Reader, which connects to host computer.
  • Run the application. For example double click balenaEtcher-1.7.9-x64.AppImage on Ubuntu 20.04:
  • In the etcher window, we click button Select image.

Etcher-rock-5b-1.png

  • In the etcher window, we click button Select Drive.

Etcher-rock-5b-2.png

  • In the etcher window, we click button Flash.

Etcher-rock-5b-3.png

  • In the etcher window, it shows us Flash Complete!

Etcher-rock-5b-4.png

Done! Now you have successfully installed the OS image on microSD card.

Part two: Erase microSD

When microSD is written with Android (or Linux) images before, now we change to Linux( or Android). It's recommended that you erase microSD first. Then write the target images.

Part three: Write U-Boot images to microSD

In part three let's take a look know to write U-Boot images to microSD. We have prebuilt u-boot images built via rockchip-bsp SDK. They're idbloader.img and u-boot.itb.

On Linux PC:

$ sudo dd  if=./idbloader.img  of=/dev/sdX  seek=64
$ sudo dd  if=./u-boot.itb   of=/dev/sdX  seek=16384 

On Mac PC:

% sudo dd  if=./idbloader.img  of=/dev/diskX  seek=64
% sudo dd  if=./u-boot.itb  of=/dev/diskX  seek=16384


Hardware

Technical information about ROCK 5 Series hardware

ROCK 5B

Datasheets

    • RK3588 TRM(Technical Reference Manual) Part 1(56.6MB, 2287pages), Part 2(55.6MB, 3694 pages)- The detail about RK3588(s)
    • RK809 - The PMIC
    • RTL8211F - The ethernet phy
    • IP2315 - Charging IC with integrated input fast charge protocol

Accessories

Radxa OS

Radxa OS is built based on Debian.

ROCK 5 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 5B

Access from the Host PC/Laptop

Option 1: HDMI monitor and Mouse

You would see Desktop on HDMI monitor.

Option 2: Serial console

See Serial Console

Option 3: SSH

SSH server is enabled on port 22 of ROCK 5 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

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/bullseye-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/bullseye-stable/ buster main
deb http://apt.radxa.com/bullseye-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.

$ sudo apt-get update
$ sudo apt-get install -y rockchip-overlay


Partition table

Part Number Offset Name Description
(raw) 32KB loader1 First stage loader
(raw) 8MB loader2 U-boot image
1 16MB boot Kernel partition, bootable
2 528MB rootfs Rootfs

Ethernet

5B Ethernet

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

Ethernet throughput test result table.

Direction Bitrate
Upstream 2.34 Gbits/sec
Downstream 2.35 Gbits/sec
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 or enP4p65s0 , 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
or
$ sudo dhclient enP4p65s0

Storage device

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

Development

Serial console

ROCK 5 exports a dedicated serial console, which can access the low level debug message.

Requirement

  • ROCK 5
  • USB Type-C power adapter and USB Type-C charging data cable
  • Host PC with Windows or Linux
  • USB to TTL serial cable
    • The definition of each pin of USB to TTL cable is showing like this:

Usb2ttl-cable-definition.jpeg

Note
  • The default baudrate of ROCK 5 is 1500000(1.5Mbps), please check if your USB to TTL cable support 1.5Mbps baudrate. Some model of CP210X and PL2303x have baudrate limitation,and the FT232RL have some power issue(20211112), please check the specified model. We also tested that some cable does not work well. Make sure choose a high quality one. The instructions below use a CH340_series based cable.
  • It seems that the serial tool on macOS platform can not support custom baudrate such as 1.5Mbps due to driver restriction. If you know how to set custom baudrate on macOS, please add an item here to show your findings.

Connection

Connect the USB to TTL serial cable as below. Don't connect the red wire.

ROCK 5 <---> USB to TTL cable
RX(pin 10) <---> Green wire
TX(pin 8) <---> White wire
GND(pin 6) <---> Black wire

5b-serial-connection.jpeg

Serial setting on host PC

The default serial setting for ROCK 5 u-boot and kernel console is:

   baudrate: 1500000
   data bit: 8
   stop bit: 1
   parity  : none
   flow control: none
Linux

Minicom is the serial tool that supports wide range baud rate.

Install minicom:

   sudo apt-get update
   sudo apt-get install minicom

Plug in the USB to TTL cable, kernel `dmesg | tail` should show the following device:

   [1036835.654076] usb 1-6.4.3: new full-speed USB device number 103 using xhci_hcd
   [1036835.755730] usb 1-6.4.3: New USB device found, idVendor=0403, idProduct=6001
   [1036835.755732] usb 1-6.4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
   [1036835.755733] usb 1-6.4.3: Product: USB <-> Serial
   [1036835.755734] usb 1-6.4.3: Manufacturer: FTDI
   [1036835.756728] ftdi_sio 1-6.4.3:1.0: FTDI USB Serial Device converter detected
   [1036835.756750] usb 1-6.4.3: Detected FT232BM
   [1036835.757195] usb 1-6.4.3: FTDI USB Serial Device converter now attached to ttyUSB0

/dev/ttyUSB0 is our device here.

Setup minicom

First add current user to plugdev group to use minicom without sudo or root.

   sudo usermod -a -G plugdev $USER

Edit your ~/.bashrc and add the following line with some default parameter

   alias minicom='minicom -w -t xterm -l -R UTF-8'

Login to a new terminal to take effect.

Create and edit file ~/.minirc.rock5, add the following content:

   pu port             /dev/ttyUSB0
   pu baudrate         1500000
   pu bits             8
   pu parity           N
   pu stopbits         1
   pu rtscts           No

Now run minicom rock5 to use the config above and connects to the ROCK 5 serial console.

Windows

Putty is also great serial tool that supports wide range baud rate.

Plug in the USB to TTL cable to you windows PC. Viewing the device manager you can find the COM number. Here it is COM3.

Launch the application Putty on your windows PC. And do the setting as follows:

For category Session, set serial line as COM3, speed ad 1500000, connection type as Serial.

Write rock5 in the Saved Sessions column and press Save.

Putty-setting-session.jpg

For category Connection---Serial, do the setting:

Putty-setting-serial.jpg

Once finish the setting, press Open button to start.

macOS
Tool picocom

Install picocom

% brew install --build-from-source radxa/picocom/picocom

Start picocom

% picocom -b 1500000 -d 8 /dev/tty.usbserial-2130

FAQs

1.While using debug console, there is system startup information on the screen, but the keyboard cannot be used to input text?

One of the reason would be the wrong setting of the serial tool, such as the Hardware Flow Control, etc. Here we should disable the Hardware Flow Control.


Build ROCK 5B Debian

Get the source code

You need Git to get multiple git repositories to build the image.

Install Git if you don't have it.

sudo apt-get update
sudo apt-get install git

Clone the source code

mkdir ~/rk3588-sdk && cd ~/rk3588-sdk
git clone -b stable-5.10-rock5 https://github.com/radxa/u-boot.git
git clone -b stable-5.10-rock5 https://github.com/radxa/kernel.git
git clone -b master https://github.com/radxa/rkbin.git
git clone -b debian https://github.com/radxa/build.git
git clone -b main https://github.com/radxa/debos-radxa.git

And you will get

build  kernel  rkbin u-boot

Directories usage introductions:

  • build:
    • Some script files and configuration files for building u-boot, kernel and rootfs.
  • kernel:
    • kernel source code, current version is 4.19.193.
  • rkbin:
    • Prebuilt Rockchip binaries, include first stage loader and ATF(Arm Trustzone Firmware).
  • u-boot:
    • u-boot as the second stage bootloader

Install toolchain

wget https://dl.radxa.com/tools/linux/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.gz
sudo tar zxvf gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.gz -C /usr/local/

Add the following line to the end of file ~/.bashrc

export PATH="/usr/local/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/linux-x86/aarch64/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin:$PATH"

And source ~/.bashrc

source ~/.bashrc

Check the version of toolchain

radxa@x86-64:~$ which aarch64-none-linux-gnu-gcc
/usr/local/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/linux-x86/aarch64/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc

radxa@x86-64:~$ aarch64-none-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=aarch64-none-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/linux-x86/aarch64/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/../libexec/gcc/aarch64-none-linux-gnu/10.3.1/lto-wrapper
Target: aarch64-none-linux-gnu
Configured with: /data/jenkins/workspace/GNU-toolchain/arm-10/src/gcc/configure --target=aarch64-none-linux-gnu --prefix= --with-sysroot=/aarch64-none-linux-gnu/libc --with-build-sysroot=/data/jenkins/workspace/GNU-toolchain/arm-10/build-aarch64-none-linux-gnu/install//aarch64-none-linux-gnu/libc --with-bugurl=https://bugs.linaro.org/ --enable-gnu-indirect-function --enable-shared --disable-libssp --disable-libmudflap --enable-checking=release --enable-languages=c,c++,fortran --with-gmp=/data/jenkins/workspace/GNU-toolchain/arm-10/build-aarch64-none-linux-gnu/host-tools --with-mpfr=/data/jenkins/workspace/GNU-toolchain/arm-10/build-aarch64-none-linux-gnu/host-tools --with-mpc=/data/jenkins/workspace/GNU-toolchain/arm-10/build-aarch64-none-linux-gnu/host-tools --with-isl=/data/jenkins/workspace/GNU-toolchain/arm-10/build-aarch64-none-linux-gnu/host-tools --enable-fix-cortex-a53-843419 --with-pkgversion='GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.3.1 20210621 (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29))

Install other build tools

sudo apt-get install device-tree-compiler libncurses5 libncurses5-dev build-essential libssl-dev mtools bc python dosfstools

Build u-boot

Need to checkout branch to stable-5.10-rock5.

Build u-boot with default rock-5b-rk3588_defconfig.

cd ~/rk3588-sdk
./build/mk-uboot.sh k3588-rock-5b     #For ROCK 5B

The generated images will be copied to out/u-boot folder

ls out/u-boot/
idbloader.img  rk3588_spl_loader_v1.07.111.bin  spi  u-boot.itb

Apply u-boot

1. you should check file in out/u-boot should be like this:

ls out/u-boot/
idbloader.img  rk3588_spl_loader_v1.07.111.bin  spi  u-boot.itb

2. flash u-boot to you storage

sudo dd if=./idbloader.img of=/path/to/storage/device bs=512 seek=64
sudo dd if=./u-boot.itb of=/path/to/storage/device bs=512 seek=16384

Build kernel

Need to checkout branch to stable-5.10-rock5.

Build kernel with default rockchip_linux_defconfig.

cd ~/rk3588-sdk
./build/mk-kernel.sh rk3588-rock-5b    #For ROCK 5B
Change kernel config

Optionally, if you want to change the default kernel config

cd ~/rk3588-sdk
cd kernel
export ARCH=arm64
export CROSS_COMPILE=aarch64-none-linux-gnu-
make rockchip_linux_defconfig
make menuconfig
make savedefconfig
cp defconfig arch/arm64/configs/rockchip_linux_defconfig
cd ..
./build/mk-kernel.sh rk3588-rock-5b    #For ROCK 5B

You will get the kernel image and dtb file

ls out/kernel/
Image  rk3588-rock-5b.dtb

Build kernel deb package

The kernel package build can pack the kernel, device tree, modules and firmware into Debian packages, which makes it easier to install on the ROCK 5.

./build/pack-kernel.sh -d rockchip_linux_defconfig -r 10 # rockchip_linux_defconfig: kernel defconfig; 1: release number

The generated packages will be copied to out/packages directory.

ls out/packages/
linux-5.10.66-10-rockchip-ge5013df5e066_5.10.66-10-rockchip_arm64.changes
linux-image-5.10.66-10-rockchip-ge5013df5e066-dbg_5.10.66-10-rockchip_arm64.deb
linux-headers-5.10.66-10-rockchip-ge5013df5e066_5.10.66-10-rockchip_arm64.deb
linux-libc-dev_5.10.66-10-rockchip_arm64.deb
linux-image-5.10.66-10-rockchip-ge5013df5e066_5.10.66-10-rockchip_arm64.deb

When you want to install specified kernel packages to your OS, try the following steps.

copy linux-image-5.10.66-10-rockchip-ge5013df5e066-dbg_5.10.66-10-rockchip_arm64.deb to your ROCK 5.

Install them on ROCK 5.

# dpkg -i linux-image-5.10.66-10-rockchip-ge5013df5e066-dbg_5.10.66-10-rockchip_arm64.deb

Generate system image

Remove old ROCK 5B U-boot and Kernel packages.

$ cd ~/rk3588-sdk/debos-radxa

$ ls rootfs/packages/arm64/kernel/*5.10.66*
rootfs/packages/arm64/kernel/linux-headers-5.10.66-6-rockchip-gbb60f4aeba31_5.10.66-6-rockchip_arm64.deb
rootfs/packages/arm64/kernel/linux-image-5.10.66-6-rockchip-gbb60f4aeba31_5.10.66-6-rockchip_arm64.deb

$ ls rootfs/packages/arm64/u-boot/rock-5b*
rootfs/packages/arm64/u-boot/rock-5b-rk-ubootimg_2017.09-g592fa62ffe2-220419_all.deb

Copy new ROCK 5B U-boot and Kernel packages to the specified place. Like Kernel packages in rootfs/packages/arm64/kernel/ and U-boot package in rootfs/packages/arm64/u-boot

Set up Docker

$ cd ~/rk3588-sdk/debos-radxa
$ ./docker/dev-shell

Build image in Docker container.

# ./build.sh -c rk3588 -b rock-5b -m debian -d bullseye -v xfce4 -a arm64 -f gpt

The generated system images will be copied to ~/rk3588-sdk/debos-radxa/output directory.


FAQs

General

Q: Rock 5B will have WiFi 6E support. Does the new rock 5b board come with a (6E) wifi chip. Or will this be purchased separately?
WiFi Card is not included by default since different users require different WiFi speed.