Rockchip Command Cheatsheet

The one-liners Rockchip engineers reach for every day: flashing, serial console, device tree, GPIO, PCIe, Ethernet, NPU, camera and thermals. Click any block to copy.

Identify the board

SoC & board model

cat /proc/device-tree/compatible | tr '\0' '\n'
cat /proc/device-tree/model

Kernel, CPU cores, memory

uname -a
lscpu
free -h

Android platform

adb shell getprop ro.board.platform

Flashing (rkdeveloptool)

List devices / mode

rkdeveloptool ld

MaskROM: load loader, write image, reboot

rkdeveloptool db rk3588_spl_loader_v1.xx.xxx.bin
rkdeveloptool wl 0 image.img
rkdeveloptool rd

Write mainline U-Boot to SD / eMMC

sudo dd if=u-boot-rockchip.bin of=/dev/sdX seek=64 conv=notrunc,fsync

Reboot into Loader mode

sudo reboot loader

udev rule for flashing without sudo

echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="2207", MODE="0666"' | sudo tee /etc/udev/rules.d/99-rockchip.rules

Serial console

Open debug UART (1.5 Mbaud)

picocom -b 1500000 /dev/ttyUSB0
# or
screen /dev/ttyUSB0 1500000

Kernel console arguments

console=ttyS2,1500000 earlycon

Device tree

Dump the live device tree

dtc -I fs /proc/device-tree 2>/dev/null > live.dts

Compile an overlay

dtc -@ -I dts -O dtb -o my.dtbo my.dts

Check a node status

cat /proc/device-tree/pcie@fe150000/status

Pinmux in use

sudo cat /sys/kernel/debug/pinctrl/*/pinmux-pins | less

GPIO (libgpiod)

List chips and lines

gpiodetect
gpioinfo gpiochip3

Set / read a line (GPIO3_B5)

gpioset gpiochip3 13=1
gpioget gpiochip3 13

PCIe / NVMe / USB

PCIe devices and link speed

lspci -nn
sudo lspci -vv | grep -E 'LnkCap|LnkSta'

PCIe / NVMe kernel messages

dmesg | grep -iE 'pcie|nvme|phy'

USB tree and speeds

lsusb -t
sudo dmesg -w

Ethernet

Link, speed, errors

ethtool eth0
ethtool -S eth0 | grep -iE 'err|crc|drop'

GMAC / PHY probe messages

dmesg | grep -iE 'stmmac|dwmac|phy'

Throughput both directions

iperf3 -c <server> -t 30 && iperf3 -c <server> -R -t 30

NPU / RKNN

NPU driver version and load

sudo cat /sys/kernel/debug/rknpu/version
sudo cat /sys/kernel/debug/rknpu/load

NPU frequency

cat /sys/class/devfreq/*npu*/cur_freq

Runtime library version

strings /usr/lib/librknnrt.so | grep -i 'librknnrt version'

Camera (V4L2)

Media pipeline

media-ctl -p -d /dev/media0

List video devices and formats

v4l2-ctl --list-devices
v4l2-ctl -d /dev/video0 --list-formats-ext

Grab 10 frames

v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=NV12 --stream-mmap --stream-count=10 --stream-to=out.yuv

Thermals & clocks

Temperatures

cat /sys/class/thermal/thermal_zone*/temp

CPU frequencies & governors

cat /sys/devices/system/cpu/cpufreq/policy*/scaling_cur_freq
cat /sys/devices/system/cpu/cpufreq/policy*/scaling_governor

GPU load (Mali, vendor kernel)

cat /sys/class/devfreq/*gpu*/load

Missing your favourite command? Suggest it.

Building a Rockchip-based product?

From hardware design to Linux, Android and AI integration, get engineering support for your Rockchip project.