6. Buildroot Application

6.1 HDMI Display

Connect the board and monitor with a HDMI cable, then start up.

HDMI Display

Note

The Boardcon factory default HDMI display. If change to LVDS/MIPI please reflash boot.img.

10.1” MIPI LCD: boot-10.1inch_mipi.img

10.1” LVDS LCD: boot-10.1inch_lvds.img

7” LVDS LCD: boot-7inch_lvds.img

HDMI: boot-hdmi.img

_images/buildroot_reflash_boot.png

6.2 SD Card

The SD card is automatically mounted. EM3566 supports SD Hot-plug.

df -h
ls /mnt/sdcard
_images/buildroot_14.png

6.3 USB Host

The USB Host can be used to connect USB mouse, USB keyboard, U-Disk or other USB devices.

df -h
ls /mnt/udisk
_images/buildroot_15.png

6.4 Video Player

Copy video file to SD card or U-disk then insert it to the board.

Test 1920x1080 (1080P)

gst-play-1.0 --videosink=xvimagesink XXX   //XXX is file path
_images/buildroot_16.png

Test 4K (max-fps to 50fps)

export GST_MPP_VIDEODEC_DEFAULT_ARM_AFBC=1              //set AFBC
cat /sys/kernel/debug/dri/0/state | grep "plane\["      //view the plane id (select Cluster0-win0)
GST_DEBUG=*mpp*:4 gst-play-1.0 --flags=3 --videosink="kmssink plane-id=70" /XXX         //play video. XXX is the file path
GST_DEBUG=*mpp*:4 gst-play-1.0 --flags=3 --videosink="kmssink plane-id=70" /mnt/sdcard/4K.mp4 --audiosink="alsasink device=hw:1,0"   //Specify audio channel output
Video Player _images/buildroot_17_1.png _images/buildroot_17_2.png _images/buildroot_17_3.png

6.5 Ethernet

Connect the Board and router with an Ethernet cable (default DHCP=Yes). User can ping URL/IP at terminal.

eg.

ifconfig
ping www.boardcon.com
_images/buildroot_18.png _images/buildroot_19.png

6.6 Record

Execute follow command to start recording, speech in front of the microphone then can record.

aplay -l       //view audio equipment
arecord -Dhw:0,0 -d 10 -f cd -r 44100 -c 2 -t wav test.wav    //start recording
aplay test.wav         //play record file through HDMI
aplay -Dhw:1,0 test.wav       //play record file through earphone
_images/buildroot_20.png _images/buildroot_21.png _images/buildroot_22.png _images/buildroot_23.png

6.7 RTC

Execute the command hwclock at CRT terminal.

date -s "2022-12-06 12:00:00"     //set system time
hwclock -w           //synchronize system time and RTC time
hwclock

Wait a minute then run hwclock again, it can be seen the time has changed.

_images/buildroot_24.png

6.8 WiFi

Connect the WiFi antenna, input SSID and password to test.

ifconfig eth0 down
wifi__start.sh SSID Password  //input your SSID and password
ifconfig
ping www.boardcon.com
_images/buildroot_25.png wifi wifi

user also can execute the following commands to test wifi

ifconfig eth0 down
ifconfig wlan0 up
iwlist wlan0 scan             // search hotspot
vi /etc/wpa_supplicant.conf   // configure the wireless hotspot to be connected
wpa_supplicant -B -c /etc/wpa_supplicant.conf -i wlan0    //restart wifi and connect to the hotspot
_images/hotspot_1.png _images/hotspot_2.png _images/hotspot_restart.png
ifconfig
ping www.boardcon.com
_images/hotspot_3.png _images/hotspot_4.png

6.9 Bluetooth

Execute the command to open Bluetooth.

hciconfig hci0 up
hciconfig -a
hciconfig hci0 iscan        //allow Bluetooth to be searched
hcitool scan
bluetoothctl                //allow Bluetooth to be pairable
Bluetooth test _images/BT_2.png

click bluetooth BlueZ 5.62 in phone to pair. Input yes

_images/BT_3.png
connect 38:89:2C:24:FB:64     //connect bluetooth
trust 38:89:2C:24:FB:64       //trust bluetooth
_images/BT_4.png

6.10 RS485

This test method is only for reference.

Step1, connect the RS485 ports of Board A and B with the test line.

CAN connect

Step2, push the file com into board A and board B via ADB

adb push \xx\com /system      //\xx\ is the absolute path to store file
adb shell
chmod 777 /system/com         //modify com properties
_images/buildroot_29.png

or copy com to SD card and then insert it to the card slot. Powered on, after the system boot, execute the command to copy com from SD card to the board.

cp /mnt/sdcard/com /system
ls /system
chmod 777 /system/com         //modify com properties

Step3, after execute command at Serial terminal. Input character to test RS485 communication

./system/com /dev/ttyS3 115200 8 0 1
_images/buildroot_30.png _images/buildroot_31.png

6.11 UART

The UART loopback test is for reference only. connect the transmit (TX) pin to the receive (RX) pin of UART. after executes the command, input character to test UART.

./system/com /dev/ttyS4 115200 8 0 1          //test UART4
_images/buildroot_32.png

Press Ctrl+C to exit UART4 testing, execute the command to test UART5.

./system/com /dev/ttyS5 115200 8 0 1        //test UART5
_images/buildroot_33.png

6.12 M.2 SATA

Format SSD to ext4 file system on ubuntu system

ls /dev                              //view the SSD device name
mke2fs -t ext4 /dev/nvme0n1         //format ssd to ext4 file system on ubuntu OS
_images/buildroot_34.png

Execute the command to mount SSD.

mkdir /mnt/ssd
mount -t ext4 /dev/nvme0n1 /mnt/ssd  //mount SSD
ls /mnt/ssd
_images/buildroot_35.png

6.13 4G

ifconfig eth0 down           //turn off eth0 to avoid DNS conflicts
cd /etc/ppp/peers
pppd call quectel-ppp &      //realize ppp dialing
ifconfig                     //view the network status
ping www.boardcon.com        //check the connectivity of the network
_images/buildroot_36.png _images/buildroot_37.png

6.14 GPS

Execute the command to test GPS (integrated in 4G model).

echo -e "AT+QGPS=1\r\n" > /dev/ttyUSB2
cat /dev/ttyUSB1
_images/buildroot_38.png

6.15 IR

Connect IR receiver to the IR connector. Operate the IR controller and view the received data after execute the command..

echo 1 > /sys/module/rockchip_pwm_remotectl/parameters/code_print
_images/buildroot_39.png

6.16 ADC

ADC test

Test SARADC_VIN2

cat /sys/devices/platform/fe720000.saradc/iio:device0/in_voltage2_raw
ADC test

Connect SARADC_VIN2 to VDDIO_18, execute command again

cat /sys/devices/platform/fe720000.saradc/iio:device0/in_voltage2_raw
ADC test

Connect SARADC_VIN2 to GND, then execute command

cat /sys/devices/platform/fe720000.saradc/iio:device0/in_voltage2_raw
ADC test

Test SARADC_VIN3

cat /sys/devices/platform/fe720000.saradc/iio:device0/in_voltage3_raw

6.17 Camera(OV13850)

grep ov13850 /sys/class/video4linux/v*/name                 //check camera device number
grep "" /sys/class/video4linux/v*/name | grep mainpath
gst-launch-1.0 v4l2src device=/dev/video8 ! video/x-raw,format=NV16,width=1280,height=800, framerate=30/1 ! kmssink      //preview
gst-launch-1.0 v4l2src device=/dev/video8 num-buffers=100 ! video/x-raw,format=NV12,width=1920,height=1088,framerate=30/1 ! videoconvert ! mpph264enc ! h264parse ! mp4mux ! filesink location=/tmp/h264.mp4        //record video
gst-launch-1.0 -v v4l2src device=/dev/video8 num-buffers=10 ! video/x-raw,format=NV12,width=1280,height=800 ! mppjpegenc ! multifilesink location=/tmp/test%05d.jpg   //take a picture
_images/check_camera_device_number_1.png _images/preview_1.png

the files are saved in /tmp

_images/photo_path.png