Skip to main content

SDK Related - Compiling Firmware

Navigation bar


1. 📁 RV1126 SDK File Download​

Warning

CAM126 / CAM126B-P: pay attention to the distinction

Go to CAM126 SDK | Go to CAM126B-P SDK

Link: https://pan.baidu.com/s/1OSdhBi32C13lBNVC-Sz63w?pwd=fanc

Extraction code: fanc


2. Extract Files​

The downloaded SDK files are as follows

The quantity may not be the same; as long as it can be extracted normally without errors, it is fine
roy@13500h:~/rv1126$ ls
rv1126-repo-v20230717-dev.tar.gz00 rv1126-repo-v20230717-dev.tar.gz01
rv1126-repo-v20230717-dev.tar.gz02

Merge multiple split files and extract

cat rv1126-repo-v20230717-dev.tar.gz* > rv1126-repo-v20230717-dev.tar.gz

tar -zxvf rv1126-repo-v20230717-dev.tar.gz

Move to the build directory

mv rv1126-repo-v20230717-dev ~/

cd ~/rv1126-repo-v20230717-dev

After extraction, you may first read the official RK instructions

The document is located at rv1126-repo-v20230717-dev/docs/Rockchip_Developer_Guide_Linux_Software_CN.pdf


3. Prepare the Environment​

The installation commands for the software packages that the SDK build environment depends on are as follows:

sudo apt-get install git ssh make gcc libssl-dev liblz4-tool expect \
g++ patchelf chrpath gawk texinfo chrpath diffstat binfmt-support \
qemu-user-static live-build bison flex fakeroot cmake gcc-multilib \
g++-multilib unzip device-tree-compiler ncurses-dev libgucharmap-2-90-dev \
bzip2 expat gpgv2 cpp-aarch64-linux-gnu time mtd-utils

Python dependency packages:

sudo pip3 install asciidoc

Add one command that may be needed:

If Ubuntu 22 says python is not available, you can link pythone3 to it

root@13500h:~$ python

-bash: python: command not found

sudo ln -s /usr/bin/python3 /usr/bin/python

4. First Build​


4.1 The first compilation requires a full build​

Configure first

./build.sh lunch
  • Remember to select 2.rockchip 38x38 emmc defconfig

  • Enter 2 and press Enter

Start the full build

./build.sh

4.2 Compile uboot separately​

./build.sh uboot

4.3 Compile kernel separately​

./build.sh kernel

4.4 Compile rootfs separately​

./build.sh rootfs

4.5 Build Directory​

The final built files are located in ~/rv1126-repo-v20230717-dev/rockdev


FAQ​

SDK Notes​

This is RK's official SDK; we only performed basic BSP adaptation and image effects.

For specific functional aspects, you can implement them based on the open-source code. We do not provide customization work in this direction.


repo compile error​

Find the file that reports the error and comment out repo

device/rockchip/common/scripts/mk-all.sh

device/rockchip/common/scripts/post-info.sh

Image


Using Uart0 requires modifying the device tree and recompiling the kernel​

Already compiled version​

Files shared via network disk: 
Link: https://pan.baidu.com/s/1NyfRuSKcakxMJCZohiFl6A?pwd=fanc Extraction code: fanc Copy this content and open the Baidu Network Disk mobile app for more convenient operation
--Shared by Baidu Network Disk Super Member v6

Place it in the 使用 TTL 请单刷 BOOT 分区 directory

Compile the kernel yourself​

  • Modify the device tree kernel/scripts/dtc/include-prefixes/arm/rv1126-38x38-v10-emmc.dts

    1. Change status in gpio_i2c to disabled

    2. Add a new node uart0 with status = "okay"

	gpio_i2c: gpio_i2c {
status = "disabled";
compatible = "i2c-gpio";
scl-gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_HIGH>;
sda-gpios = <&gpio1 RK_PC3 GPIO_ACTIVE_HIGH>;
i2c-gpio,delay-us = <2>; /* ~100 kHz */
#address-cells = <1>;
#size-cells = <0>;
};
&uart0 {
status = "okay";
};

Configure RNDIS​

vim device/rockchip/common/images/oem/oem_uvcc/usb_config.sh

pre_run_rndis()
{
# RNDIS reference:
# 1) Use DEFAULT_RNDIS_IP by default.
# 2) If /data/uvc_xu_ip_save exists, the first line overrides it.
DEFAULT_RNDIS_IP="192.168.77.1"
DEFAULT_RNDIS_MASK="255.255.255.0"
IP_FILE=/data/uvc_xu_ip_save

if echo "$1" | grep -q "rndis"; then
RNDIS_IP="$DEFAULT_RNDIS_IP"
echo "config usb0 IP..."

if [ -f "$IP_FILE" ]; then
SAVED_IP="$(sed -n '1p' "$IP_FILE")"
if [ -n "$SAVED_IP" ]; then
RNDIS_IP="$SAVED_IP"
fi
echo "saved ip is: $RNDIS_IP"
fi

ifconfig usb0 "$RNDIS_IP" netmask "$DEFAULT_RNDIS_MASK"
ifconfig usb0 up
fi
}

A reference rndis version has already been modified; the file is:

  • device/rockchip/common/images/oem/oem_uvcc/usb_config.sh

What was changed is pre_run_rndis(), and the current behavior is:

  • By default, configure usb0 with 192.168.77.1/24
  • If /data/uvc_xu_ip_save exists, read the first line as the overriding IP
  • Finally uniformly run ifconfig usb0 up

You can try it directly:

  • /oem/usb_config.sh rndis

If you want to change it to your own network segment, just change these two variables:

  • DEFAULT_RNDIS_IP="192.168.77.1"
  • DEFAULT_RNDIS_MASK="255.255.255.0"

If you want "a completely fixed IP that does not allow file override", I can also change it to a pure fixed version for you.

Compile Debian command​

You need to configure the variable; everything else stays the same

export RK_ROOTFS_SYSTEM=debian
AI Translation Notice

This page was translated into English by AI and is provided for reference only. The original document is written in Chinese. If there is any discrepancy, the Chinese version prevails.

本页英文内容由 AI 自动翻译生成,仅供参考;原文为中文,如有差异请以中文原文为准。

查看中文原文 / View the Chinese original →