4. Buildroot Application

4.1 Serial Terminal

_images/debug.webp

Connect the board and PC with USB Serial cable, then power on, the terminal will output boot information. The default baudrate is 1500000.

Terminal_UI

4.2 Display

MIPI_DSI

Connect the board and MIPI LCD (default 800×1280 @60Hz), then start up.

_images/MIPI_display_buildroot.webp

4.3 USB

_images/USB.webp

4.3.1 USB3.0 DRD

The SBC1126B USB3.0 supports both Host and Device roles, with Device as the default configuration.

Switch USB3.0 DRD back to USB Host mode.

1echo host > /sys/kernel/debug/usb/21500000.usb/mode

Switch USB3.0 DRD to USB device mode.

1echo device > /sys/kernel/debug/usb/21500000.usb/mode

4.3.2 USB Host

The USB2.0 Host can connect peripherals such as mouse, keyboards, and flash drives.

After a USB flash drive is inserted and recognized successfully, the speed can be checked from the kernel log. When the device operates in USB2.0 mode, the log usually shows high-speed.

Serial terminal output
root@rv1126b-buildroot:/# [  552.554828] usb 1-1.2: new high-speed USB device number 4 using ehci-platform
[  552.664069] usb 1-1.2: New USB device found, idVendor=21c4, idProduct=0cc7, bcdDevice= 1.00
[  552.664090] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  552.664097] usb 1-1.2: Product: USB Flash Drive
[  552.664102] usb 1-1.2: Manufacturer: Lexar
[  552.664108] usb 1-1.2: SerialNumber: 04102800000031D7
[  552.665690] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[  552.666647] scsi host0: usb-storage 1-1.2:1.0
[  553.692095] scsi 0:0:0:0: Direct-Access     Lexar    USB Flash Drive  1.00 PQ: 0 ANSI: 4
[  553.694492] sd 0:0:0:0: [sda] 120861886 512-byte logical blocks: (61.9 GB/57.6 GiB)
[  553.695307] sd 0:0:0:0: [sda] Write Protect is off
[  553.696107] sd 0:0:0:0: [sda] No Caching mode page found
[  553.696128] sd 0:0:0:0: [sda] Assuming drive cache: write through
[  553.702618]  sda: sda1
[  553.703327] sd 0:0:0:0: [sda] Attached SCSI removable disk
[  554.227536] FAT-fs (sda1): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
[  554.233156] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

When the device operates in USB3.0 mode, the log usually shows SuperSpeed.

Serial terminal output
root@rv1126b-buildroot:/# [  500.487295] usb 4-1: new SuperSpeed USB device number 3 using xhci-hcd
[  500.517057] usb 4-1: New USB device found, idVendor=0dd8, idProduct=3b00, bcdDevice= 0.02
[  500.517096] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  500.517115] usb 4-1: Product: OnlyDisk
[  500.517129] usb 4-1: Manufacturer: Netac
[  500.517143] usb 4-1: SerialNumber: C0E8BFA3EC38F796
[  500.518668] usb-storage 4-1:1.0: USB Mass Storage device detected
[  500.519204] scsi host0: usb-storage 4-1:1.0
[  501.594068] scsi 0:0:0:0: Direct-Access     Netac    OnlyDisk         8.01 PQ: 0 ANSI: 6
[  501.597160] sd 0:0:0:0: [sda] 121610240 512-byte logical blocks: (62.3 GB/58.0 GiB)
[  501.597653] sd 0:0:0:0: [sda] Write Protect is off
[  501.597914] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[  501.602848]  sda: sda1
[  501.603279] sd 0:0:0:0: [sda] Attached SCSI removable disk
[  501.773323] FAT-fs (sda1): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
[  501.777260] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
1df -h  // Check the mounted path
Serial terminal output
root@rv1126b-buildroot:/# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       5.9G  445M  5.3G   8% /
devtmpfs        959M     0  959M   0% /dev
tmpfs           987M  548K  986M   1% /run
tmpfs           987M  212K  987M   1% /var/log
tmpfs           987M     0  987M   0% /dev/shm
tmpfs           987M  136K  987M   1% /tmp
/dev/mmcblk0p7  124M  5.3M  118M   5% /oem
/dev/mmcblk0p8  936M  292K  936M   1% /userdata
/dev/sda1        58G   57G  1.9G  97% /mnt/udisk
/dev/mmcblk1p1   30G  4.6G   26G  16% /mnt/sdcard

4.4 Audio

Audio

4.4.1 Audio Output

❶ Connect the Speaker to the connector (2-pin/2.0mm pitch)

❷ Set the DAC digital volume.

1amixer -c 0 cset name='DAC Digital Volume' 250,250

❸ Play the audio file.

Execute command according to the actual audio file path, eg. /mnt/udisk1/video/music/2.wav

1aplay -D hw:0,0 /mnt/udisk1/video/music/2.wav

4.4.2 Audio Input

SBC1126B supports MIC recording and Loopback.
  • MIC recording captures outside sounds (e.g., voice) for storage, transmission, or voice commands.

  • Loopback captures the device’s own playback as a reference signal. It is primarily used for Acoustic Echo Cancellation (AEC) and audio monitoring. It is a tool for signal processing, not an audio recording of the environment.

❶ Connect the MIC to the connector (2-pin/2.0mm pitch).

❷ Execute the commands.

1amixer -c 0 cset name='SAI2 Receive PATH0 Source Select' 'From SDI0'   //Select MIC0 as the recording input source
2amixer -c 0 cset name='ACodec Digital Gain Volume' 100   //Set the audio codec digital gain
3arecord -D hw:0,0 -f cd -t wav test.wav   //Record audio from MIC0
4aplay -D hw:0,0 test.wav   //Play the recorded audio through the speaker
Serial terminal output
root@rv1126b-buildroot:/# amixer -c 0 cset name='SAI2 Receive PATH0 Source Select' 'From SDI0'
numid=29,iface=MIXER,name='SAI2 Receive PATH0 Source Select'
  ; type=ENUMERATED,access=rw------,values=1,items=4
  ; Item #0 'From SDI0'
  ; Item #1 'From SDI1'
  ; Item #2 'From SDI2'
  ; Item #3 'From SDI3'
  : values=0
root@rv1126b-buildroot:/# amixer -c 0 cset name='ACodec Digital Gain Volume' 100
numid=44,iface=MIXER,name='ACodec Digital Gain Volume'c Digital Gain Volume' 100
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=127,step=0
  : values=100
  | dBscale-min=-95.00dB,step=0.75dB,mute=0
root@rv1126b-buildroot:/#
root@rv1126b-buildroot:/# arecord -D hw:0,0 -f cd -t wav test.wav
Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
^CAborted by signal Interrupt...
root@rv1126b-buildroot:/#
root@rv1126b-buildroot:/# aplay -D hw:0,0 test.wav
Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo

4.5 Ethernet

_images/Ethernet.webp

The 100M Ethernet and 1000M Ethernet interfaces on the SBC1126B are multiplexed and cannot be used at the same time. When switching between them, the corresponding firmware image must be updated in software, and the hardware selection must also be changed using the DIP switch on the development board.

DTS Configuration Switching Instructions File path kernel-6.1\arch\arm64\boot\dts\rockchip\boardcon-sbc1126b.dts

//#include "boardcon-sbc1126b-gephy.dtsi" //1000M
#include "boardcon-sbc1126b-fephy.dtsi"   //100M

4.5.1 100M Ethernet

❶ Connect the network cable to the 100M Ethernet port, and set the DIP switch to the 100M position.

Serial terminal output
root@rv1126b-buildroot:/# [ 2239.711481] rk_gmac-dwmac 21c70000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[ 2239.711505] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

❷ View the status of the network interface.

1ifconfig end0
Serial terminal output
root@rv1126b-buildroot:/# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 2E:CD:2F:8A:A1:64
          inet addr:192.168.0.175  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::b786:555a:8922:5eb2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:231 errors:0 dropped:28 overruns:0 frame:0
          TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:20498 (20.0 KiB)  TX bytes:1410 (1.3 KiB)
          Interrupt:79

❸ Ping URL to test Network.

1ping -I end0 www.armdesigner.com
Serial terminal output
root@rv1126b-buildroot:/# ping -I eth0 www.armdesigner.com
PING d3dsoj86mhwkk6.cloudfront.net (108.138.246.8) from 192.168.0.175 eth0: 56(84) bytes of data.
64 bytes from www.armdesigner.com (108.138.246.8): icmp_seq=1 ttl=246 time=155 ms
64 bytes from www.armdesigner.com (108.138.246.8): icmp_seq=2 ttl=246 time=155 ms
64 bytes from www.armdesigner.com (108.138.246.8): icmp_seq=3 ttl=246 time=151 ms
64 bytes from www.armdesigner.com (108.138.246.8): icmp_seq=4 ttl=246 time=155 ms
64 bytes from www.armdesigner.com (108.138.246.8): icmp_seq=5 ttl=246 time=154 ms
64 bytes from www.armdesigner.com (108.138.246.8): icmp_seq=6 ttl=246 time=150 ms
^C
--- d3dsoj86mhwkk6.cloudfront.net ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5007ms
rtt min/avg/max/mdev = 150.276/153.243/154.972/1.845 ms

4.5.2 1000M Ethernet

❶ Connect the network cable to the 1000M Ethernet port, and set the DIP switch to the 1000M position.

Serial terminal output
root@rv1126b-buildroot:/# [   80.044336] rk_gmac-dwmac 21c70000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[   80.044406] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

❷ View the status of the network interface.

1ifconfig end0

❸ Ping URL to test Network.

1ping -I end0 www.armdesigner.com

4.6 SD Card

SD

After the micro SD card is inserted and recognized successfully, it will be mounted automatically. Run the following command to check the mount path of the SD card.

1df -h
Serial terminal output
root@rv1126b-buildroot:/# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       5.9G  445M  5.3G   8% /
devtmpfs        959M     0  959M   0% /dev
tmpfs           987M  548K  986M   1% /run
tmpfs           987M  212K  987M   1% /var/log
tmpfs           987M     0  987M   0% /dev/shm
tmpfs           987M  136K  987M   1% /tmp
/dev/mmcblk0p7  124M  5.3M  118M   5% /oem
/dev/mmcblk0p8  936M  292K  936M   1% /userdata
/dev/sda1        58G   57G  1.9G  97% /mnt/udisk
/dev/mmcblk1p1   30G  4.6G   26G  16% /mnt/sdcard

4.7 WiFi & Bluetooth

WiFi&BT

4.7.1 WiFi

❶ Connect the WiFi antenna.

❷ Check the Wi-Fi device information.

1ifconfig wlan0
Serial terminal output
root@rv1126b-buildroot:/# ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr 84:FC:14:F9:69:64
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

❸ Scan for available WiFi hotspots.

1iwlist wlan0 scan

❹ Connect hotspot.

1wifi-connect.sh SSID PSK        //'SSID': user SSID, 'PSK': password

After connected, check the network status and ping URL to test.

1ifconfig wlan0
2ping -I wlan0 www.armdesigner.com

4.7.2 Bluetooth

❶ Start the BlueALSA A2DP sink service.

1bluealsa -p a2dp-sink &
Serial terminal output
root@rv1126b-buildroot:/# bluealsa -p a2dp-sink &
[1] 1867
root@rv1126b-buildroot:/# bluealsa: [1867] D: storage.c:84: Initializing persistent storage: /var/lib/bluealsa
bluealsa: [1867] D: main.c:604: Starting main dispatching loop
bluealsa: [1867] D: main.c:114: Acquired D-Bus service name: org.bluealsa
bluealsa: [1867] D: bluealsa-dbus.c:392: Registering D-Bus manager: /org/bluealsa
[ 5741.163059] Bluetooth: hu 000000005f39388b retransmitting 1 pkts
[ 5741.163991] rtk_btcoex: BTCOEX hci_rev 0xaaa8
[ 5741.163998] rtk_btcoex: BTCOEX lmp_subver 0x2df5
bluealsa: [1867] D: bluez.c:783: Registering battery provider: /org/bluez/hci0/battery
bluealsa: [1867] D: bluez.c:598: Creating media endpoint object: /org/bluez/hci0/A2DP/SBC/sink/1
bluealsa: [1867] D: bluez.c:509: Registering media endpoint: /org/bluez/hci0/A2DP/SBC/sink/1
bluealsa: [1867] D: bluez.c:598: Creating media endpoint object: /org/bluez/hci0/A2DP/SBC/sink/2
bluealsa: [1867] D: bluez.c:509: Registering media endpoint: /org/bluez/hci0/A2DP/SBC/sink/2

❷ Enter the Bluetooth control tool.

1bluetoothctl
Serial terminal output
root@rv1126b-buildroot:/# bluetoothctl
hci0 new_settings: powered bondable ssp br/edr le secure-conn
Agent registered
[CHG] Controller 84:FC:14:F9:69:65 Pairable: yes
[bluetooth]#

❸ Enable Bluetooth and set it to discoverable mode.

1power on
2discoverable on
Serial terminal output
[bluetooth]# power on
Changing power on succeeded
[bluetooth]# discoverable on
[bluetooth]# [ 5813.299958] Bluetooth: hu 000000005f39388b retransmitting 1 pkts
hci0 new_settings: powered connectable bondable ssp br/edr le secure-conn
hci0 new_settings: powered connectable discoverable bondable ssp br/edr le secure-conn
Changing discoverable on succeeded
[CHG] Controller 84:FC:14:F9:69:65 Discoverable: yes
[bluetooth]#

After this step, the Bluetooth device can be discovered by the phone.

❹ Scan nearby Bluetooth devices.

1scan on

Wait for a few seconds until the phone is discovered, then stop scanning:

1scan off
Serial terminal output
[bluetooth]# scan on
SetDiscoveryFilter success
[bluetooth]# [ 5851.218314] Bluetooth: hu 000000005f39388b retransmitting 1 pkts
[ 5851.221639] rtk_btcoex: hci (periodic)inq start
hci0 type 7 discovering on
Discovery started
[CHG] Controller 84:FC:14:F9:69:65 Discovering: yes
[bluetooth]# bluealsa: [1867] D: bluez.c:1199: Signal: org.freedesktop.DBus.ObjectManager.InterfacesAdded()
[NEW] Device 6C:BC:A6:8C:9C:95 NGN1lPhdMynzOq3QG1O+yEepM
[bluetooth]# bluealsa: [1867] D: bluez.c:1199: Signal: org.freedesktop.DBus.ObjectManager.InterfacesAdded()
[NEW] Device 44:17:1C:42:44:16 44-17-1C-42-44-16
[bluetooth]# bluealsa: [1867] D: bluez.c:1199: Signal: org.freedesktop.DBus.ObjectManager.InterfacesAdded()
[NEW] Device 69:B2:17:A9:27:14 69-B2-17-A9-27-14
[bluetooth]# bluealsa: [1867] D: bluez.c:1199: Signal: org.freedesktop.DBus.ObjectManager.InterfacesAdded()
bluealsa: [1867] D: bluez.c:1199: Signal: org.freedesktop.DBus.ObjectManager.InterfacesAdded()
[NEW] Device 40:C8:56:EF:3F:C3 40-C8-56-EF-3F-C3
[NEW] Device 54:D1:16:D3:63:F0 54-D1-16-D3-63-F0
[bluetooth]# bluealsa: [1867] D: bluez.c:1199: Signal: org.freedesktop.DBus.ObjectManager.InterfacesAdded()
[NEW] Device A1:B2:C3:D4:E5:F6 yourPhone
[bluetooth]# bluealsa: [1867] D: bluez.c:1199: Signal: org.freedesktop.DBus.ObjectManager.InterfacesAdded()
[NEW] Device 7A:95:9D:E4:75:81 7A-95-9D-E4-75-81
[bluetooth]# bluealsa: [1867] D: bluez.c:1199: Signal: org.freedesktop.DBus.ObjectManager.InterfacesAdded()
[NEW] Device 6F:8E:8A:94:09:9B 6F-8E-8A-94-09-9B
[bluetooth]# scan obluealsa: [1867] D: bluez.c:1199: Signal: org.freedesktop.DBus.ObjectManager.InterfacesAdded()
[NEW] Device 60:CE:10:E1:6A:F7 60-CE-10-E1-6A-F7
[CHG] Device A1:B2:C3:D4:E5:F6 RSSI: 0xffffffe4 (-28)
[bluetooth]# scan off
[bluetooth]# [ 5855.481659] rtk_btcoex: hci (periodic)inq cancel/exit

❺ Check the discovered Bluetooth devices.

1devices
Serial terminal output
[bluetooth]# devices
Device 7F:23:A0:9C:0B:62 7F-23-A0-9C-0B-62
Device 6C:BC:A6:8C:9C:95 NGN1lPhdMynzOq3QG1O+yEepM
Device 46:1E:DE:96:F3:16 46-1E-DE-96-F3-16
Device 41:1A:62:2A:AF:0E 41-1A-62-2A-AF-0E
Device 69:B2:17:A9:27:14 69-B2-17-A9-27-14
Device A1:B2:C3:D4:E5:F6 yourPhone
Device 60:CE:10:E1:6A:F7 60-CE-10-E1-6A-F7
Device 6F:8E:8A:94:09:9B 6F-8E-8A-94-09-9B
Device C1:14:88:1E:63:B5 C1-14-88-1E-63-B5
Device 44:17:1C:42:44:16 44-17-1C-42-44-16
Device 51:2C:D0:88:C4:57 51-2C-D0-88-C4-57

❻ Pair and connect the Bluetooth device.

Phone MAC A1:B2:C3:D4:E5:F6 for example.

On the phone, find the Bluetooth device named BlueZ 5.77 in the Bluetooth device list, then tap it to pair and connect.

BT_list

If a pairing confirmation message appears, confirm it on both the phone and the board.

Serial terminal output
[bluetooth]# discoverable on
hci0 new_settings: powered connectable bondable ssp br/edr le secure-conn
[bluetooth]# [  176.396945] Bluetooth: hu 000000007418f04b retransmitting 1 pkts
hci0 new_settings: powered connectable discoverable bondable ssp br/edr le secure-conn
Changing discoverable on succeeded
[CHG] Controller 84:FC:14:F9:69:65 Discoverable: yes
[bluetooth]# [  190.276160] rtk_btcoex: hci accept conn req
[  190.474589] rtk_btcoex: connected, handle 0002, status 0x00
[  190.474615] rtk_btcoex: Page success
[  190.522637] rtk_btcoex: io capability request
hci0 A1:B2:C3:D4:E5:F6 type BR/EDR connected eir_len 11
[CHG] Device A1:B2:C3:D4:E5:F6 INFO: 0x000f (15)
[CHG] Device A1:B2:C3:D4:E5:F6 Connected: yes
Request confirmation
[agent] Confirm passkey 406213 (yes/no): yes
[yourPhone]# [  195.146220] rtk_btcoex: link key notify
hci0 new_link_key A1:B2:C3:D4:E5:F6 type 0x05 pin_len 0 store_hint 1
[yourPhone]# [  195.173161] rtk_btcoex: l2cap op 2, len 16, out 0
hci0 A1:B2:C3:D4:E5:F6 type BR/EDR disconnected with reason 0
[  199.550019] rtk_btcoex: process disconn complete event.
[CHG] Device A1:B2:C3:D4:E5:F6 INFO: 0x000d (13)
[CHG] Device A1:B2:C3:D4:E5:F6 Connected: no
[CHG] Device A1:B2:C3:D4:E5:F6 Reason: 0x0000 (0)
[bluetooth]# [  206.851770] rtk_btcoex: hci accept conn req
[  207.047726] rtk_btcoex: connected, handle 0003, status 0x00
[  207.047752] rtk_btcoex: Page success
hci0 A1:B2:C3:D4:E5:F6 type BR/EDR connected eir_len 11
[CHG] Device A1:B2:C3:D4:E5:F6 INFO: 0x000f (15)
[CHG] Device A1:B2:C3:D4:E5:F6 Connected: yes
[yourPhone]# Authorize service
[agent] Authorize service 0000110d-0000-1000-8000-00805f9b34fb (yes/no): yes
[yourPhone]# [  209.640679] rtk_btcoex: l2cap op 3, len 20, out 1

❼ Exit bluetoothctl.

1exit

❽ Start Bluetooth audio playback.

1bluealsa-aplay A1:B2:C3:D4:E5:F6 &

After the Bluetooth connection is established, play audio on the phone. The audio should be output from the board.

Serial terminal output
[yourPhone]# exit
root@rv1126b-buildroot:/# [  252.758958] rtk_btcoex: update_hid_active_state: handle 0x0003, interval 400
[  252.759004] rtk_btcoex: HID not connected, nothing to be down
root@rv1126b-buildroot:/# bluealsa-aplay A8:35:12:9A:EB:4D &
[2] 1485
root@rv1126b-buildroot:/#

4.8 IR

IR

❶ Connect the IR receiver.

❷ Enable IR debug logs.

1echo 1 > /sys/module/rockchip_pwm_remotectl/parameters/code_print

❸ Press remote button, key value printed to log.

Serial terminal output
root@rv1126b-buildroot:/# echo 1 > /sys/module/rockchip_pwm_remotectl/parameters/code_print
root@rv1126b-buildroot:/#
[ 1345.994471] USERCODE=0x1818
[ 1346.021609] RMC_GETDATA=98
[ 1347.228038] USERCODE=0x1818
[ 1347.255198] RMC_GETDATA=99
[ 1347.849855] USERCODE=0x3030
[ 1347.875982] RMC_GETDATA=34
[ 1348.437214] USERCODE=0x1818
[ 1348.464347] RMC_GETDATA=9b
[ 1350.801900] USERCODE=0x1818

4.9 RS485

RS485

❶ Connect PC and board with USB-to-RS485 adapter.

RS485 connection

RS485 connection

❷ Open the Serial Terminal and set baud rate for the board and RS485 adapter respectively.

Baud rate: board - 1500000; RS485 adapter - 115200

_images/Buildroot_RS485_baudrate.png

❸ Execute command on the terminal serial port of board.

1com /dev/ttyS5 115200 8 0 1       //RS485_0

❹ Input character to test RS485 communication.

_images/Buildroot_RS485_0_Test.png

❺ Press Ctrl+C to exit RS485_0 testing.

❻ Test RS485_1.

1com /dev/ttyS6 115200 8 0 1
_images/Buildroot_RS485_1_Test.png

4.10 UART

UART connect

❶ Connect RX and TX of UART.

❷ Execute command and input character to test.

1com /dev/ttyS4 115200 8 0 1
Serial terminal output
root@rv1126b-buildroot:/# com /dev/ttyS4 115200 8 0 1
port = /dev/ttyS4
baudrate = 115200
cs = 8
parity = 0
stopb = 1
12345678
RECV: 12345678
abcdefg
RECV: abcdefg

4.11 CAN

CAN

❶ Connect PC and board with USB-to-CAN adapter.

CAN connection

CAN connection

❷ Open the CAN application and set the baudrate to 500000 on PC.

_images/Buildroot_CAN_baudrate.png

❸ Configure and enable the CAN0 on the board with a bitrate of 500000.

1ip link set can0 down
2ip link set can0 type can bitrate 500000
3ip link set can0 up

❹ Configure CAN0 as receiver.

1candump can0
_images/Buildroot_CAN_receiver.png

❺ Set CAN0 as Transmitter.

1cansend can0 123#DEADBEEFDEADBEEF
_images/Buildroot_CAN_Transmitter.png

The tests for CAN1 are similar to those for CAN0. Simply replace can0 with can1.

4.12 SPI

SPI

❶ Connect MOSI and MISO of SPI.

❷ SPI loopback test.

1test_spi 1 0
Serial terminal output
root@rv1126b-buildroot:/# test_spi 1 0
device= /dev/spidev1.0
bits per word: 8
max speed: 5000000 Hz (5000 KHz)

FF FF FF FF FF FF
40 00 00 00 00 95
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
DE AD BE EF BA AD
F0 0D

4.13 ADC

ADC

Connect the ADC pin to two different voltage levels within 0~1.8V respectively. For each level, after setting the pin to that level, execute the test command.

1cat /sys/bus/iio/devices/iio:\device0/in_voltage1_raw   //test ADC1
Serial terminal output
root@rv1126b-buildroot:/# cat /sys/bus/iio/devices/iio:\device0/in_voltage1_raw
8191
root@rv1126b-buildroot:/# cat /sys/bus/iio/devices/iio:\device0/in_voltage1_raw
14

For other ADC read commands, refer to the ADC read command description below.

Single-channel read commands
1cat /sys/bus/iio/devices/iio:\device0/in_voltage1_raw   //ADC1
2cat /sys/bus/iio/devices/iio:\device0/in_voltage2_raw   //ADC2
3cat /sys/bus/iio/devices/iio:\device0/in_voltage3_raw   //ADC3
4cat /sys/bus/iio/devices/iio:\device0/in_voltage4_raw   //ADC4
5cat /sys/bus/iio/devices/iio:\device0/in_voltage5_raw   //ADC5
6cat /sys/bus/iio/devices/iio:\device0/in_voltage6_raw   //ADC6
Read all ADC1–ADC6 raw values
1for i in 1 2 3 4 5 6; do
2    echo -n "ADC$i: "
3    cat /sys/bus/iio/devices/iio:\device0/in_voltage${i}_raw
4done

4.14 RTC

RTC

The RTC on the SBC1126B is powered by a supercapacitor.

❶ Set the system time manually.

1date -s "2026-06-17 17:56:00"

If the network is connected, the system time may be synchronized automatically to the current UTC time.

❷ set the hardware clock to current system time.

1hwclock -w

❸ Display date and time.

1hwclock

❹ Power off the board and disconnect the main power supply. Wait for a period of time, then power on the board again.

❺ Read the hardware clock time again.

1hwclock

If the RTC is working properly, the hardware clock time should be retained and continue running after power-off.

4.15 Battery Supply

BAT

❶ Connect the Li-ion battery(7.4V) to the BAT connector.

❷ Read the current battery capacity percentage.

1cat /sys/class/power_supply/cw221X-bat/capacity

❸ Read the current battery voltage.

1cat /sys/class/power_supply/cw221X-bat/voltage_now

Attention

Currently, only basic battery status reading is supported. Since the battery capacity curve has not been calibrated, the capacity percentage is for reference only.

4.16 Camera

Camera

❶ Connect the camera to the board and power on.

❷ Check the camera preview device nodes.

1grep "" /sys/class/video4linux/v*/name | grep mainpath
Serial terminal output
root@rv1126b-buildroot:/# grep "" /sys/class/video4linux/v*/name | grep mainpath
/sys/class/video4linux/video44/name:rkisp_mainpath4linux/v*/name | grep mainpath
/sys/class/video4linux/video52/name:rkisp_mainpath
/sys/class/video4linux/video60/name:rkisp_mainpath
/sys/class/video4linux/video68/name:rkisp_mainpath

❸ Preview camera.

1gst-launch-1.0 v4l2src device=/dev/video44 ! video/x-raw,format=NV16,width=1920,height=1080, framerate=25/1 ! waylandsink
Serial terminal output
root@rv1126b-buildroot:/# gst-launch-1.0 v4l2src device=/dev/video44 ! video/x-raw,format=NV16,width=1920,height=1080, framerate=25/1 ! waylandsink
mpp[1503]: mpp_info: mpp version: 958803d7 author: Herman Chen   2026-02-26 fix[h265d_rkv]: Fix rkv ref and poc setup overflow
mpp[1503]: mpp_info: mpp version: 958803d7 author: Herman Chen   2026-02-26 fix[h265d_rkv]: Fix rkv ref and poc setup overflow
mpp[1503]: mpp_info: mpp version: 958803d7 author: Herman Chen   2026-02-26 fix[h265d_rkv]: Fix rkv ref and poc setup overflow
mpp[1503]: mpp: unable to create enc vp8 for soc rv1126b unsupported
mpp[1503]: mpp_info: mpp version: 958803d7 author: Herman Chen   2026-02-26 fix[h265d_rkv]: Fix rkv ref and poc setup overflow
Setting pipeline to PAUSED ...
Using mplane plugin for capture
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
[   29.735171] rkisp_hw 21d00000.isp: set isp clk = 297000000Hz
[   29.737027] rkcif-mipi-lvds: stream[0] start streaming
[   29.737257] rockchip-mipi-csi2 mipi0-csi2: stream on, src_sd: 0000000080763734, sd_name:rockchip-csi2-dphy1
[   29.737274] rockchip-mipi-csi2 mipi0-csi2: stream ON
[   29.737316] rockchip-csi2-dphy1: dphy1, data_rate_mbps 742
[   29.737342] rockchip-csi2-dphy csi2-dphy1: csi2_dphy_s_stream stream on:1, dphy1, ret 0
[   29.737354] sc200ai 5-0030: 1920x1080@10, mode 0, vts 0x1a5e
Redistribute latency...
[06:43:35.126] seeing the first app
0:01:17.9 / 99:99:99.

Simultaneous preview of Camera0, Camera1, Camera2, and Camera3

1gst-launch-1.0 v4l2src device=/dev/video44 ! video/x-raw,format=NV16,width=480,height=320,framerate=25/1 ! videoconvert ! videoflip video-direction=90r ! videoconvert ! fpsdisplaysink name=video44 video-sink="waylandsink render-rectangle=\"<20,10,320,480>\"" &
2gst-launch-1.0 v4l2src device=/dev/video52 ! video/x-raw,format=NV16,width=480,height=320,framerate=25/1 ! videoconvert ! videoflip video-direction=90r ! videoconvert ! fpsdisplaysink name=video52 video-sink="waylandsink render-rectangle=\"<370,10,320,480>\"" &
3gst-launch-1.0 v4l2src device=/dev/video60 ! video/x-raw,format=NV16,width=480,height=320,framerate=25/1 ! videoconvert ! videoflip video-direction=90r ! videoconvert ! fpsdisplaysink name=video60 video-sink="waylandsink render-rectangle=\"<20,510,320,480>\"" &
4gst-launch-1.0 v4l2src device=/dev/video68 ! video/x-raw,format=NV16,width=480,height=320,framerate=25/1 ! videoconvert ! videoflip video-direction=90r ! videoconvert ! fpsdisplaysink name=video68 video-sink="waylandsink render-rectangle=\"<370,510,320,480>\"" &
Serial terminal output
root@rv1126b-buildroot:/#
ndsink render-rectangle=\"<20,10,320,480>\"" &ink name=video44 video-sink="waylan
[1] 1503
ndsink render-rectangle=\"<370,10,320,480>\"" &nk name=video52 video-sink="waylan
[2] 1505
root@rv1126b-buildroot:/# Setting pipeline to PAUSED ...
Using mplane plugin for capture
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
[   30.197350] rkisp_hw 21d00000.isp: set isp clk = 297000000Hz
[   30.199285] rkcif-mipi-lvds: stream[0] start streaming
[   30.199547] rockchip-mipi-csi2 mipi0-csi2: stream on, src_sd: 0000000019d11252, sd_name:rockchip-csi2-dphy1
[   30.199567] rockchip-mipi-csi2 mipi0-csi2: stream ON
[   30.199610] rockchip-csi2-dphy1: dphy1, data_rate_mbps 742
[   30.199636] rockchip-csi2-dphy csi2-dphy1: csi2_dphy_s_stream stream on:1, dphy1, ret 0
[   30.199647] sc200ai 5-0030: 1920x1080@10, mode 0, vts 0x1a5e
Setting pipeline to PAUSED ...
Using mplane plugin for capture
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ndsink render-rectangle=\"<20,510,320,480>\"" &nk name=video60 video-sink="waylan
[3] 1522
root@rv1126b-buildroot:/# [   30.264061] rkcif-mipi-lvds1: stream[0] start streaming
[   30.264368] rockchip-mipi-csi2 mipi1-csi2: stream on, src_sd: 00000000b9b88701, sd_name:rockchip-csi2-dphy2
[   30.264392] rockchip-mipi-csi2 mipi1-csi2: stream ON
[   30.264438] rockchip-csi2-dphy2: dphy2, data_rate_mbps 742
[   30.264466] rockchip-csi2-dphy csi2-dphy2: csi2_dphy_s_stream stream on:1, dphy2, ret 0
[   30.264479] sc200ai 3-0030: 1920x1080@10, mode 0, vts 0x1a5e
[   30.289591] rkisp_hw 21d00000.isp: set isp clk = 396000000Hz
current rga_api version 1.10.5_[9]. The called RockchipRga API is deprecated and will be removed in a future release, currently using the legacy API for compatibility. Please refer to the latest IM2D API documentation to update your implementation.
Redistribute latency...
[07:02:57.583] seeing the first app
Setting pipeline to PAUSED ...
Using mplane plugin for capture

4.17 Video Playback

4.17.1 Built-in playback

The script instruction directory is in /rockchip-test/video/, just run it.

root@rv1126b-buildroot:/# /rockchip-test/video/test_gst_video.sh
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
mpp[1489]: mpp_info: mpp version: 958803d7 author: Herman Chen   2026-02-26 fix[h265d_rkv]: Fix rkv ref and poc setup overflow
mpp[1489]: mpp_info: mpp version: 958803d7 author: Herman Chen   2026-02-26 fix[h265d_rkv]: Fix rkv ref and poc setup overflow
mpp[1489]: mpp_info: mpp version: 958803d7 author: Herman Chen   2026-02-26 fix[h265d_rkv]: Fix rkv ref and poc setup overflow
mpp[1489]: mpp: unable to create enc vp8 for soc rv1126b unsupported
mpp[1489]: mpp_info: mpp version: 958803d7 author: Herman Chen   2026-02-26 fix[h265d_rkv]: Fix rkv ref and poc setup overflow
mpp[1489]: mpp_info: mpp version: 958803d7 author: Herman Chen   2026-02-26 fix[h265d_rkv]: Fix rkv ref and poc setup overflow
Redistribute latency...
mpp[1489]: h264d_api: is_avcC=1
mpp[1489]: mpp_buf_slot: mismatch h_stride_by_pixel 1472 - 1280
mpp[1489]: mpp_buf_slot: mismatch h_stride_by_byte 1472 - 1280
mpp[1489]: mpp_buf_slot: mismatch size_total 1589760 - 1843200
mpp[1489]: mpp_buf_slot: mismatch h_stride_by_pixel 1472 - 1280
mpp[1489]: mpp_buf_slot: mismatch h_stride_by_byte 1472 - 1280
mpp[1489]: mpp_buf_slot: mismatch size_total 1589760 - 1843200
Pipeline is PREROLLED ...0 %)
Prerolled, waiting for async message to finish...
Setting pipeline to PLAYING ...
Redistribute latency...
New clock: GstSystemClock
0:00:03.2 / 0:00:29.5 (10.9 %)

4.17.2 Command line

1export GST_MPP_VIDEODEC_DEFAULT_ARM_AFBC=1
2gst-play-1.0 --videosink="waylandsink fullscreen=true" /mnt/udisk1/video/4KP30/4K30P-BLACKPINK-DDU-DU_DDU-DU.mp4 --audiosink="alsasink device=hw:0,0"

Command explanation:

  • export GST_MPP_VIDEODEC_DEFAULT_ARM_AFBC=1: Open AFBC.

  • --videosink="kmssink plane-id=74": Specifies the plane. Which can be viewed using the command cat /sys/kernel/debug/dri/0/state | grep “plane[”

  • /mnt/udisk1/video/4KP30/4K30P-BLACKPINK-DDU-DU_DDU-DU.mp4: The media file path to be played.

  • --audiosink="alsasink device=hw:0,0": Specifies the audio output device as hw:0,0.

Serial terminal output
root@rv1126b-buildroot:/# export GST_MPP_VIDEODEC_DEFAULT_ARM_AFBC=1
root@rv1126b-buildroot:/#
 device=hw:0,0"deo/4KP30/4K30P-BLACKPINK-DDU-DU_DDU-DU.mp4 --audiosink="alsasink
Press 'k' to see a list of keyboard shortcuts.
Now playing /mnt/udisk1/video/4KP30/4K30P-BLACKPINK-DDU-DU_DDU-DU.mp4
Redistribute latency...
Redistribute latency...
mpp[1553]: mpp_info: mpp version: 958803d7 author: Herman Chen   2026-02-26 fix[h265d_rkv]: Fix rkv ref and poc setup overflow
mpp[1553]: mpp_info: mpp version: 958803d7 author: Herman Chen   2026-02-26 fix[h265d_rkv]: Fix rkv ref and poc setup overflow
mpp[1553]: mpp_info: mpp version: 958803d7 author: Herman Chen   2026-02-26 fix[h265d_rkv]: Fix rkv ref and poc setup overflow
mpp[1553]: mpp: unable to create enc vp8 for soc rv1126b unsupported
mpp[1553]: mpp_info: mpp version: 958803d7 author: Herman Chen   2026-02-26 fix[h265d_rkv]: Fix rkv ref and poc setup overflow
mpp[1553]: mpp_info: mpp version: 958803d7 author: Herman Chen   2026-02-26 fix[h265d_rkv]: Fix rkv ref and poc setup overflow
Redistribute latency...
Redistribute latency...
mpp[1553]: h264d_api: is_avcC=1
mpp[1553]: mpp_buf_slot: mismatch h_stride_by_pixel 4032 - 3840
mpp[1553]: mpp_buf_slot: mismatch h_stride_by_byte 4032 - 3840
mpp[1553]: mpp_buf_slot: mismatch size_total 13063680 - 16588800
mpp[1553]: mpp_buf_slot: mismatch h_stride_by_pixel 4032 - 3840
mpp[1553]: mpp_buf_slot: mismatch h_stride_by_byte 4032 - 3840
mpp[1553]: mpp_buf_slot: mismatch size_total 13063680 - 16588800
Redistribute latency...
[08:23:02.993] seeing the first app
0:00:10.6 / 0:03:28.8