6. Buildroot Application

6.1 Display

EM3568 supports HDMI/LVDS dual-display.

_images/LVDS%2BHDMI.jpg Debian_HDMI_Display

If only HDMI is in use, user can turn off the LVDS.

echo off > /sys/class/drm/card0-LVDS-1/status

6.2 Audio I/O

_images/Audio_IO.jpg
cat /proc/asound/cards                     //view sound card
arecord -Dhw:0,0 -f cd record.wav          //record via headset
aplay -Dhw:0,0 record.wav                  //output via headset or speaker.(Priority: Headphones > Speaker)
aplay -Dhw:1,0 record.wav                  //output via HDMI

6.3 USB Host

_images/USB_Host.jpg

the serial port of the terminal has the following printing, indicating that the USB 3.0 device is successfully recognized.

_images/buildroot_USB3.png
df -h          //view the auto-mounted USB device
_images/Buildroot_USB2_icon.png

6.4 SD Card

Debian_test_SD
df -h          //view the auto-mounted SD Card
_images/Buildroot_SD.png

6.5 Ethernet

_images/Ethernet.jpg

Connect the Board and router with an Ethernet cable. User can ping URL/IP at terminal to test Network.

ifconfig
_images/buildroot_ifconfig.png
ping -I eth0 www.boardcon.com       //test eth0
ping -I eth1 www.boardcon.com       //test eth1
Debian_Test_Ethernet _images/buildroot_ping2.png

6.6 ADB

Please install the ADB driver to the PC before test,then connect the board and PC with micro USB cable.

_images/ADB.jpg

Open cmd.exe on PC, then execute the command to enable ADB

adb shell
_images/buildroot_adb_enable.png

6.7 4G&GPS

_images/4G_connect.jpg

Step 1, Insert 4G module to PCIe slot (4G model: EC20/EC25).

Step 2, Connect antenna and insert SIM card.

Step 3, Execute follow command to connect 4G network after power on.

pppd call quectel-ppp &         //realize ppp dialing
ifconfig                        //view network interface status
ping -I ppp0 www.boardcon.com   //ping URL/IP to check the network connectivity
buildroot_Test_4G _images/buildroot_realize_ppp_2.png _images/buildroot_ifconfig_4G.png buildroot_Test_4G
echo -e "AT+QGPS=1\r\n" > /dev/ttyUSB2      //test GPS
cat /dev/ttyUSB1
Debian_Test_GPS

6.8 SATA

_images/SATA_connect.jpg

EM3568 buildroot OS only supports etx4 format, please format the SATA device to ext4 before test. If the SATA device is in ext4 format, skip this step.

ls /dev/                       //view the device name
mke2fs -t ext4 /dev/sda        //format SATA to ext4
_images/buildroot_view_SATA_name.png

Mount SATA and test.

mount /dev/sda /mnt/sata0     //mount SATA to the directory sata0
ls /mnt/sata0                 //view the contents of SATA
df -h                         //view the space size of the mounted disk
Test_Sata

6.9 Camera(OV13850)

_images/camera_connect.jpg

The EM3568 buildroot is configured with two cameras (ov13850) by default. If want to preview the cameras normally, please connect two cameras.

pidof rkaiq_3A_server         //Check whether threads exist in rkaiq_3A_server

rkaiq_3A_server has started.

_images/buildroot_rkaiq_3A_server.png

If there are no threads, execute the command to start rkaiq_3A_server.

/etc/init.d/S40rkaiq_3A start

View the device channel.

grep "" /sys/class/video4linux/v*/name | grep mainpath
grep "" /sys/class/video4linux/v*/name | grep selfpath
_images/buildroot_camera_channel.png

Preview.

gst-launch-1.0 v4l2src device=/dev/video8 ! video/x-raw,format=NV16,width=1280,height=800, framerate=30/1 ! kmssink
gst-launch-1.0 v4l2src device=/dev/video17 ! video/x-raw,format=NV16,width=1280,height=800, framerate=30/1 ! kmssink

Record video.

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

Take photos.

gst-launch-1.0 -v v4l2src device=/dev/video17 num-buffers=10 ! video/x-raw,format=NV12,width=1280,height=800 ! mppjpegenc ! multifilesink location=/tmp/test%05d.jpg

6.10 WiFi&Bluetooth

_images/WiFi%2BBT.jpg
ifconfig   //view the status of the network interfaces
_images/buildroot_wifi_ifconfig.png _images/Debian_SSID_pw.png

View available wifi devices

iwlist wlan0 scan       //scan the available APs
_images/buidroot_scan_ap.png
vi /data/cfg/wpa_supplicant.conf      //configure SSID and password
_images/buildroot_ssid_pw.png
wpa_supplicant -B -i wlan0 -c /data/cfg/wpa_supplicant.conf    //connect to SSID(about 5-10 seconds)

Wait for 5-10 seconds, then execute the following commands.

ifconfig                           //view the network interface status
ping -I wlan0 www.boardcon.com     //ping URL to test wifi
_images/buildroot_wifi_ifconfig2.png _images/buildroot_wifi_ping.png

Bluetooth testing (EM3568 BT named BlueZ 5.62).

bt_load_rtk_firmware    //enable Bluetooth
hciconfig -a            //view Bluetooth status
hciconfig hci0 piscan   //make Bluetooth discoverable
bluetoothctl            //manage Bluetooth devices and settings
_images/buildroot_bt_device.png _images/buildroot_bt_pair.png

Enter yes to pair.

_images/buildroot_bt_pair_2.png
exit      //exit bluetooth

6.11 SPI

Short circuit MISO_M1 and MOSI_M1 of SPI.

_images/SPI.jpg
spidev0.0_test          //test SPI0
spidev2.0_test          //test SPI2
_images/buildroot_SPI0.png _images/buildroot_SPI2.png

6.12 UART

_images/UART.jpg

Short circuit RX and TX of UART, execute the command and input characters to test.

com /dev/ttyS4 115200 8 0 1      //test UART4.  **Ctrl+C** to exit the test.
com /dev/ttyS3 115200 8 0 1      //test UART3
com /dev/ttyS5 115200 8 0 1      //test UART5
_images/buildroot_UART.png

6.13 RS485

Connect the RS485 ports of Board A and B with the test line.

RS485 connect _images/RS485.jpg
com /dev/ttyS0 115200 8 0 1
_images/buildroot_RS485.png

6.14 CAN

Connect the CAN ports of board A and board B.

_images/CAN_icon.jpg _images/EM3568_CAN.jpg

Execute the following commands on the serial terminal of board A and board B.

ip link set can0 down
ip link set can0 type can bitrate 1000000 dbitrate 3000000 fd on
ip link set can0 up

Set one development board as receiver.

candump can0                                        //set to receiver

The other board send characters as transmitter.

cansend can0 123#DEADBEEF           //CAN0 send characters 0xDE 0xAD 0xBE 0xEF
_images/buildroot_can_test.png

6.15 Keys

_images/EM3568_keys.jpg

Recovery key: long press to enter loader mode.

Power key: short press to sleep/wake up, long press to shutdown/startup.

Reset key: restart board.

6.16 RTC

The external lithium battery is used to ensure the RTC is still able to work after power off.

_images/EM3568_RTC.jpg
busybox date -s “2023-07-21 15:36:00”      //set system date
hwclock -w                                 //set the hardware clock to current system time
hwclock
_images/buidroot_RTC_set.png

6.17 video playback

6.17.1 Built-in playback

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

_images/buildroot_Built-in_playback.png

6.17.2 Browser playback

chromium /mnt/udisk/video/4KP30/4K30P-BLACKPINK-DDU-DU_DDDU-DU.mp4
_images/buildroot_Browser_playback.png

6.17.3 gst-play-1.0 playback

If some video files cannot be played normally by chromium browser, user can use gst-play-1.0 to play.

cat /sys/kernel/debug/dri/0/state | grep "plane\["    //Select the display for playback
export GST_MPP_VIDEODEC_DEFAULT_ARM_AFBC=1            //open AFBC
GST_DEBUG=*mpp*:4 gst-play-1.0 --flags=3 --videosink="kmssink plane-id=129" /mnt/udisk/video/H265_HEVC/I.O.I-Dream.Girl.2160p.UHDTV.H265.ts  --audiosink="alsasink device=hw:1,0"       // Select sound card 4, audio output via HDMI
_images/buildroot__gst_play_1.png _images/buildroot__gst_play_2.png _images/buildroot__gst_play_3.png