01-Linux_Common_System_Customization

Symbol Explanation

  • SDK$: Represents the source code path.

  • console$: Generally refers to the command-line console of the motherboard.

  • ADB$: Android Debug Bridge command-line tool, generally refers to an environment where ADB can be run.

ADB Function

ADB Tutorialarrow-up-right

SCP File Transfer

$ scp $local_path username@$ip:$target_path

$local_path - Local file path $username - Username $ip - Motherboard IP $target_path - Target path

Example:

$ scp .\1.wav linaro@192.168.77.165:/home/linaro/Desktop/

Screen Display Orientation Configuration

Debian 12

Get usage help

View screen information

Rotation control

According to xrandr, the current display device is HDMI-1.

Set the rotation of HDMI-1.

Normal display of the picture

Rotate right, clockwise rotation of 90 degrees

Rotate left, clockwise rotation of 270 degrees

Invert, clockwise rotation of 180 degrees

Touch calibration

Step 1: Install tools

Step 2: View the Device and ID. It can be known that the ID of the goodix-ts device is 11.

Step 3: Reset the transpose matrix and calibration matrix. This is very crucial. The transpose matrix needs to be adjusted according to the screen rotation, and the calibration matrix can be set to the default value.

Modify the touch direction (can be modified according to the name). Default direction

Modify the touch direction (can be modified according to the name). 90 degrees to the left

Modify the touch direction (can be modified according to the name). 90 degrees to the right

Modify the touch direction (can be modified according to the name). Rotate 180 degrees

Step 4: Start calibration

Language Configuration

Debian 12

To modify the system language, open the command-line terminal and execute the following commands. Restart the system for the changes to take effect.

  • Set the language to English

  • Set the language to Chinese

Time Zone Configuration

The changes take effect after the system is restarted.

  • Set the time zone to Asia/Shanghai

  • Set the time zone to America/New York

Network Configuration

Debian 12

Use the ifconfig and route commands (temporary settings)

This method will be invalid after the system is restarted, but it can quickly test the configuration of a fixed IP.

  1. Use the ifconfig command to set the IP address, subnet mask, and broadcast address:

For example:

  • sudo: Run the command with administrator privileges.

  • ifconfig: Used to configure network interfaces.

  • eth0: Network interface name. You can view your own network interface name through ifconfig -a, which may be eth0, ens33, or other names.

  • <IP address>: The fixed IP address you want to set.

  • <Subnet mask>: Usually 255.255.255.0 or other subnet masks.

  • <Broadcast address>: Generally calculated based on the IP address and subnet mask. For example, for the IP address 192.168.1.100 and the subnet mask 255.255.255.0, the broadcast address is 192.168.1.255.

  1. Use the route command to set the gateway:

For example:

  • route: Used to configure routes.

  • add default gw <Gateway address>: Add the default gateway.

  • <Gateway address>: The gateway address of your network.

Use the /etc/network/interfaces file (long-term settings)

This method can achieve a long-term and stable fixed IP configuration.

  1. Edit the /etc/network/interfaces file:

  • sudo: Run the command with administrator privileges.

  1. Add or modify the network interface configuration:

  • auto eth0: Indicates that the eth0 interface is automatically enabled when the system starts.

  • iface eth0 inet static: Indicates that the eth0 interface uses a static IP configuration.

  • address: Set the IP address.

  • netmask: Set the subnet mask.

  • gateway: Set the gateway.

  • dns-nameservers: Set the DNS server. Here, Google's DNS servers are used. You can use other DNS servers, such as 114.114.114.114, etc.

  1. Save and exit the editor:

  • In vi, press ESC, then enter :wq, and press the ENTER key to save and exit.

  1. Restart the network service or the system:

Or directly restart the system:

NFS Configuration

Environment configuration

Server side

  1. Configure the shared files

  1. Start the service

  1. View the currently shared files on the server to prove the sharing result

Client side

  1. View the shared files on the server

  1. Mount the folder

  1. Mount successfully

Chrome Hardware Acceleration

Test platform: K7 Debian 12 Chrome

Test method

  1. Copy 1080P and 4K videos to the board and decode them locally through the Chrome browser.

  2. Check the GPU usage:

  1. Open and print the frame decoding log:

Backup the File System

When the file system is modified, it needs to be copied to other boards of the same type.

You can export the file system in the following way and then reflash it.

Connect a USB flash drive (or other storage device) to the board. The size should be at least 16GB or more because the generated image will be relatively large.

Run our packaging script on the board.

The format of the generated package name

Note:

Since the file system is large, it takes a long time to back up the system.

Since the maximum single-file size of FAT32 is 4GB, it is not recommended to use a storage device with the FAT32 file system for backup.

4G/5G Configuration

Script configuration

Configure the 4G/5G mobile module to start up, detect the presence of the module, and configure the dial-up connection.

By default, the system will only attempt to dial up once at startup. In case of poor signal or communication abnormalities, the dial-up may fail.

If there is no network, you can run the dial-up script to retry.

The dial-up script is compatible with RG200U / EC200 / EC20.

The RG200U module dials up automatically. You can force the configuration and restart the module.

This operation will reset the module. You need to wait for /dev/ttyUSB2 to be remounted, and then the 4G_dialing.sh script will perform the dial-up configuration again.

That is:

  1. $ 4G_dialing.sh force

  2. Wait for /dev/ttyUSB2

  3. $ 4G_dialing.sh

Internet access identification

Check if the module is connected

Check the log to determine.

/dev/ttyUSB2 exists and is a character device.

Indicates that the device is successfully recognized.

Or check if /dev/ttyUSB2 exists.

Check if the dial-up is successful

The actual device name starts with enx*. Please use the actual name.

Ping the network for testing

Specify the device enx3e003a5bd6ad to ping the network for testing.

Other

The display service will be restarted when Debian updates the system for the first time

To be compatible with different chips, the general Debian system will install various differential packages, such as libmali and isp packages, according to the chip when /etc/init.d/rockchip.sh is started for the first time. After the installation, the display service will be restarted. If it is an independent project, you can handle these differences when creating the image.

GPU

Check the GPU usage

Example: Check the usage in real-time.

$ watch -n 1 'cat /sys/devices/platform/*gpu/utilisation'

Move the mouse, window, or perform a GPU test to check the GPU usage and determine if hardware acceleration is working.

GLmark2 performance test

Rockchip provides NPU test scripts.

The Debian / Ubuntu file system has the glmark2-es performance test tool pre-installed.

Use the virtual terminal or debug serial terminal to execute the following command to start the GPU performance test.

The glmark2 test score for 800x600 is 1405.

The test results are for reference only. The actual score should be measured in practice.

NPU

Debian / Ubuntu

Rockchip provides NPU test scripts.

The NPU frequency test script npu_freq_scaling.sh

Example: Run the NPU frequency scaling test for 60 seconds, and change the frequency every 10 seconds.

The NPU stress test script npu_stress_test.sh

The content after Begin perf... shows the performance data of multiple runs of the model:

  • Each record shows the run number, the corresponding elapsed time (Elapse Time), and the frames per second (FPS). For example, 0: Elapse Time = 2.85ms, FPS = 351.12 means that during the first run of the model inference, it took a total of 2.85 milliseconds, and thus it can process 351.12 frames per second (the FPS is calculated by dividing 1000 by the elapsed time for each run to get the frames per second after unit conversion).

The ---- Top5 ---- section presents the top 5 categories with the highest probabilities in the model inference output results, along with their corresponding probability values and category numbers:

  • 0.935059 - 156 means that the model believes the input data (such as an image) is most likely to belong to category number 156, with a corresponding probability as high as 0.935059. This relatively high probability value indicates that the model has a relatively high confidence in this judgment.

  • The subsequent 0.057037 - 155, 0.003881 - 205, 0.003119 - 284, and 0.000172 - 285 list the category numbers and probability values of the second to fifth highest probability categories respectively. These probability values decrease in sequence, indicating that the model's confidence in their belonging to the corresponding categories also gradually decreases.

MPP

Debug information

Enable debug information

After enabling the debug information, there will be similar log information when calling hardware encoding and decoding. [ 893.134037] rk_vcodec: 27b00100.rkvdec:0 session 3705:19 time: 1333 us hw 1312 us [ 893.167444] rk_vcodec: 27b00100.rkvdec:0 session 3705:19 time: 1381 us hw 1313 us [ 893.200503] rk_vcodec: 27b00100.rkvdec:0 session 3705:19 time: 1420 us hw 1313 us

Disable debug information

Debian / Ubuntu

Rockchip provides MPP-related tools for use.

Hardware encoding test

mpi_enc_test

Last updated