Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:common:development:edges-rockchip-linux-sdk

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
products:sbc:common:development:edges-rockchip-linux-sdk [2024/12/11 01:16]
gray Add bluetooth usage
products:sbc:common:development:edges-rockchip-linux-sdk [2025/02/27 20:08] (current)
gray [Get SDK] Add update repo
Line 1: Line 1:
-Edge2 Rockchip Linux6.1 SDK developer guide+====== Edge2 Rockchip Linux SDK developer guide ====== 
 + 
 + 
 +===== Introduction =====
  
-## Introduction 
  
 The Rockchip Linux SDK support Buildroot, Debian and Yocto. We will introduce how to build Edge2 firmware using the Rockchip Linux SDK here. The Rockchip Linux SDK support Buildroot, Debian and Yocto. We will introduce how to build Edge2 firmware using the Rockchip Linux SDK here.
 For readability, the subsequent Rockchip Linux SDK will be referred to as SDK. For readability, the subsequent Rockchip Linux SDK will be referred to as SDK.
  
-## Preparation+===== Preparation =====
  
-Install essential dependencies. It is recommended to use Ubuntu 22.04 for compilation.+Install essential dependencies. **It is recommended to use Ubuntu 22.04 for compilation**, or you can choose to [[#build-in-docker | Build in Docker]].
  
 ```shell ```shell
-sudo apt-get update && sudo apt-get install git ssh make gcc libssl-dev \+sudo apt update && sudo apt install -git ssh make gcc libssl-dev \
 liblz4-tool expect expect-dev g++ patchelf chrpath gawk texinfo chrpath \ liblz4-tool expect expect-dev g++ patchelf chrpath gawk texinfo chrpath \
 diffstat binfmt-support qemu-user-static live-build bison flex fakeroot \ diffstat binfmt-support qemu-user-static live-build bison flex fakeroot \
 cmake gcc-multilib g++-multilib unzip device-tree-compiler ncurses-dev \ cmake gcc-multilib g++-multilib unzip device-tree-compiler ncurses-dev \
 libgucharmap-2-90-dev bzip2 expat gpgv2 cpp-aarch64-linux-gnu libgmp-dev \ libgucharmap-2-90-dev bzip2 expat gpgv2 cpp-aarch64-linux-gnu libgmp-dev \
-libmpc-dev bc python-is-python3 python2 libstdc++-12-dev repo+libmpc-dev bc python-is-python3 python2 libstdc++-12-dev xz-utils repo git-lfs
 ``` ```
  
-## Get SDK+===== Get SDK =====
  
-Set git configuration before getting SDK:+1. Download the base SDK packages here[[https://dl.khadas.com/development/yocto/khadas_edges_yocto_sdk_base/ | khadas_edges_yocto_sdk_base.tar.gz0x]] 
 +<WRAP important > 
 +You need to download all 5 compressed files: 
 +  * khadas_edges_yocto_sdk_base.tar.gz00 
 +  * khadas_edges_yocto_sdk_base.tar.gz01 
 +  * khadas_edges_yocto_sdk_base.tar.gz02 
 +  * khadas_edges_yocto_sdk_base.tar.gz03 
 +  * khadas_edges_yocto_sdk_base.tar.gz04 
 +</WRAP>
  
-```bash +<WRAP tip > 
-# Repalce "Name" and "You@email" according to the actual situation +You can also download the [[dl>development/yocto/khadas_edges_yocto_sdk_base/md5sum/ | md5 checksum]] to verify the downloaded files:
-git config --global user.name "Name" +
-git config --global user.email "You@email"+
  
 +```shell
 +$ md5sum -c md5sum/*
 +khadas_edges_yocto_sdk_base.tar.gz00: OK
 +khadas_edges_yocto_sdk_base.tar.gz01: OK
 +khadas_edges_yocto_sdk_base.tar.gz02: OK
 +khadas_edges_yocto_sdk_base.tar.gz03: OK
 +khadas_edges_yocto_sdk_base.tar.gz04: OK
 ``` ```
-Clone the source code to somewhere,e.g.,''~/project/SDK''+</WRAP>
  
-```bash +2. Create and enter the working directory: 
-mkdir -p ~/project/SDK +```shell 
-cd ~/project/SDK +mkdir -p ~/project/edge2-linux-sdk && cd ~/project/edge2-linux-sdk
-repo init -u https://gitlab.com/khadas-edge2/manifests -b khadas-edges-6.1.y -m kedges_linux6.1_release.xml +
-repo sync +
-repo start khadas-edge2-linux6.1 --all+
 ``` ```
  
-## Update SDK +3. Decompress base SDK: 
-You can use the following command to update the SDK later + 
-```sh +```shell 
-cd ~/project/ +$ cat path/to/sdk-base-packages/khadas_edges_yocto_sdk_base.tar.gz* | tar -zxv -C ~/project/edge2-linux-sdk
-.repo/repo/repo sync -+
 ``` ```
  
-## Introduction to SDK project directory+4. Then you can see ''.repo'' derctory in ''~/project/edge2-linux-sdk'' directory by using ''ls -la'' command. 
 + 
 +```shell 
 +$ ls -al ~/project/edge2-linux-sdk 
 +total 12 
 +drwxrwxr-x 3 nick nick 4096 Dec 31 14:40 . 
 +drwxrwxr-x 3 nick nick 4096 Dec 31 14:39 .. 
 +drwxrwxr-x 7 nick nick 4096 Dec 30 16:21 .repo 
 +``` 
 + 
 +5. Sync and update code: 
 + 
 +```shell 
 +$ cd .repo/repo 
 +$ git pull 
 +$ cd - 
 +$ .repo/repo/repo sync -l  
 +$ .repo/repo/repo sync -c 
 +$ ls 
 +Copyright_Statement.md  Makefile  app  build.sh  buildroot  debian  device  docs  external  kernel  prebuilts  rkbin  rkflash.sh  tools  u-boot  yocto 
 +``` 
 + 
 +6. Sync large files: 
 + 
 +```shell 
 +$ .repo/repo/repo forall -c 'git lfs pull' 
 +``` 
 + 
 +7. If you need to build Yocto, please disable the auto-detaching feature of git gc: 
 +```shell 
 +$ git config --global gc.autoDetach false 
 +``` 
 + 
 +8. Create a work branch for each repository: 
 +```shell 
 +$ .repo/repo/repo start khadas --all 
 +``` 
 + 
 +===== Update SDK ===== 
 + 
 +In the future, you can use the following command to update the SDK code: 
 +```shell 
 +$ cd ~/project/edge2-linux-sdk 
 +$ .repo/repo/repo sync -c  
 +``` 
 + 
 +===== Introduction to SDK project directory ===== 
  
 The SDK project directory includes buildroot, debian, app, kernel, u-boot, device, docs, external, etc. The SDK project directory includes buildroot, debian, app, kernel, u-boot, device, docs, external, etc.
Line 68: Line 126:
  
  
-## Compilation+===== Compilation ===== 
  
 The SDK can be easily compiled using the ''build.sh'' script. The SDK can be easily compiled using the ''build.sh'' script.
  
-### Setup the Compile Configuration+==== Setup the Compile Configuration ==== 
  
 You should setup the compile configuration before compilation. You should setup the compile configuration before compilation.
  
-```bash +```shell 
-cd <SDK> +cd <SDK> 
-./build.sh lunch+./build.sh lunch
 ``` ```
  
Line 86: Line 146:
 There are three configuration files for Edge2 in <SDK>/device/rockchip/rk3588/ There are three configuration files for Edge2 in <SDK>/device/rockchip/rk3588/
  
-```bash +```shell 
-ls <SDK>/device/rockchip/rk3588/khadas_rk3588s_edge2_*+ls <SDK>/device/rockchip/rk3588/khadas_rk3588s_edge2_*
 khadas_rk3588s_edge2_buildroot_defconfig # for Buildroot khadas_rk3588s_edge2_buildroot_defconfig # for Buildroot
 khadas_rk3588s_edge2_debian_defconfig # for Debian khadas_rk3588s_edge2_debian_defconfig # for Debian
Line 132: Line 192:
 </tabbox> </tabbox>
  
 +==== Build the OS Image ====
 +
 +
 +After setting up the compile configuration, just run ''./build.sh'' to start building. 
 +
 +Then you can get the image in ''<SDK>/output/'' directory.
  
 <WRAP important > <WRAP important >
Line 150: Line 216:
 </WRAP> </WRAP>
  
 +==== Other Build Commands ====
  
-### Build the OS Image 
  
-After setting up the compile configuration, just run ''./build.sh'' to start the build.+=== Build u-boot ===
  
-### Other Build Commands 
  
-#### Build U-Boot +```shell 
- +./build.sh uboot
-```bash +
-./build.sh uboot+
 ``` ```
  
-#### Build Kernel+=== Build kernel ===
  
-```bash + 
-./build.sh kernel+```shell 
 +./build.sh kernel
 ``` ```
  
-#### Build Rootfs+=== Build rootfs ===
  
-```bash + 
-./build.sh rootfs+```shell 
 +./build.sh rootfs
 ``` ```
  
-### Help Messages+==== Help messages ==== 
  
 You can get help messages by executing ''./build.sh help'': You can get help messages by executing ''./build.sh help'':
  
-```bash+```txt
 Usage: build.sh [OPTIONS] Usage: build.sh [OPTIONS]
 Available options: Available options:
Line 189: Line 255:
  khadas_rk3588s_edge2_debian_defconfig  khadas_rk3588s_edge2_debian_defconfig
  khadas_rk3588s_edge2_yocto_defconfig  khadas_rk3588s_edge2_yocto_defconfig
- rockchip_defconfig 
- rockchip_rk3588_evb1_lp4_v10_defconfig 
- rockchip_rk3588_evb7_v11_defconfig 
- rockchip_rk3588s_evb1_lp4x_v10_defconfig 
  olddefconfig                      resolve any unresolved symbols in .config  olddefconfig                      resolve any unresolved symbols in .config
  savedefconfig                    save current config to defconfig  savedefconfig                    save current config to defconfig
Line 267: Line 329:
 ``` ```
  
-## Install OS+===== Build in Docker =====
  
-### Preparation 
  
-1. Copy upgrade tool to your local path+You can also choose to build the OS image in a Docker container.
  
-```bash +==== Install Docker ====
-sudo cp <SDK>/tools/linux/Linux_Upgrade_Tool/Linux_Upgrade_Tool/upgrade_tool /usr/local/bin/ +
-```+
  
-2. Put your Edge2 into upgrade mode. Ref:[[products:sbc:edge2:install-os:boot-into-upgrade-modeBoot into upgrade mode]]+Please refer to [[https://docs.docker.com/engine/install/|Docker Documentation]].
  
-### Install OS into eMMc+==== Add User to a Docker Group ====
  
-```bash +```shell 
-sudo upgrade_tool uf <SDK>/output/update/Image/update.img+sudo usermod -aG docker $USER
 ``` ```
  
-## Partition Upgrade 
 <WRAP important > <WRAP important >
-Invalid in Maskrom Mode! +You need to logout or reboot the system to take effect.
 </WRAP> </WRAP>
  
-### Upgrade Uboot+==== Build SDK in Docker ====
  
 +
 +Get Docker image:
 +
 +```shell
 +$ docker pull wesion/yocto-rockchip
 ``` ```
-sudo upgrade_tool di -uboot <SDK>/output/update/Image/uboot.img+ 
 +Enter Docker: 
 + 
 +```shell 
 +$ cd ~/project/edge2-linux-sdk 
 +$ docker run --rm -it  --privileged --device=/dev/loop-control:/dev/loop-control \ 
 +             --device=/dev/loop0:/dev/loop0 --cap-add SYS_ADMIN -v /opt:/opt \ 
 +             -v $(pwd):/home/khadas/yocto wesion/yocto-rockchip bash
 ``` ```
-### Upgrade Kernel+Start your build from inside the Docker container.
  
 +```shell
 +khadas@59f19b6a36e2:~/yocto$ ./build.sh lunch
 +khadas@59f19b6a36e2:~/yocto$ ./build.sh
 ``` ```
-sudo upgrade_tool di -boot <SDK>/output/update/Image/boot.img+ 
 +===== Install OS ===== 
 + 
 +==== Preparation ==== 
 + 
 +1. Copy upgrade tool to your local path 
 + 
 +```shell 
 +sudo cp <SDK>/tools/linux/Linux_Upgrade_Tool/Linux_Upgrade_Tool/upgrade_tool /usr/local/bin/
 ``` ```
  
-### Upgrade Rootfs+2. Put your Edge2 into upgrade mode. Ref:[[products:sbc:edge2:install-os:boot-into-upgrade-mode| Boot into upgrade mode]]
  
 +==== Install OS into eMMC ====
 +
 +Please check [[products:sbc:edge2:install-os:install-os-into-emmc-via-usb-tool|]].
 +
 +
 +==== Partition Upgrade ====
 +
 +<WRAP important >
 +Invalid in Maskrom Mode! 
 +</WRAP>
 +
 +==== Upgrade Uboot ====
 +
 +
 +```shell
 +$ sudo upgrade_tool di -uboot <SDK>/output/update/Image/uboot.img
 ``` ```
-sudo upgrade_tool di -rootfs <SDK>/output/update/Image/rootfs.img+==== Upgrade kernel ==== 
 + 
 + 
 +```shell 
 +$ sudo upgrade_tool di -boot <SDK>/output/update/Image/boot.img 
 +``` 
 + 
 +==== Upgrade rootfs ==== 
 + 
 + 
 +```shell 
 +sudo upgrade_tool di -rootfs <SDK>/output/update/Image/rootfs.img
 ``` ```
  
Line 311: Line 419:
 </WRAP> </WRAP>
  
-## User and password+===== User and password ===== 
  
 <tabbox Buildroot> <tabbox Buildroot>
Line 336: Line 445:
 </tabbox> </tabbox>
  
-## WIFI+===== WIFI ===== 
  
 <tabbox Buildroot && Yocto> <tabbox Buildroot && Yocto>
 You can use the following command to connect WIFI: You can use the following command to connect WIFI:
  
-``` +```shell 
-wifi-connect.sh <wifi_name> <wifi_password> +wifi-connect.sh <wifi_name> <wifi_password> 
-udhcpc -i wlan0 -b+udhcpc -i wlan0 -b
 ``` ```
  
 Or reboot after editing /etc/wpa_supplicant.conf as follow: Or reboot after editing /etc/wpa_supplicant.conf as follow:
-```+```txt
 ctrl_interface=/var/run/wpa_supplicant ctrl_interface=/var/run/wpa_supplicant
 ap_scan=1 ap_scan=1
Line 362: Line 472:
 You can use the following command to connect WIFI: You can use the following command to connect WIFI:
  
-``` +```shell 
-sudo nmcli radio wifi on +sudo nmcli radio wifi on 
-sudo nmcli device wifi connect wifi_name password wifi_password+sudo nmcli device wifi connect wifi_name password wifi_password
 ``` ```
  
Line 371: Line 481:
  
  
-## Bluetooth+===== Bluetooth ===== 
  
 <tabbox Buildroot && Yocto> <tabbox Buildroot && Yocto>
Line 382: Line 493:
  
 </tabbox> </tabbox>
 +
 +===== Camera =====
 +
 +Please refer to [[products:sbc:edge2:add-ons:edge2-mipi-camera|]]
 +
 +
Last modified: 2024/12/11 01:16 by gray