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

Difference between revisions of "RockPro-px30"

(Pack U-Boot)
(Serial console)
 
(6 intermediate revisions by the same user not shown)
Line 12: Line 12:
 
Create top directory, rockchip-bsp.
 
Create top directory, rockchip-bsp.
  
   mkdir rockchip-bsp
+
   mkdir ~/rockchip-bsp
 +
  cd ~/rockchip-bsp
  
 
u-boot. The second stage bootloader.
 
u-boot. The second stage bootloader.
Line 30: Line 31:
 
   git clone -b debian https://github.com/radxa/build.git
 
   git clone -b debian https://github.com/radxa/build.git
  
=== Install toolchain from Linaro ===
+
=== Install build tools ===
  
 
   wget https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz
 
   wget https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz
 
   sudo tar xvf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz  -C /usr/local/
 
   sudo tar xvf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz  -C /usr/local/
 +
  sudo apt-get install gcc-aarch64-linux-gnu device-tree-compiler libncurses5 libncurses5-dev build-essential libssl-dev mtools
 +
  sudo apt-get install bc python dosfstools ruby-dev
 +
  sudo gem install fpm
 +
 +
Add the following lines to the  ~/.bashrc file.
 +
 
   export CROSS_COMPILE=/usr/local/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
 
   export CROSS_COMPILE=/usr/local/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
 
   export PATH=/usr/local/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin:$PATH
 
   export PATH=/usr/local/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin:$PATH
  
Check if Linaro toolchain is the default choice:
+
Execute the following command.
  
   which aarch64-linux-gnu-gcc
+
   source ~/.bashrc
  /usr/local/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc
+
  
=== Install other build tools ===
+
Check if Linaro toolchain is the default choice.
  
   sudo apt-get install gcc-aarch64-linux-gnu device-tree-compiler libncurses5 libncurses5-dev build-essential libssl-dev mtools
+
   which aarch64-linux-gnu-gcc
  sudo apt-get install bc python dosfstools
+
  /usr/local/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc
  
 
=== Build U-Boot ===
 
=== Build U-Boot ===
Line 136: Line 142:
  
 
Non-root User:
 
Non-root User:
    User Name : rock
+
 
    Password  : rock
+
  User Name : rock
 +
  Password  : rock
  
 
=== Serial console ===
 
=== Serial console ===
Line 147: Line 154:
 
The default serial setting of serial tool on Host PC:
 
The default serial setting of serial tool on Host PC:
  
    baudrate: 1500000
+
  baudrate: 1500000
    data bit: 8
+
  data bit: 8
    stop bit: 1
+
  stop bit: 1
    parity  : none
+
  parity  : none
    flow control: none
+
  flow control: none
 +
 
 +
Q1: While using debug serial console, there is system startup information on the screen, but the keyboard cannot be used to input text?
 +
 
 +
A1: 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.

Latest revision as of 09:23, 24 June 2020

ROCK Pro PX30

Introduction

Hardware

Development

Get the source code

Create top directory, rockchip-bsp.

 mkdir ~/rockchip-bsp
 cd ~/rockchip-bsp

u-boot. The second stage bootloader.

 git clone -b stable-4.4-px30 https://github.com/radxa/u-boot.git

kernel. Current version is 4.4.

 git clone -b stable-4.4-px30 https://github.com/radxa/kernel.git

rkbin. Prebuilt Rockchip binaries, include first stage loader and ATF(Arm Trustzone Firmware).

 git clone -b stable-4.4-px30 https://github.com/radxa/rkbin.git

build. Some script files and configuration files for building u-boot, kernel and rootfs.

 git clone -b debian https://github.com/radxa/build.git

Install build tools

 wget https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz
 sudo tar xvf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz  -C /usr/local/
 sudo apt-get install gcc-aarch64-linux-gnu device-tree-compiler libncurses5 libncurses5-dev build-essential libssl-dev mtools
 sudo apt-get install bc python dosfstools ruby-dev
 sudo gem install fpm

Add the following lines to the ~/.bashrc file.

 export CROSS_COMPILE=/usr/local/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
 export PATH=/usr/local/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin:$PATH

Execute the following command.

 source ~/.bashrc

Check if Linaro toolchain is the default choice.

 which aarch64-linux-gnu-gcc
 /usr/local/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc

Build U-Boot

 ./build/mk-uboot.sh rockpropx30

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

 ls out/u-boot/
 idbloader.img  px30_loader_v1.14.120.bin trust.img  uboot.img

Pack U-Boot

 ./build/pack-uboot.sh -b rockpropx30

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

 ls out/packages/
 rockpropx30-rk-ubootimg_2017.09-03569-g8d4bb4e_all.deb

Build Kernel

 ./build/mk-kernel.sh rockpropx30

You will get the kernel image and dtb file

 ls out/kernel/
 Image  px30-rockpro.dtb

Pack Kernel

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

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

 ls out/packages
 linux-headers-4.4.189-1-rockchip-gc71f0d4_4.4.189-1-rockchip_arm64.deb
 linux-image-4.4.189-1-rockchip-gc71f0d4_4.4.189-1-rockchip_arm64.deb
 linux-image-4.4.189-1-rockchip-gc71f0d4-dbg_4.4.189-1-rockchip_arm64.deb
 linux-libc-dev_4.4.189-1-rockchip_arm64.deb

Build system image

Get source code.

 git clone -b master https://github.com/radxa/debos.git

Build docker and enter docker container.

 ./dev-shell # build docker and enter docker container

Build system image in Docker container.

 ./build.sh # will show usage
 ./build.sh px30-rockpropx30-debian-buster-xfce4-arm64

The generated system image will be moved to output directory.

Downloads

System images are on the RockPro PX30 images site.

Installation

Install on eMMC module

Step 1:Boot the board to maskrom mode

To boot RockPro PX30 into maskrom mode, you need:

  • Plug the board to Linux Desktop with the USB Male A to Micro B cable
  • Press and hold the maskrom key, then short press reset key
  • Release maskrom key

Now on Linux PC, rkdeveloptool ld command shows the following message.

 $ rkdeveloptool ld
 DevNo=1    Vid=0x2207,Pid=0x330d,LocationID=102    Maskrom

Step 2: Write system image to eMMC Module

 $ rkdeveloptool db px30_loader_v1.14.120.bin
 $ rkdeveloptool wl 0 rockpipx30_debian_buster_xfce4_arm64_20200609_0710-gpt.img
 $ rkdeveloptool rd

Now the device should boot from eMMC now. The first boot would take several minutes.

Linux system

Default user account

Non-root User:

 User Name : rock
 Password  : rock

Serial console

The u-boot console is ttyS2 with baud rate 1500000bps, date bit 8, stop bit 1, parity none.

The kernel console is ttyS1 with baud rate 1500000bps, date bit 8, stop bit 1, parity none.

The default serial setting of serial tool on Host PC:

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

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

A1: 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.