Linux BSP User Guide for RK3568 series Debian11
1. Introduction
This guide provides comprehensive instructions for building and deploying Linux BSP for RK3568 series development boards running Debian11.The guide covers environment setup, source code acquisition, building processes for multiple processors platforms, and deployment methods.
2. Linux BSP Version
- Operating System: Debian 11.x
- Kernel Version: 5.10.xxx
3. Build Environment on Host
Currently, we adopt Docker as the build environment for consistent development experience.
You can get the latest version of advrisc/u20.04-rklbv1 Docker image for developing Rockchip RK3568 projects.
3.1 Docker Installation Commands
sudo apt-get install -y qemu-user-static
sudo apt-get install -y live-build
sudo docker pull advrisc/u20.04-rklbv1
3.2 Run Docker Example
- Step 1: Run Docker Container
sudo docker run -it --name rk356x_linux5.10_v130_risc \
-v /home/bsp/myLinux:/home/adv/BSP:rw \
--privileged advrisc/u20.04-rklbv1:latest /bin/bash
- Step 2: Change User Ownership in Container
adv@7cc0fa834366:~$ sudo chown adv:adv -R BSP
-
Step 3: Install build dependencies in Container
-
Install live build
adv@7cc0fa834366:~$ cd ~
adv@7cc0fa834366:~$ git clone https://salsa.debian.org/live-team/live-build.git --depth 1 -b debian/1%20230131
adv@7cc0fa834366:~$ cd live-build
adv@7cc0fa834366:~$ rm -rf manpages/po/
adv@7cc0fa834366:~$ sudo make install -j8
adv@7cc0fa834366:~$ cd ~
adv@7cc0fa834366:~$ rm -rf live-build -
Install qemeu and binfmts
adv@7cc0fa834366:~$ sudo apt-get update
adv@7cc0fa834366:~$ sudo apt-get install binfmt-support qemu-user-static --reinstall
adv@7cc0fa834366:~$ sudo update-binfmts --enable qemu-aarch64 -
Install gettext
adv@7cc0fa834366:~$ sudo apt-get update
adv@7cc0fa834366:~$ sudo apt-get install gettext -y
-
4. Getting Linux Source Code
4.1 Full SDK
cd ~/BSP
git clone https://github.com/ADVANTECH-Rockchip/repo.git
mkdir rk356x_linux5.10_v130_risc
cd rk356x_linux5.10_v130_risc
git config --global user.name "Your Name"
git config --global user.email you@example.com
../repo/repo init -u https://AIM-Linux@dev.azure.com/AIM-Linux/RISC-RK3568-Linux/_git/manifest \
-b rk356x_linux5.10_v130_risc -m default.xml
../repo/repo sync
../repo/repo forall -c git checkout -b local --track advantech-azure/rk356x_linux5.10_v130_risc
4.2 BSP Tarball
You can get BSP tarball (e.g., RSB4810A2AIM20DBV130311_2024-03-15.bsp.tgz) from our released BSP, then you have to copy it into container.
Follow the steps below:
1. Exit Container and Return to Local Machine
$ exit
2. Copy BSP Tarball to Workspace and Change Owner
$ export BSP_TARBALL="RSB4810A2AIM20DBV130311_2024-03-15.bsp.tgz"
$ cp ${BSP_TARBALL} ${WORKSPACE}
$ sudo chown adv:adv ${WORKSPACE}/${BSP_TARBALL}
3. Return to Container
$ sudo docker start ${CONTAINER_NAME}
$ sudo docker attach ${CONTAINER_NAME}
4. Unpack BSP Tarball
$ tar zxvf ${BSP_TARBALL}
- BSP tarball is for fast developing
ubootandkernel. - BSP tarball does NOT support building
recoverydebianandupdate.img.
5. Building
5.1 Choose Project
- Build RSB-4810 Project
export TOP=`pwd`
cd $TOP
./build.sh adv_rk3568_rsb4810a2_defconfig
- Build ROM-5880 Project
export TOP=`pwd`
cd $TOP
./build.sh adv_rk3568_rom5880a1_defconfig
- Build AFE-E630 Project
export TOP=`pwd`
cd $TOP
./build.sh adv_rk3568_afee630a1_defconfig
5.2 Build U-boot
cd $TOP
./build.sh uboot
5.3 Build Kernel
cd $TOP
./build.sh kernel
5.4 Build Recovery
cd $TOP
rm buildroot/output/rockchip_rk3568_recovery -rf
./build.sh recovery
5.5 Build Debian 11.x
cd $TOP
./build.sh debian
5.6 Push All Images to rockdev Folder
cd $TOP
./build.sh firmware
The common image files in rockdev/ directory are listed below:
boot.img
misc.img
oem.img
recovery.img
rootfs.img
uboot.img
userdata.img
MiniLoaderAll.bin
parameter.txt
5.7 Make update.img
cd $TOP
sudo apt-get install bsdmainutils
./build.sh updateimg
You can get update.img in rockdev/ directory.
6. Update Images
There are three ways to update images:
6.1 Using RKDevTool via USB Cable
There is no limitation by this method.
6.2 Local OTA
There are some limitations:
- The device must be able to boot up to Debian
- Only update images from the same OS (e.g., Debian upgrade to Debian)
- Using
update.imgto upgrade
6.3 Via SD card
- Only update images from the same OS (e.g., Debian upgrade to Debian)
- Using
update.imgto upgrade
7. Summary
7.1 Supported Hardware Platforms
- RSB-4810
- ROM-5880
- AFE-E630
7.2 System Requirements
- Docker environment with
advrisc/u20.04-rklbv1image - Ubuntu 20.04 base system
- BSP tarball from our released BSP
- Build tools and dependencies
- Sufficient disk space for source code and build artifacts
- Internet connection for package installation
- Target processors (RSB-4810, ROM-5880 or AFE-E630)
7.3 Build Workflow Summary
- Environment Setup → Docker + Ubuntu 20.04
- Source Acquisition → BSP tarball or Full SDK
- Project Selection → Choose target processors platform
- Component Build → U-boot → Kernel → (Recovery)* → (Debian)*
- Image Generation → Firmware packaging → (Update image)*
- Deployment → AndroidTool, SD/USB storage, or SDDiskTool
Components marked with asterisk () are not supported in BSP tarball mode.
7.4 Development Modes
7.4.1 BSP Tarball Mode (Limited)
- Use Case: Quick U-boot and kernel development
- Advantages: Fast setup, smaller download size
- Limitations: Cannot build recovery, debian, or update images
The BSP tarball is designed for fast development of uboot and kernel components. However, it has some limitations.
- ✅ Supported: U-boot building
- ✅ Supported: Kernel building
- ❌ NOT Supported: Recovery building
- ❌ NOT Supported: Debian building
- ❌ NOT Supported: Update image building
7.4.2 Full SDK Mode (Complete)
- Use Case: Complete system development and customization
- Advantages: Full build capability, all components supported
- Limitations: Larger download size