Skip to main content

Linux BSP User Guide for RK3288 Series Debian9

Introduction

This document provides comprehensive instructions for building and deploying Linux BSP for RK3288 series platforms running Debian 9. The guide covers environment setup, source code acquisition, building processes, and deployment methods.

Linux BSP Version

We have two versions available for RK3288 series:

V2.1

  • OS: Debian 9 stretch
  • Kernel: Linux version 4.4.143

V230

  • OS: Debian 10 buster
  • Kernel: Linux version 4.4.194

Get Docker Image

If you don't have docker in your system, then you can follow the below steps to install docker and run it first.

To Install Docker Engine on Your Platform

Please refer to Docker Installation Guide for details.

To Pull Ubuntu 16.04 Image from Docker Hub

sudo docker pull advrisc/u16.04-rk3288lbv1

Install Additional Dependencies

$ sudo apt-get update
$ sudo apt-get install binfmt-support qemu-user-static

Config Docker

Initial Docker Setup

$ mkdir -p ~/work/code/rk3288_debian
$ sudo docker run -it --name rk3288_linux --privileged -v ~/work/code/rk3288_debian:/home/adv/code:rw advrisc/u16.04-rk3288lbv1:latest /bin/bash
$ exit # This command runs in docker workspace. It means exit docker workspace to host workspace.

Note: The above commands only need to be run the first time.

Start Docker

$ sudo docker start rk3288_linux
$ sudo docker attach rk3288_linux

Note: After running the above two commands, you will work in docker workspace. You can get debian source code and build them in docker workspace.

Getting Debian Source Code

V2.1 Version

$ cd ~/code
$ sudo git clone https://github.com/ADVANTECH-Rockchip/repo.git
$ mkdir rk3288_debian
$ cd rk3288_debian
$ git config --global user.name "Your Name"
$ git config --global user.email you@example.com
$ ../repo/repo init -u https://github.com/ADVANTECH-Rockchip/linux-manifest.git -b rk3288_linux_v2.0 -m default.xml
$ ../repo/repo sync
$ ../repo/repo forall -c git checkout -b local --track advantech-github/rk3288_linux_v2.0
$ sudo dpkg -i rootfs/ubuntu-build-service/packages/*
$ sudo apt-get install -f

V230 Version

$ cd ~/code
$ sudo git clone https://github.com/ADVANTECH-Rockchip/repo.git
$ mkdir rk3288_debian
$ cd rk3288_debian
$ git config --global user.name "Your Name"
$ git config --global user.email you@example.com
$ ../repo/repo init -u https://github.com/ADVANTECH-Rockchip/linux-manifest.git -b rk3288_linux_v230_risc -m default.xml
$ ../repo/repo sync
$ ../repo/repo forall -c git checkout -b local --track advantech-github/rk3288_linux_v230_risc
$ sudo dpkg -i rootfs/ubuntu-build-service/packages/*
$ sudo apt-get install -f

Build U-boot

Build RSB-4680 U-boot

V2.1 Version

$ export TOP=`pwd`
$ cd $TOP
$ cd u-boot/
$ ./make.sh rsb4680a3-2G-rk3288

V230 Version

$ export TOP=`pwd`
$ cd $TOP
$ cd u-boot/
$ ./make.sh rk3288_rsb4680a3_2G

Build Kernel

Build RSB-4680 Kernel

$ cd $TOP 
$ cd kernel/
$ make ARCH=arm rk3288_adv_defconfig
$ make ARCH=arm rk3288-rsb4680-a3.img -j12

Build Recovery

$ cd $TOP
$ rm buildroot/output/rockchip_rk3288_recovery -rf
$ source envsetup.sh rockchip_rk3288_recovery
$ ./build.sh recovery

NOTE: For recovery.img includes kernel and recovery tools, kernel MUST be built before recovery.

Build Rootfs

V2.1 Version

$ cd $TOP
$ cd rootfs/
$ sudo ARCH=armhf ./mk-rootfs.sh
$ sudo ARCH=armhf ./mk-adv.sh
$ sudo ./mk-image.sh

V230 Version

$ cd $TOP
$ sudo BUILD_IN_DOCKER=TRUE ./mk-debian.sh

Creating the ext4 Image

$ cd $TOP
$ source envsetup.sh rockchip_rk3288_recovery
$ sudo ./mkfirmware.sh

NOTE: If there is no error, the following ten files will be found in $TOP/rockdev/:

  • boot.img
  • MiniLoaderAll.bin
  • misc.img
  • oem.img
  • parameter.txt
  • recovery.img
  • rootfs.img
  • trust.img
  • uboot.img
  • userdata.img

How to Update RK3288 Platform

There are two ways to update images:

1. Android Tool

Update image through AndroidTool

2. SD Card

Update image through SD-Card

NOTE: This method only supports:

  • Linux (Debian9) upgrade to Linux (Debian9)
  • Android 6.0 upgrade to Android 6.0
  • Android 8.1 upgrade to Android 8.1

If the device is running Android and you want to upgrade to Linux (Debian9), please use Android Tool.

Default User and Password

Here are the default user credentials:

UsernamePassword
linaro123456
root123456

Build Toolchain

To Build a Toolchain

$ cd ~/RSB4680_CODEBASE/
$ source buildroot/build/envsetup.sh rockchip_rk3288
$ make

The toolchain will be generated in:

~/RSB4680_CODEBASE/buildroot/output/rockchip_rk3288/host/arm-buildroot-linux-gnueabihf/

Initramfs

Method 1: Using Cpio Format

1. Get a Sample Initramfs Rootfs

$ git clone https://github.com/TeeFirefly/initrd.git

2. Make a Cpio Format Gzipped File

$ cd initrd
$ find . | cpio -o -H newc | gzip > ../initramfs_data.cpio.gz

3. Copy to Kernel Source

Copy initramfs_data.cpio.gz to ~/KERNEL_SRC/usr/

4. Add Configuration

Add config CONFIG_INITRAMFS_SOURCE="usr/initramfs_data.cpio.gz" to rk3288_adv_defconfig

5. Rebuild Boot Image

Modify Initramfs Rootfs

To modify existing initramfs rootfs:

$ zcat initramfs_data.cpio.gz | cpio -i -d -H newc --no-absolute-filenames

Method 2: Direct Folder Reference

You can point CONFIG_INITRAMFS_SOURCE to a folder directly:

1. Get a Sample Initramfs Rootfs

$ git clone https://github.com/TeeFirefly/initrd.git

2. Set Configuration

Set CONFIG_INITRAMFS_SOURCE="../../initrd/"

3. Rebuild Boot Image

Important Notes

  1. The init found in the initramfs has nothing to do with kernel cmdline root=
  2. The init inside the initrd.git will be triggered and boot the system completely. You may add anything you want to this rootfs

Supported Hardware Platforms

  • RSB-4680: Industrial Single Board Computer with RK3288 processor

Build Workflow Summary

  1. Environment Setup → Docker + Ubuntu 16.04
  2. Source Download → Git repo sync from Advantech Rockchip repositories
  3. Component Build → U-boot → Kernel → Recovery → Rootfs
  4. Image Creation → Create ext4 images and firmware
  5. Deployment → Android Tool or SD Card flashing

System Requirements

  • Docker environment with advrisc/u16.04-rk3288lbv1 image
  • Ubuntu 16.04 base system
  • Git and repo tools
  • Build tools and cross-compilation toolchain
  • Sufficient disk space for source code and build artifacts
  • Internet connection for source code download
  • Target hardware (RSB-4680)

This guide provides comprehensive instructions for building and deploying Linux BSP on RK3288 series platforms.