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/30 03:35] gray [Preparation] |
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 | ||
- | The Rockchip | + | ===== Introduction ===== |
+ | |||
+ | |||
+ | The Rockchip | ||
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 \ | ||
Line 19: | Line 21: | ||
``` | ``` | ||
- | ## Get SDK | + | ===== Get SDK ===== |
- | 1. Download the base SDK packages here: [[https:// | + | 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 | ||
+ | </ | ||
- | 2. Unpackage SDK package: | + | <WRAP tip > |
- | ```sh | + | You can also download the [[dl> |
- | tar -zxvf khadas_edges_yocto_sdk_base.tar.gz | + | |
+ | ```shell | ||
+ | $ md5sum | ||
+ | khadas_edges_yocto_sdk_base.tar.gz00: OK | ||
+ | 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: | ||
``` | ``` | ||
- | 3. Create and enter the working directory: | + | </ |
- | ```sh | + | |
- | mkdir ~/project && cd ~/project | + | 2. Create and enter the working directory: |
+ | ```shell | ||
+ | $ mkdir -p ~/project/ | ||
``` | ``` | ||
- | 4. Decompress base SDK: | + | 3. Decompress base SDK: |
- | ```sh | + | |
- | cat path/to/SDK_packages/ | + | ```shell |
+ | $ cat path/to/sdk-base-packages/ | ||
``` | ``` | ||
- | 5. Then you can see '' | + | 4. Then you can see '' |
- | 6. Sync and update code: | + | ```shell |
- | ```sh | + | $ ls -al ~/project/edge2-linux-sdk |
- | .repo/repo/repo sync -l | + | total 12 |
- | .repo/ | + | 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 | ||
``` | ``` | ||
- | 7. Create a work branch for each repository: | + | 5. Sync and update code: |
- | ```sh | + | |
- | .repo/ | + | ```shell |
+ | $ cd .repo/repo | ||
+ | $ git pull | ||
+ | $ cd - | ||
+ | $ .repo/repo/repo sync -l | ||
+ | $ .repo/ | ||
+ | $ ls | ||
+ | Copyright_Statement.md | ||
``` | ``` | ||
- | ## Update SDK | + | 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: | In the future, you can use the following command to update the SDK code: | ||
- | ```sh | + | ```shell |
- | cd ~/ | + | $ cd ~/project/edge2-linux-sdk |
- | .repo/ | + | $ .repo/ |
``` | ``` | ||
- | ## Introduction to SDK project directory | + | ===== 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 79: | 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 97: | 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 143: | Line 192: | ||
</ | </ | ||
- | ### Build the OS Image | + | ==== Build the OS Image ==== |
After setting up the compile configuration, | After setting up the compile configuration, | ||
Line 166: | Line 216: | ||
</ | </ | ||
- | ### Other Build Commands | + | ==== Other Build Commands |
- | #### Build U-Boot | ||
- | ```bash | + | === Build u-boot === |
- | ./build.sh uboot | + | |
+ | |||
+ | ```shell | ||
+ | $ ./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 200: | 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 278: | 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 ==== |
- | ```sh | + | ```shell |
- | upgrade_tool uf < | + | $ sudo usermod |
``` | ``` | ||
- | ## 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 322: | Line 419: | ||
</ | </ | ||
- | ## User and password | + | ===== User and password |
<tabbox Buildroot> | <tabbox Buildroot> | ||
Line 347: | 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 373: | 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 382: | Line 481: | ||
- | ## Bluetooth | + | ===== Bluetooth |
<tabbox Buildroot && Yocto> | <tabbox Buildroot && Yocto> | ||
Line 394: | Line 494: | ||
</ | </ | ||
- | ## Camera | + | ===== Camera |
Please refer to [[products: | Please refer to [[products: | ||