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 Item | Description |
|---|---|
| LED | Test board LEDs |
| Buzzer | Test buzzer on/off |
| Backlight | Adjust backlight brightness |
| Keys | Test independent keys |
| ADC voltage | Read ADC voltage |
| Audio | Test recording and playback |
| Touchscreen | Test touch coordinates |
| UART | Test serial communication |
| Network | Test Ethernet or Wi-Fi |
| TF card | Test TF-card mount and read/write |
| USB disk | Test USB disk mount and read/write |
| Suspend/resume | Test suspend and wake-up |
| Reboot | Test reboot |
| Poweroff | Test 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)
{
printf("Hello i6818 Linux!\\n");
return 0;
}
Compile and run:
gcc hello.c -o hello
./hello