Skip to main content

Linux Tests and Examples

Note: This software page reuses the x6818 software documentation flow as requested. i6818 and x6818 have similar boot/flashing flows; actual commands, source package names, and image names should follow the current i6818 SDK.

qttest Application​

The Linux manual includes qttest / Qt_demo items:

Test ItemDescription
LEDTest board LEDs
BuzzerTest buzzer on/off
BacklightAdjust backlight brightness
KeysTest independent keys
ADC voltageRead ADC voltage
AudioTest recording and playback
TouchscreenTest touch coordinates
UARTTest serial communication
NetworkTest Ethernet or Wi-Fi
TF cardTest TF-card mount and read/write
USB diskTest USB disk mount and read/write
Suspend/resumeTest suspend and wake-up
RebootTest reboot
PoweroffTest shutdown

Low-level Linux Examples​

Play MP3​

mplayer test.mp3

Run in Background​

./app &

Stop a Program​

ps
kill <pid>
killall app

Mount TF Card​

mkdir -p /mnt/sdcard
mount /dev/mmcblk0p1 /mnt/sdcard

Mount USB Disk​

mkdir -p /mnt/udisk
mount /dev/sda1 /mnt/udisk

Save System Clock​

date
hwclock -w
hwclock -r

Save Data Before Power Loss​

sync

Memory Information​

cat /proc/meminfo
free -m

U-Boot TFTP Kernel Download​

setenv ipaddr 192.168.1.100
setenv serverip 192.168.1.10
tftp 0x48000000 uImage
bootm 0x48000000

Mount NFS Root or Directory​

mount -t nfs -o nolock 192.168.1.10:/nfsroot /mnt

Linux Application Examples​

The manual includes:

  • Hello World.
  • LED test program.
  • Math library call.
  • Multi-thread programming.
  • Multi-process programming.
  • Makefile programming.
  • mplayer porting.
  • madplayer porting.
  • gsnap screenshot tool porting.

Hello World​

#include <stdio.h>

int main(void)
&#123;
printf("Hello i6818 Linux!\\n");
return 0;
&#125;

Compile and run:

gcc hello.c -o hello
./hello