This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
products:sbc:common:development:edges-rockchip-linux-sdk [2024/12/13 01:50] gray [Preparation] : Add xz-utils |
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 | + | ====== |
+ | |||
+ | |||
+ | ===== 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, | For readability, | ||
- | ## Preparation | + | ===== Preparation |
- | Install essential dependencies. It is recommended to use Ubuntu 22.04 for compilation. | + | Install essential dependencies. |
```shell | ```shell | ||
- | sudo apt-get update && sudo apt-get install | + | $ sudo apt update && sudo apt install |
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 xz-utils 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 | + | 1. Download the base SDK packages here: [[https:// |
+ | <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 | ||
+ | </ | ||
- | ```bash | + | <WRAP tip > |
- | # Repalce " | + | You can also download the [[dl> |
- | git config --global user.name " | + | |
- | git config --global user.email " | + | |
+ | ```shell | ||
+ | $ md5sum -c md5sum/* | ||
+ | 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: | ||
``` | ``` | ||
- | Clone the source code to somewhere, | + | </WRAP> |
- | ```bash | + | 2. Create and enter the working directory: |
- | mkdir -p ~/project/SDK | + | ```shell |
- | cd ~/project/SDK | + | $ mkdir -p ~/project/edge2-linux-sdk && |
- | repo init -u https:// | + | |
- | repo sync | + | |
- | repo start khadas-edge2-linux6.1 | + | |
``` | ``` | ||
- | ## Update | + | 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/ |
- | .repo/repo/repo sync -c | + | |
``` | ``` | ||
- | ## Introduction to SDK project directory | + | 4. Then you can see '' |
+ | |||
+ | ```shell | ||
+ | $ ls -al ~/ | ||
+ | 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/ | ||
+ | $ git pull | ||
+ | $ cd - | ||
+ | $ .repo/ | ||
+ | $ .repo/ | ||
+ | $ ls | ||
+ | Copyright_Statement.md | ||
+ | ``` | ||
+ | |||
+ | 6. Sync large files: | ||
+ | |||
+ | ```shell | ||
+ | $ .repo/ | ||
+ | ``` | ||
+ | |||
+ | 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/ | ||
+ | ``` | ||
+ | |||
+ | ===== Update SDK ===== | ||
+ | |||
+ | In the future, you can use the following command to update the SDK code: | ||
+ | ```shell | ||
+ | $ cd ~/ | ||
+ | $ .repo/ | ||
+ | ``` | ||
+ | |||
+ | ===== 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 '' | The SDK can be easily compiled using the '' | ||
- | ### 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 < | + | $ cd < |
- | ./build.sh lunch | + | $ ./build.sh lunch |
``` | ``` | ||
Line 86: | Line 146: | ||
There are three configuration files for Edge2 in < | There are three configuration files for Edge2 in < | ||
- | ```bash | + | ```shell |
- | ls < | + | $ ls < |
khadas_rk3588s_edge2_buildroot_defconfig # | khadas_rk3588s_edge2_buildroot_defconfig # | ||
khadas_rk3588s_edge2_debian_defconfig # | khadas_rk3588s_edge2_debian_defconfig # | ||
Line 132: | Line 192: | ||
</ | </ | ||
+ | ==== Build the OS Image ==== | ||
+ | |||
+ | |||
+ | After setting up the compile configuration, | ||
+ | |||
+ | Then you can get the image in ''< | ||
<WRAP important > | <WRAP important > | ||
Line 150: | Line 216: | ||
</ | </ | ||
+ | ==== Other Build Commands ==== | ||
- | ### Build the OS Image | ||
- | After setting up the compile configuration, | + | === 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 '' | You can get help messages by executing '' | ||
- | ```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 | ||
| | ||
| | ||
Line 267: | Line 329: | ||
``` | ``` | ||
- | ## Install OS | + | ===== Build in Docker ===== |
- | ### Preparation | ||
- | 1. Copy upgrade tool to your local path | + | You can also choose |
- | ```bash | + | ==== Install Docker ==== |
- | sudo cp < | + | |
- | ``` | + | |
- | 2. Put your Edge2 into upgrade mode. Ref:[[products: | + | Please refer to [[https:// |
- | ### Install OS into eMMc | + | ==== Add User to a Docker Group ==== |
- | ```bash | + | ```shell |
- | sudo upgrade_tool uf < | + | $ 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. |
</ | </ | ||
- | ### Upgrade Uboot | + | ==== Build SDK in Docker ==== |
+ | |||
+ | Get Docker image: | ||
+ | |||
+ | ```shell | ||
+ | $ docker pull wesion/ | ||
``` | ``` | ||
- | sudo upgrade_tool di -uboot <SDK>/output/update/Image/uboot.img | + | |
+ | Enter Docker: | ||
+ | |||
+ | ```shell | ||
+ | $ cd ~/ | ||
+ | $ docker run --rm -it --privileged --device=/dev/loop-control: | ||
+ | | ||
+ | -v $(pwd):/ | ||
``` | ``` | ||
- | ### Upgrade Kernel | + | Start your build from inside the Docker container. |
+ | ```shell | ||
+ | khadas@59f19b6a36e2: | ||
+ | khadas@59f19b6a36e2: | ||
``` | ``` | ||
- | sudo upgrade_tool di -boot < | + | |
+ | ===== Install OS ===== | ||
+ | |||
+ | ==== Preparation ==== | ||
+ | |||
+ | 1. Copy upgrade tool to your local path | ||
+ | |||
+ | ```shell | ||
+ | $ sudo cp < | ||
``` | ``` | ||
- | ### Upgrade Rootfs | + | 2. Put your Edge2 into upgrade mode. Ref: |
+ | ==== Install OS into eMMC ==== | ||
+ | |||
+ | Please check [[products: | ||
+ | |||
+ | |||
+ | ==== Partition Upgrade ==== | ||
+ | |||
+ | <WRAP important > | ||
+ | Invalid in Maskrom Mode! | ||
+ | </ | ||
+ | |||
+ | ==== Upgrade Uboot ==== | ||
+ | |||
+ | |||
+ | ```shell | ||
+ | $ sudo upgrade_tool di -uboot < | ||
``` | ``` | ||
- | sudo upgrade_tool di -rootfs < | + | ==== Upgrade kernel ==== |
+ | |||
+ | |||
+ | ```shell | ||
+ | $ sudo upgrade_tool di -boot < | ||
+ | ``` | ||
+ | |||
+ | ==== Upgrade rootfs ==== | ||
+ | |||
+ | |||
+ | ```shell | ||
+ | $ sudo upgrade_tool di -rootfs < | ||
``` | ``` | ||
Line 311: | Line 419: | ||
</ | </ | ||
- | ## User and password | + | ===== User and password |
<tabbox Buildroot> | <tabbox Buildroot> | ||
Line 336: | Line 445: | ||
</ | </ | ||
- | ## 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-connect.sh < |
- | udhcpc -i wlan0 -b | + | $ udhcpc -i wlan0 -b |
``` | ``` | ||
Or reboot after editing / | Or reboot after editing / | ||
- | ``` | + | ```txt |
ctrl_interface=/ | ctrl_interface=/ | ||
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 383: | Line 494: | ||
</ | </ | ||
- | ## Camera | + | ===== Camera |
Please refer to [[products: | Please refer to [[products: | ||