Top 20 Must-Know Rockchip RK Commands to Double Your Dev Efficiency

Rockchip is a leading AIoT SoC design and manufacturing enterprise, focusing on the R & D of intelligent application processors and peripheral supporting chips. As a strategic partner of Rockchip, Forlinx Embedded has launched multiple embedded main-control products based on Rockchip's RK3399, RK3568, RK3588, RK3576, RK3562, and RK3506 series processors. These products include SoMs, development boards, and industrial control computers, which have successfully helped thousands of enterprise customers quickly develop and implement their projects. This article will systematically sort out the commonly used commands during the development process of Forlinx Embedded's RK platform main-control products, helping more developers quickly master the development methods of RK series chips. 01 View the CPU temperature cat /sys/class/thermal/thermal_zone0/temp 02 View CPU frequency (main frequency) cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq View the maximum frequency the CPU can support cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies View the current supported CPU frequencies (affected by the SoM temperature, the temperature control policy will change the list of supported frequencies) cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq View what frequency the current CPU is working at cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors View all supported FM strategies for the current CPU cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor View the current CPU applied FM policy interactive:Dynamic FM mode performance :High efficiency mode, CPU main frequency always supports the highest frequency in the list (subject to temperature control policy) powersave:Power saving mode, CPU frequency always supports the lowest frequency in the list userspace:User-defined mode Usage: echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo 1800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed ondemand:Toggles between highest and lowest frequencies conservative:Smooth adjustment frequency 03 Increase CPU Load cat /dev/urandom | md5sum & Run this command multiple times to the full CPU load. 04 View GPU usage cat /sys/devices/platform/ff9a0000.gpu/devfreq/ff9a0000.gpu/load The path to the file after #platform needs to be checked to see what registers are mapped to the gpu of the current platform. 05 View GPIO occupancy status cat /sys/kernel/debug/gpio 06 View all pinmux functions of the current system cat /sys/kernel/debug/pinctrl/pinctrl-rockchip-pinctrl/pinmux-pins 07 Redefine shell window display size resize 08 Remount the file system read-write attribute mount -o rw,remount rootfs 09 Retrieve the current partition size of the file system resize2fs /dev/mmcblk0p8 10 DDR current frequency acquisition and adjustable range cat /sys/class/devfreq/dmc/cur_freq //Get current DDR frequency, adjustable value, capacity cat /sys/class/devfreq/dmc/available_frequencies //View DDR frequency adjustable values cat /proc/meminfo //Get DDR capacity //DDR tests the fixed frequency. If the cat output frequency is the input value, the fixed frequency is successful. Note that the setting value needs to obtain the adjustable value of DDR. echo userspace > /sys/class/devfreq/dmc/governor echo 856000000 > /sys/class/devfreq/dmc/userspace/set_freq cat cur_freq 11 View DDR Bandwidth Usage cat /sys/devices/platform/dmc/devfreq/dmc/load 12 Gs treamer playback pictures gst-launch-1.0 -v playbin delay=10000000000 uri="file:///home/test.jpg" 13 Clear VM Virtual machine loop partition occupancy 100% apt autoremove --purge snapd 14 Calculation method of GPIO number Take GPIO4C6 as an example: A-D corresponds to 1-4: A-1, B-2, C-3, D-4. GPIOn_xy =n × 32 + (x-1) × 8 + y GPIO4_C6=4 × 32 + (3-1) × 8 + 6 =150 15 Calculation method for eMMC partition expansion The rootfs partition is the root partition. The number after “@” represents the starting address, and the number before “@” represents the partition size. Note that the starting address of the userdate partition is equal to the starting address of the rootfs partition plus its partition size. Each partition is 512 bytes. Example for U-Boot: 0x00002000 *512byte = 8192 * 512byte = 4,194,304byte 4,194,304÷1024 = 4096KB 4096÷1024=4MB So uboot is set to 4MB in size 16 Virtual machine automatically mounts shared folders Add .host:/ /mnt/hgfs in/etc/fstabfuse.vmhgfs-fuse allow_other 0 0 as follows: Top 20 Must-Know Rockchip RK Commands to Double Your Dev Efficiency 17 GLIBC supports the version query command strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC 18 Manually clear DDR cache occupation echo 3 > /proc/sys/vm/drop_caches 19 PCIe bus rescan device echo 1 > /sys/bus/pci/rescan 20 Ubuntu system goes into no interface mode syst

Apr 24, 2025 - 09:32
 0
Top 20 Must-Know Rockchip RK Commands to Double Your Dev Efficiency

Rockchip is a leading AIoT SoC design and manufacturing enterprise, focusing on the R & D of intelligent application processors and peripheral supporting chips. As a strategic partner of Rockchip, Forlinx Embedded has launched multiple embedded main-control products based on Rockchip's RK3399, RK3568, RK3588, RK3576, RK3562, and RK3506 series processors. These products include SoMs, development boards, and industrial control computers, which have successfully helped thousands of enterprise customers quickly develop and implement their projects.

This article will systematically sort out the commonly used commands during the development process of Forlinx Embedded's RK platform main-control products, helping more developers quickly master the development methods of RK series chips.

01 View the CPU temperature
cat /sys/class/thermal/thermal_zone0/temp
02 View CPU frequency (main frequency)
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq

View the maximum frequency the CPU can support

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies

View the current supported CPU frequencies (affected by the SoM temperature, the temperature control policy will change the list of supported frequencies)

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq

View what frequency the current CPU is working at

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

View all supported FM strategies for the current CPU

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

View the current CPU applied FM policy

interactive:Dynamic FM mode

performance :High efficiency mode, CPU main frequency always supports the highest frequency in the list (subject to temperature control policy)

powersave:Power saving mode, CPU frequency always supports the lowest frequency in the list

userspace:User-defined mode

Usage:

echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

echo 1800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed

ondemand:Toggles between highest and lowest frequencies

conservative:Smooth adjustment frequency

03 Increase CPU Load
cat /dev/urandom | md5sum &

Run this command multiple times to the full CPU load.

04 View GPU usage
cat /sys/devices/platform/ff9a0000.gpu/devfreq/ff9a0000.gpu/load
The path to the file after #platform needs to be checked to see what registers are mapped to the gpu of the current platform.
05 View GPIO occupancy status
cat /sys/kernel/debug/gpio
06 View all pinmux functions of the current system
cat /sys/kernel/debug/pinctrl/pinctrl-rockchip-pinctrl/pinmux-pins
07 Redefine shell window display size
resize
08 Remount the file system read-write attribute
mount -o rw,remount rootfs
09 Retrieve the current partition size of the file system
resize2fs /dev/mmcblk0p8
10 DDR current frequency acquisition and adjustable range
cat /sys/class/devfreq/dmc/cur_freq
//Get current DDR frequency, adjustable value, capacity
cat /sys/class/devfreq/dmc/available_frequencies
//View DDR frequency adjustable values
cat /proc/meminfo
//Get DDR capacity
//DDR tests the fixed frequency. If the cat output frequency is the input value, the fixed frequency is successful. Note that the setting value needs to obtain the adjustable value of DDR.
echo userspace > /sys/class/devfreq/dmc/governor
echo 856000000 > /sys/class/devfreq/dmc/userspace/set_freq
cat cur_freq
11 View DDR Bandwidth Usage
cat /sys/devices/platform/dmc/devfreq/dmc/load
12 Gs treamer playback pictures
gst-launch-1.0 -v playbin delay=10000000000 uri="file:///home/test.jpg"
13 Clear VM Virtual machine loop partition occupancy 100%
apt autoremove --purge snapd
14 Calculation method of GPIO number
Take GPIO4C6 as an example:

A-D corresponds to 1-4: A-1, B-2, C-3, D-4.

GPIOn_xy =n × 32 + (x-1) × 8 + y

GPIO4_C6=4 × 32 + (3-1) × 8 + 6 =150

15 Calculation method for eMMC partition expansion
The rootfs partition is the root partition. The number after “@” represents the starting address, and the number before “@” represents the partition size. Note that the starting address of the userdate partition is equal to the starting address of the rootfs partition plus its partition size.

Each partition is 512 bytes.

Example for U-Boot:

0x00002000 *512byte = 8192 * 512byte = 4,194,304byte

4,194,304÷1024 = 4096KB

4096÷1024=4MB

So uboot is set to 4MB in size

16 Virtual machine automatically mounts shared folders
Add .host:/ /mnt/hgfs in/etc/fstabfuse.vmhgfs-fuse allow_other 0 0 as follows:

Top 20 Must-Know Rockchip RK Commands to Double Your Dev Efficiency

17 GLIBC supports the version query command
strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC
18 Manually clear DDR cache occupation
echo 3 > /proc/sys/vm/drop_caches
19 PCIe bus rescan device
echo 1 > /sys/bus/pci/rescan
20 Ubuntu system goes into no interface mode
systemctl set-default multi-user.target

Set it to boot into the multi - user mode by default, that is, there will be no graphical interface at startup, and it will enter the command - line interface (CLI) instead.

The above are the commands commonly used during the development process of Forlinx Embedded's RK platform series products. We hope they will be helpful to you.