1. How to flash Firmware in Linux
upgrade_tool
is a firmware upgrade tool for Linux. Flash image requires superuser privileges.
Download and execute upgrade_tool first.
Put the firmware files and upgrade_tool in the same directory.
Connect the USB OTG port from the board to your PC, press the recovery button from your board, and connect the power, wait a few seconds and release the button.
Use the commands to flash image.
Basic Commands
//List devices
upgrade_tool ld
//Download boot
upgrade_tool db rkxxloader.bin
//Flash the partition table
upgrade_tool di -p parameter.txt
//Flash single partition image
upgrade_tool di -k kernel.img
//Falsh multiple partition images
upgrade_tool di -u uboot.img -b boot.img
//Flash the partition image with no defined abbreviation, you need to specify the partition name.
//Take the vendor partition as an example
upgrade_tool di -vendor vendor.img
//When ab partition are used, it also needs to be handled in undefined cases.
//Take boot_a and boot_b as example
upgrade_tool di -boot_a boot.img -boot_b boot.img
//Flash loader and reset
upgrade_tool ul rkxxloader.bin
//Upgrade firmware and reset
upgrade_tool uf update.img
//Erase device
upgrade_tool ef rkxxloader.bin
2. RGA_MMU unsupported Memory larger than 4G
Camera does not work properly on board with more than 4GB of memory (Android OS). After the memory is upgraded from 4GB to 8GB, open the camera APP, the terminal will output:
[ 100.488782] rga_mm: RGA_MMU unsupported Memory larger than 4G!
[ 100.488814] rga_mm: scheduler core[4] unsupported mm_flag[0x0]!
[ 100.488821] rga_mm: rga_mm_map_buffer map dma_buf error!
[ 100.488826] rga_mm: job buffer map failed!
[ 100.488831] rga_mm: dst channel map job buffer failed!
[ 100.488834] rga_mm: failed to map buffer
[ 100.488842] rga_job: rga_job_commit: failed to map job info
[ 100.488896] rga_job: request[1] task[0] job_commit failed.
[ 100.488909] rga_job: rga request commit failed!
[ 100.488915] rga: request[1] submit failed!
Solution: Modify the source code according to the file ddr_than-4G.patch and compile it again.
3. Error about lz4
If the following error occurs during compilation:
@ubuntu:~/rk356x_linux5.10$ ./build.sh kernel
processing option: kernel
============Start building kernel============
TARGET_ARCH =arm64
TARGET_KERNEL_CONFIG =rockchip_linux_defconfig
TARGET_KERNEL_DTS =rk3566-evb2-lp4x-v10-linux
TARGET_KERNEL_CONFIG_FRAGMENT =
==========================================
#
# No change to .config
#
CALL scripts/atomic/check-atomics.sh
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
LZ4C arch/arm64/boot/Image.lz4
Incorrect parameters
Usage :
lz4 [arg] [input] [output]
input : a filename
with no FILE, or when FILE is - or stdin, read standard input
Arguments :
-1 : Fast compression (default)
-9 : High compression
-d : decompression (default for .lz4 extension)
-z : force compression
-f : overwrite output without prompting
-h/-H : display help/long help and exit
arch/arm64/boot/Makefile:31: recipe for target 'arch/arm64/boot/Image.lz4' failed
make[2]: *** [arch/arm64/boot/Image.lz4] Error 1
make[2]: *** Deleting file 'arch/arm64/boot/Image.lz4'
arch/arm64/Makefile:170: recipe for target 'Image.lz4' failed
make[1]: *** [Image.lz4] Error 2
make[1]: *** Waiting for unfinished jobs....
arch/arm64/Makefile:214: recipe for target 'rk3566-evb2-lp4x-v10-linux.img' failed
make: *** [rk3566-evb2-lp4x-v10-linux.img] Error 2
ERROR: Running build_kernel failed!
ERROR: exit code 2 from line 663:
make ARCH=$RK_ARCH $RK_KERNEL_DTS.img -j$RK_JOBS
Cause: The version of lz4
delivered with the compilation system is too early.
Solution: update to V1.8.3 or later.
lz4 -v //check the compiler lz4 version
sudo cp /out/host/linux-x86/bin/lz4 /usr/bin/lz4 //copy lz4 from the Android source directory to override the compiler's
or remove the built-in lz4, download and install a new lz4
sudo apt-get remove liblz4-tool
sudo git clone https://github.com/lz4/lz4.git
cd /lz4
sudo make
sudo make install