Skip to main content

Flashing and Boot

Partition Table​

reCamera Pro partitions are defined by RK_PARTITION_CMD_IN_ENV in the board configuration:

32K(env),512K@32K(idblock),4M@1M(uboot),64K(misc),10M(recovery),11M(boot),3G(rootfs),-(userdata),
PartitionSizeOffsetContentsImage file
env32 K0Partition table + boot argumentsenv.img
idblock512 K32 KLoader (including DDR initialization)idblock.img
uboot4 M1 MU-Bootuboot.img
misc64 K—Recovery boot flag, etc.misc.img (this board uses recovery-misc.img)
recovery10 M—Recovery systemrecovery.img
boot11 M—Kernel + DTBboot.img
rootfs3 G—Root filesystem, ext4rootfs.img
userdataRemaining space—ext4, mounted at /userdatauserdata.img

Filesystem types are specified by RK_PARTITION_FS_TYPE_CFG=rootfs@IGNORE@ext4,userdata@/userdata@ext4: rootfs is not explicitly mounted in fstab (the kernel mounts it with root=PARTUUID=), while userdata is mounted at /userdata.

Kernel command line from chosen/bootargs in rv1126b-recamera2-v1.dts:

earlycon=uart8250,mmio32,0x20810000 console=ttyFIQ0 rw root=PARTUUID=614e0000-0000 rootfstype=ext4 rootwait snd_soc_core.prealloc_buffer_size_kbytes=16 coherent_pool=32K

CMA size is controlled by RK_BOOTARGS_CMA_SIZE="8M".

Allow the Host to Detect the Device (One-Time Setup)​

The flashing tool communicates over USB Rockusb and needs a udev rule (VID 2207 is Rockchip):

sudo cp tools/linux/Linux_Upgrade_Tool/88-rockusb.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm trigger

tools/linux/SocToolKit/ also includes 88-rockusb.rules and 38-disk.rules; install both when using the GUI tool.

Enter Flashing Mode​

The device must be in Maskrom or Loader mode for upgrade_tool to detect it:

  • Maskrom: power the device off completely, then hold the Maskrom/Recovery button while powering it on (or short eMMC CLK to ground). The host should show a Rockchip device such as 2207:xxxx in lsusb.
  • Loader: if a working U-Boot is installed, run upgrade_tool db <loader> or interrupt the U-Boot countdown to enter Loader mode.

Check the hardware manual or schematic for the exact button location and silkscreen on reCamera Pro. Confirm this on a physical device before adding details here.

Check whether the device is detected:

sudo tools/linux/Linux_Upgrade_Tool/upgrade_tool ld

ListDevice should show devices in flashing mode.

The ./rkflash.sh script in the SDK root wraps upgrade_tool; image paths are fixed under output/image/.

sudo ./rkflash.sh              # Same as all: flash every partition
sudo ./rkflash.sh all
sudo ./rkflash.sh loader
sudo ./rkflash.sh uboot
sudo ./rkflash.sh boot # Flash the kernel only
sudo ./rkflash.sh rootfs # Flash the root filesystem only
sudo ./rkflash.sh userdata
sudo ./rkflash.sh recovery
sudo ./rkflash.sh misc
sudo ./rkflash.sh trust
sudo ./rkflash.sh rd # Reboot the device only
sudo ./rkflash.sh erase # Erase the entire flash

The second argument can specify a custom image path:

sudo ./rkflash.sh boot /path/to/my_boot.img

The actual command sequence for all mode (see project/rkflash.sh) is:

upgrade_tool ul -noreset download.bin     # Download loader without resetting
upgrade_tool di -p parameter.txt # Write partition table
upgrade_tool di -uboot uboot.img
upgrade_tool di -m misc.img
upgrade_tool di -r recovery.img
upgrade_tool di -b boot.img
upgrade_tool di -rootfs rootfs.img
upgrade_tool di -userdata userdata.img
upgrade_tool rd # Reset and reboot

Two important pitfalls:

  • The update.img flashing branch in rkflash.sh is commented out, so ./rkflash.sh update does nothing. To flash the full package, run upgrade_tool uf directly.
  • all mode does not flash env.img; it writes only parameter.txt. If you changed RK_PARTITION_CMD_IN_ENV, manually run upgrade_tool di -p env.img or flash update.img with uf.

Use upgrade_tool Directly​

Tool version v2.26 (tools/linux/Linux_Upgrade_Tool/revision.txt). Common commands:

CommandPurpose
ldListDevice: list devices in flashing mode
cd <n>ChooseDevice: select a device when multiple are connected
ul <loader> [-noreset] [EMMC]UpgradeLoader: download the loader to memory
db <loader>DownloadBoot
uf <update.img> [-noreset]UpgradeFirmware: flash the full package
di -p [parameter.txt]Write the partition table
di -b [boot.img]Write the boot partition
di -rootfs [rootfs.img]Write the rootfs partition
di -u [userdata.img]Write the userdata partition
di -r [recovery.img]Write recovery
di -m [misc.img]Write misc
plPartitionList: read the device partition table
`ef [loaderfirmware]`
rdResetDevice: reboot
sn [serial-number] / rsnWrite / read the serial number (with project/app/recamera_utils/sn_tool)
sfi [firmware]ShowFirmwareInfo: show firmware information
`exf [firmwareloader] [dir]`
gpt [parameter] [out.gpt]Generate GPT from the partition table
rl [startSec] [len] [file] / wl [startSec] [sizeSec] [file]Read / write LBA data

Example:

cd tools/linux/Linux_Upgrade_Tool
sudo ./upgrade_tool ld
sudo ./upgrade_tool ul ../../../output/image/download.bin
sudo ./upgrade_tool uf ../../../output/image/update.img
sudo ./upgrade_tool rd

For full command details, see 命令行开发工具使用文档.pdf and readme.txt in the same directory.

GUI Flashing​

  • Linux: tools/linux/SocToolKit/SocToolKit (Qt GUI; install 38-disk.rules and 88-rockusb.rules first).
  • Windows: download Rockchip RKDevTool separately; the SDK does not include the Windows tool.

Create a Factory Image​

./build.sh factory

This uses tools/linux/SocToolKit/bin/linux/programmer_image_tool to unpack output/image/update.img into output/image/factory/. The image type is selected from RK_BOOT_MEDIUM (set to emmc for this board). NAND media also pass block/page/OOB parameters, which can be overridden with RK_NAND_BLOCK_SIZE and related variables.

SD-Card Upgrade Image​

./build.sh sdcard_upgrade

The output directory is output/image/sdcard_upgrade/.

Not available for this board configuration: sdcard_upgrade requires RK_SDCARD_UPGRADE_UBOOT_DEFCONFIG and ..._FRAGMENT, but neither variable is defined in BoardConfig_Recamera2/BoardConfig-EMMC-RK801-RV1126B_V1-IPC_64BIT.mk. check_config in build.sh silently skips the command with return 0. To enable SD-card upgrades, add both variables to the board configuration (usually also RK_SDCARD_UPGRADE_SCREEN_ENABLE).

Boot Flow and Recovery​

  • RK_ENABLE_RECOVERY=y, RK_MISC=recovery-misc.img: the misc partition contains the recovery boot flag.
  • Recovery is entered by writing the flag to misc and rebooting, or by triggering it from an upper-layer application (OTA flow).
  • RK_OTA_RESOURCE="boot.img rootfs.img": OTA updates only the boot and rootfs partitions.
  • Factory reset uses the flag mechanism provided by RK_ENABLE_OTA=y (the board configuration comment says “Used for set/get factory reset flag”).

See OTA and Firmware Releases for details.

Verify After Flashing​

Connect the serial console after powering on (1500000 8N1; see Device Access and Debugging). You should see U-Boot → kernel → rootfs boot logs, followed by the reCamera ASCII banner from overlay-buildroot-banner/etc/motd.

After opening a shell, verify:

# cat /proc/version              # Kernel 6.1.157
# uname -m # aarch64
# cat /proc/cmdline # Should match bootargs in the DTS
# cat /etc/os-release # Buildroot version information
# ls /oem /userdata # Confirm partitions are mounted
# cat /run/board_id.env # Baseboard / expansion-board detection result

Common Problems​

SymptomCauseResolution
upgrade_tool ld does not list the deviceMissing udev rule / not in flashing mode / not run as rootInstall the rule and run udevadm trigger; confirm Maskrom mode; run with sudo
Permission denied when running upgrade_toolExecute permission was lost during extractionRun chmod +x tools/linux/Linux_Upgrade_Tool/upgrade_tool
No serial output after flashing; system does not bootLoader/idblock was not flashed or the versions do not matchRun rkflash.sh all again and confirm download.bin and idblock.img came from the same build
Kernel panic while mounting rootfsboot.img and rootfs.img came from different buildsRebuild everything and flash again, or at least flash boot and rootfs together
Problems after changing partition sizesenv / parameter was not updatedFlash env.img (di -p) separately or flash update.img with uf
./rkflash.sh update does nothingThe branch is commented outUse upgrade_tool uf output/image/update.img

Tech Support & Product Discussion​

Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.

Loading Comments...