6. Buildroot Application
6.1 Display
EM3568 supports HDMI/LVDS dual-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
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
the serial port of the terminal has the following printing, indicating that the USB 3.0 device is successfully recognized.
df -h //view the auto-mounted USB device
6.4 SD Card
df -h //view the auto-mounted SD Card
6.5 Ethernet
Connect the Board and router with an Ethernet cable. User can ping URL/IP at terminal to test Network.
ifconfig
ping -I eth0 www.boardcon.com //test eth0
ping -I eth1 www.boardcon.com //test eth1
6.6 ADB
Please install the ADB driver to the PC before test,then connect the board and PC with micro USB cable.
Open cmd.exe
on PC, then execute the command to enable ADB
adb shell
6.7 4G&GPS
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
echo -e "AT+QGPS=1\r\n" > /dev/ttyUSB2 //test GPS
cat /dev/ttyUSB1
6.8 SATA
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
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
6.9 Camera(OV13850)
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.
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
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
ifconfig //view the status of the network interfaces
View available wifi devices
iwlist wlan0 scan //scan the available APs
vi /data/cfg/wpa_supplicant.conf //configure SSID and password
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
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
Enter yes to pair.
exit //exit bluetooth
6.11 SPI
Short circuit MISO_M1 and MOSI_M1 of SPI.
spidev0.0_test //test SPI0
spidev2.0_test //test SPI2
6.12 UART
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
6.13 RS485
Connect the RS485 ports of Board A and B with the test line.
com /dev/ttyS0 115200 8 0 1
6.14 CAN
Connect the CAN ports of board A and board B.
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
6.15 Keys
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.
busybox date -s “2023-07-21 15:36:00” //set system date
hwclock -w //set the hardware clock to current system time
hwclock
6.17 video playback
6.17.1 Built-in playback
The script instruction directory is in /rockchip-test/video, just run it.
6.17.2 Browser playback
chromium /mnt/udisk/video/4KP30/4K30P-BLACKPINK-DDU-DU_DDDU-DU.mp4
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