RP-RV1126Configure a simple board-level configuration

Article directory

  • Official configuration
  • Create a new configuration
    • Create a new board-level pro-liefyuan-rv1126.mk configuration file
    • Create a new Buildroot defconfigs file
  • Complaints: Strange things about the SDK of RP-RV1126
    • The location of the .config file generated by make ARCH=arm xxx_defconfig is different.
    • The savedefconfig command directly replaces the original configuration file.
    • A cheating place
  • Add WiFi and BT on Buildroot
    • To add BT, you need to determine the serial number of the connection.
    • Module and firmware location of WiFi/BT module
    • BT usage process:
    • Enter BT interactive mode
  • Test WiFi speed (AP6256)

Official configuration

The complete compilation of the buildroot official configuration takes 30 minutes. I want to make a simple configuration that can be compiled quickly and test some simple functions quickly.

Command Corresponding file Description
./build.sh lunch pro-liefyuan-rv1126.mk Select the global configuration file
source envset.sh rockchip_rv1126_rv1109_liefyuan_defconfig Select the Buildroot configuration file

Create a new configuration

Create a new board-level pro-liefyuan-rv1126.mk configuration file

Define an own pro-liefyuan-rv1126.mk file:
Based on the original file: ./device/rockchip/rv1126_rv1109/pro-rv1126.mk
Change to: ./device/rockchip/rv1126_rv1109/pro-liefyuan-rv1126.mk

Copy pro-rv1126.mk under the directory sdk/device/rockchip/rv1126_rv1109/ and change it to your own name: pro-liefyuan-rv1126.mk

The current plan is to only modify the configuration of the Buildroot file system, leaving the configurations of Uboot and Kernel unchanged.

# Buildroot config
export RK_CFG_BUILDROOT=rockchip_rv1126_rv1109_facial_gate

Change to:

# Buildroot config
export RK_CFG_BUILDROOT=rockchip_rv1126_rv1109_liefyuan

All contents of pro-liefyuan-rv1126.mk:

#!/bin/bash

#targetarch
export RK_ARCH=arm
# Uboot defconfig
export RK_UBOOT_DEFCONFIG=rv1126
# Uboot image format type: fit(flattened image tree)
export RK_UBOOT_FORMAT_TYPE=fit
# Kernel defconfig
export RK_KERNEL_DEFCONFIG=rv1126_defconfig
# Kernel defconfig fragment
export RK_KERNEL_DEFCONFIG_FRAGMENT=rv1126-facial-gate.config
# Kernel dts
#export RK_KERNEL_DTS=rv1109-evb-ddr3-v13-facial-gate
export RK_KERNEL_DTS=pro-rv1126
# boot image type
export RK_BOOT_IMG=zboot.img
#kernel image path
export RK_KERNEL_IMG=kernel/arch/arm/boot/zImage
# kernel image format type: fit(flattened image tree)
export RK_KERNEL_FIT_ITS=boot.its
# parameter for GPT table
export RK_PARAMETER=parameter-facial-gate.txt
#Buildroot config
export RK_CFG_BUILDROOT=rockchip_rv1126_rv1109_liefyuan
# Recovery config
export RK_CFG_RECOVERY=rockchip_rv1126_rv1109_recovery
# Recovery image format type: fit(flattened image tree)
export RK_RECOVERY_FIT_ITS=boot4recovery.its
#rambootconfig
export RK_CFG_RAMBOOT=
# Pcba config
export RK_CFG_PCBA=
#Build jobs
export RK_JOBS=12
# target chip
export RK_TARGET_PRODUCT=rv1126_rv1109
# Set rootfs type, including ext2 ext4 squashfs
export RK_ROOTFS_TYPE=ext4
# rootfs image path
export RK_ROOTFS_IMG=rockdev/rootfs.${RK_ROOTFS_TYPE}
# rootfs system
export RK_ROOTFS_SYSTEM=buildroot
# Set ramboot image type
export RK_RAMBOOT_TYPE=
# Set oem partition type, including ext2 squashfs
export RK_OEM_FS_TYPE=ext2
# Set userdata partition type, including ext2, fat
export RK_USERDATA_FS_TYPE=ext2
#OEM config
export RK_OEM_DIR=oem_facial_gate
# OEM build on buildroot
export RK_OEM_BUILDIN_BUILDROOT=NO
#userdata config, if not define this, system will format by RK_USERDATA_FS_TYPE
export RK_USERDATA_DIR=userdata_normal
#misc image
export RK_MISC=wipe_all-misc.img
#choose enable distro module
export RK_DISTRO_MODULE=
# Define pre-build script for this board
export RK_BOARD_PRE_BUILD_SCRIPT=app-build.sh
# Define package-file for update.img
export RK_PACKAGE_FILE=rv1126_rv1109-package-file

Create a new Buildroot defconfigs file

Define an own Buildroot configs file:
Based on the original file: ./buildroot/configs/rockchip_rv1126_rv1109_facial_gate_defconfig
Change to: ./buildroot/configs/rockchip_rv1126_rv1109_liefyuan_defconfig

$ cp ./buildroot/configs/rockchip_rv1126_rv1109_facial_gate_defconfig ./buildroot/configs/rockchip_rv1126_rv1109_liefyuan_defconfig

The original Buildroot configuration was too complicated, so I simplified it to the following:

The entire contents of the buildroot/configs/rockchip_rv1126_rv1109_liefyuan_defconfig file:

#include "base.config"
#include "base_extra.config"
#include "debug.config"
#include "audio.config"
#include "wifi.config"
#include "network.config"
#include "rv1126_rv1109_arm.config"
#include "updateEngine.config"
BR2_PACKAGE_RKWIFIBT_AP6256=y
BR2_PACKAGE_RKWIFIBT_BTUART="ttyS0"
BR2_PACKAGE_DRM_DISPLAY_OUTPUT=y
BR2_PACKAGE_LIBERATION=y
BR2_PACKAGE_SOURCE_HAN_SANS_CN=y
BR2_PACKAGE_QT5BASE_WIDGETS=y
BR2_PACKAGE_QT5BASE_FONTCONFIG=y
BR2_PACKAGE_QT5BASE_GIF=y
BR2_PACKAGE_QT5BASE_JPEG=y
BR2_PACKAGE_QT5BASE_PNG=y
BR2_PACKAGE_QT5BASE_USE_RGA=y
BR2_PACKAGE_QT5BASE_LINUXFB_ARGB32=y
BR2_PACKAGE_QT5MULTIMEDIA=y
BR2_PACKAGE_QT5QUICKCONTROLS=y
BR2_PACKAGE_QT5SERIALPORT=y
BR2_PACKAGE_BLUEZ_TOOLS=y
BR2_PACKAGE_BLUEZ5_UTILS=y
BR2_PACKAGE_BLUEZ5_UTILS_OBEX=y
BR2_PACKAGE_BLUEZ5_UTILS_CLIENT=y
BR2_PACKAGE_BLUEZ5_UTILS_GATTTOOL=y
BR2_PACKAGE_DHCP=y

In fact, the WiFi, Bluetooth-related and Qt-related configurations are set here, and the entire compilation takes less than 8 minutes.

Comment: Weird things about the SDK of RP-RV1126

The location of the .config file generated by make ARCH=arm xxx_defconfig is different

  • Generally speaking (mainline Buildroot), I run the command in the Buildroot root directory: make ARCH=arm xxxx_defconfig, which will generate a .config file in the current directory, but Rockchip The difference is that after running the above command, the file will be generated here: ./output/xxxx/.config

The savedefconfig command directly replaces the original configuration file

liefyuan@ubuntu:~/rv1126/rp_rv1126_sdk/buildroot$ make ARCH=arm savedefconfig
  GEN /home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/output/rockchip_rv1126_rv1109_liefyuan/Makefile
grep "#include" /home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/configs/rockchip_rv1126_rv1109_liefyuan_defconfig > /home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/configs/rockchip_rv1126_rv1109_liefy uan_defconfig.split || true
cat /home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/configs/rockchip_rv1126_rv1109_liefyuan_defconfig >> /home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/configs/rockchip_rv1126_rv1109_liefyuan_defconfig. split
/home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/build/defconfig_hook.py -s /home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/configs/rockchip_rv1126_rv1109_liefyuan_defconfig.split /home/liefyuan/rv1126/rp_ rv1126_sdk/buildroot/configs/rockchip_rv1126_rv1109_liefyuan_defconfig
rm /home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/configs/rockchip_rv1126_rv1109_liefyuan_defconfig.split

/home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/build/defconfig_hook.py -s /home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/configs/rockchip_rv1126_rv1109_liefyuan_defconfig.split /home/liefyuan/rv1126/ rp_rv1126_sdk/buildroot/configs/ rockchip_rv1126_rv1109_liefyuan_defconfig This sentence shocked me. After I ran the command make ARCH=arm savedefconfig, it was saved directly to the original file. . . .

A cheating place

  • To clear the compiled content of buildroot, you need to enter the sdk/buildroot/ directory and perform make clean to clear it.
  • ./build.sh cleanall does not clear all generated files
  • Recompilation order:
    • Clear all: ./build.sh cleanall
    • Remove firmware etc: cd ./rockdev then rm ./*
    • Recompile: ./build.sh all
    • Build a complete firmware once: ./build.sh updateimg

Add WiFi and BT on Buildroot

To add BT, you need to determine the serial number of the connection


Based on the above information, confirm that the BT serial port is connected to UART0, which is ttyS0.

Therefore, the corresponding serial port number is configured in Buildroot.

Module and firmware location of WiFi/BT module

Location on the development board

/system/lib/modules/bcmdhd.ko #Drive ko (if compiled by ko)
/system/etc/firmware/fw_bcm43455c0_ag.bin #Driver firmware file storage location
/system/etc/firmware/nvram_ap6255.txt #Driver nvram file storage location
/system/etc/firmware/BCM4345C0.hcd #Bluetooth firmware file (if there is Bluetooth function)

BT usage process:

killall brcm_patchram_plus1

echo 0 > /sys/class/rfkill/rfkill0/state # Power off
echo 1 > /sys/class/rfkill/rfkill0/state # Power on

brcm_patchram_plus1 --bd_addr_rand --enable_hci --no2byt
es --use_baudrate_for_download --tosleep 200000 --baudrate 1500000 --patchram /s
system/etc/firmware/bcm43438a1.hcd /dev/ttyS0 &

hciconfig -a
hciconfig hci0 up

hcitool lescan
hcitool scan

Enter BT interactive mode

cd /usr/libexec/bluetooth/
./bluetoothd -n -d &

bluetoothctl

In bluetoothctl, we can perform manual pairing operations. When pairing, we need to provide the MAC address of the device and set the device to discoverable mode.

$ bluetoothctl
[bluetooth]# power on
[bluetooth]# discoverable on
[bluetooth]# scan on
[bluetooth]# devices
Device 20:13:03:22:66:19 Bose SoundSport Wireless
[bluetooth]# pair 20:13:03:22:66:19
[bluetooth]# trust 20:13:03:22:66:19
[bluetooth]# connect 20:13:03:22:66:19
[bluetooth]# exit

Test WiFi speed (AP6256)

ubuntu server

liefyuan@ubuntu:~/rv1126/rp_rv1126_sdk/buildroot$ iperf -s
-------------------------------------------------- ----------
Server listening on TCP port 5001
TCP window size: 128 KByte (default)
-------------------------------------------------- ----------
[4] local 192.168.1.105 port 5001 connected with 192.168.1.111 port 49918
[ID] Interval Transfer Bandwidth
[4] 0.0-10.4 sec 37.6 MBytes 30.3 Mbits/sec

RV1126 development board side:

[root@RV1126_RV1109:/etc]# iperf -c 192.168.1.105 -i 1
-------------------------------------------------- ----------
Client connecting to 192.168.1.105, TCP port 5001
TCP window size: 43.8 KByte (default)
-------------------------------------------------- ----------
[3] local 192.168.1.111 port 49918 connected with 192.168.1.105 port 5001
[ID] Interval Transfer Bandwidth
[3] 0.0- 1.0 sec 3.25 MBytes 27.3 Mbits/sec
[3] 1.0-2.0 sec 3.62 MBytes 30.4 Mbits/sec
[3] 2.0- 3.0 sec 3.75 MBytes 31.5 Mbits/sec
[3] 3.0- 4.0 sec 4.00 MBytes 33.6 Mbits/sec
[3] 4.0- 5.0 sec 4.38 MBytes 36.7 Mbits/sec
[3] 5.0-6.0 sec 3.62 MBytes 30.4 Mbits/sec
[3] 6.0-7.0 sec 3.12 MBytes 26.2 Mbits/sec
[3] 7.0-8.0 sec 4.00 MBytes 33.6 Mbits/sec
[3] 8.0- 9.0 sec 3.88 MBytes 32.5 Mbits/sec
[3] 9.0-10.0 sec 4.00 MBytes 33.6 Mbits/sec
[3] 0.0-10.1 sec 37.6 MBytes 31.1 Mbits/sec

The test speed is about 37.6MByte