VAR-SOM-MX6 Yocto Unit Testing: Difference between revisions
No edit summary |
(→Canbus) |
||
(30 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{PageHeader|Unit Testing}} | |||
{{DocImage|category1=VAR-SOM-MX6|category2=Yocto}} | {{DocImage|category1=VAR-SOM-MX6|category2=Yocto}} | ||
__toc__ | __toc__ | ||
Line 18: | Line 18: | ||
Find your network from the above scan command.<br> | Find your network from the above scan command.<br> | ||
<pre>wpa_passphrase <YourAP> <YourPassword> >wpa.conf | <pre>$ wpa_passphrase <YourAP> <YourPassword> >wpa.conf | ||
ps | grep wpa_supplicant | $ ps | grep wpa_supplicant | ||
kill the wpa_supplicant process if exist. | *kill the wpa_supplicant process if exist. | ||
wpa_supplicant -Dwext -iwlan0 -c./wpa.conf -B | $ wpa_supplicant -Dwext -iwlan0 -c./wpa.conf -B | ||
udhcpc -iwlan0 | $ udhcpc -iwlan0 | ||
ifconfig | $ ifconfig | ||
</pre> | </pre> | ||
= Gbit Ethernet = | |||
On Target: | |||
<pre>$ ifconfig | |||
$ iperf -s -u | |||
</pre> | |||
On Host: | |||
<pre>$ iperf -c 192.168.1.189 -u -b1000M -w4KB | |||
</pre> | |||
= Bluetooth = | |||
<pre>$ hcitool scan | |||
$ l2ping 98:03:D8:C7:1A:96 | |||
</pre> | |||
= Video playback = | = Video playback = | ||
Play video file, from linux shell type:<br> | Play video file, from linux shell type:<br> | ||
<pre>$ gplay <file> | <pre>$ gplay <file> | ||
</pre> | </pre> | ||
= Audio record/play = | |||
<pre>$ amixer set PCM 200 | |||
$ aplay /usr/share/sounds/alsa/Front_Center.wav | |||
$ arecord -f cd -d 10 -D hw:0,0 test.wav | |||
$ aplay test.wav | |||
</pre> | |||
= HDMI, LVDS , LCD boot arguments = | = HDMI, LVDS , LCD boot arguments = | ||
Line 70: | Line 93: | ||
$ /etc/rc5.d/S01xserver-nodm stop | $ /etc/rc5.d/S01xserver-nodm stop | ||
$ gst-launch mfw_v4lsrc ! mfw_v4lsink | $ gst-launch mfw_v4lsrc ! mfw_v4lsink | ||
</pre> | </pre> | ||
= External Uart = | |||
Use minicom to connect. | |||
Set the serial to ttymxc2 | |||
You can use a loopback or connect to anther computer | |||
= SATA = | |||
<pre>$ cat /proc/scsi/scsi | |||
$ fdisk /dev/sda | |||
When you get prompt "Command (m for help):" hit p | |||
</pre> | |||
Test output example:<br> | |||
<pre>root@varsommx6q:~# cat /proc/scsi/scsi | |||
Attached devices: | |||
Host: scsi0 Channel: 00 Id: 00 Lun: 00 | |||
Vendor: ATA Model: ST9120823AS Rev: 3.AD | |||
Type: Direct-Access ANSI SCSI revision: 05 | |||
root@varsommx6q:~# fdisk /dev/sda | |||
The number of cylinders for this disk is set to 14593. | |||
There is nothing wrong with that, but this is larger than 1024, | |||
and could in certain setups cause problems with: | |||
1) software that runs at boot time (e.g., old versions of LILO) | |||
2) booting and partitioning software from other OSs | |||
(e.g., DOS FDISK, OS/2 FDISK) | |||
Command (m for help): p | |||
Disk /dev/sda: 120.0 GB, 120034123776 bytes | |||
255 heads, 63 sectors/track, 14593 cylinders | |||
Units = cylinders of 16065 * 512 = 8225280 bytes | |||
Device Boot Start End Blocks Id System | |||
/dev/sda1 * 1 9123 73280466 7 HPFS/NTFS | |||
/dev/sda2 9124 14593 43937744+ f Win95 Ext'd (LBA) | |||
/dev/sda5 9124 11035 15358108+ 7 HPFS/NTFS | |||
/dev/sda6 14319 14593 2208906 82 Linux swap | |||
/dev/sda7 11036 14318 26369024 83 Linux | |||
</pre> | |||
= PCIE = | |||
<pre>$ lspci | |||
</pre> | |||
The output should look like:<br> | |||
00:00.0 PCI bridge: Device 16c3:abcd (rev 01)<br> | |||
01:00.0 Network controller: Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron] Network Connection (rev 61) | |||
= USB OTG as host<br> = | = USB OTG as host<br> = | ||
Line 91: | Line 161: | ||
<pre>use dmesg and find out your device for example /dev/sdb | <pre>use dmesg and find out your device for example /dev/sdb | ||
sudo dd if=/dev/zero of=/dev/sdb bs=128k count=1000 | sudo dd if=/dev/zero of=/dev/sdb bs=128k count=1000 | ||
</pre> | </pre> | ||
= 3 ports USB Host<br> = | = 3 ports USB Host<br> = | ||
Line 98: | Line 169: | ||
= Canbus<br> = | = Canbus<br> = | ||
Starting Release 4 of the Yocto Canbus is integrated into the system. No patch required. | |||
#Connect 2 boards. Each board JP26 connect to the other with the right cable.<br> | #Connect 2 boards. Each board JP26 connect to the other with the right cable.<br> | ||
Set the 2 boards:<br> | Set up the 2 boards by running on each of them:<br> | ||
<pre>$ canconfig can0 bitrate 125000 | <pre>$ canconfig can0 bitrate 125000 | ||
$ ifconfig can0 up </pre> | $ ifconfig can0 up </pre> | ||
On board 1:<br> | On board #1:<br> | ||
<pre>canecho can0 -v | <pre>canecho can0 -v | ||
</pre> | </pre> | ||
On board 2:<br> | On board #2:<br> | ||
<pre>cansend can0 - | <pre>cansend can0 -i 0x100 0x11 0x22 0x33 0x44 | ||
</pre> | </pre> |
Latest revision as of 12:22, 12 October 2014
GPU
Play OpenGLES demo, from Linux shell type:
$ modprobe galcore $ cd /opt/viv_samples/vdk/ && ./tutorial3 -f 1000
WLAN
List SSIDs, from Linux shell type:
$ ifconfig wlan0 up $ iwlist wlan0 scan
Connecting to an encrypted network
Find your network from the above scan command.
$ wpa_passphrase <YourAP> <YourPassword> >wpa.conf $ ps | grep wpa_supplicant *kill the wpa_supplicant process if exist. $ wpa_supplicant -Dwext -iwlan0 -c./wpa.conf -B $ udhcpc -iwlan0 $ ifconfig
Gbit Ethernet
On Target:
$ ifconfig $ iperf -s -u
On Host:
$ iperf -c 192.168.1.189 -u -b1000M -w4KB
Bluetooth
$ hcitool scan $ l2ping 98:03:D8:C7:1A:96
Video playback
Play video file, from linux shell type:
$ gplay <file>
Audio record/play
$ amixer set PCM 200 $ aplay /usr/share/sounds/alsa/Front_Center.wav $ arecord -f cd -d 10 -D hw:0,0 test.wav $ aplay test.wav
HDMI, LVDS , LCD boot arguments
All paramters are u-boot enviroment parameters.
Default:
U-Boot # setenv bootargs_base 'setenv bootargs console=ttymxc0,115200'
This will set the LCD to work.
HDMI 1080P:
U-Boot # setenv bootargs_base 'setenv bootargs console=ttymxc0,115200 video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB16 fbmem=48M vmalloc=400 mxc_hdmi.only_cea=1'
mxc_hdmi.only_cea=1 paramter is to work with dvi-hdmi adapter. If you connect it to a TV-HDMI this paramters is not required.
HDMI 720P:
U-Boot # setenv bootargs_base 'setenv bootargs console=ttymxc0,115200 video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB24'
LVDS and LCD Dual display:
U-Boot # setenv bootargs_base 'setenv bootargs console=ttymxc0,115200 ldb=dul0'
LVDS only display:
U-Boot # setenv bootargs_base 'setenv bootargs console=ttymxc0,115200 ldb=sin1'
LVDS only display with screen paramters:
U-Boot # setenv bootargs_base 'setenv bootargs console=ttymxc0,115200 ldb=sin1 video=mxcfb0:dev=ldb,800x600M@60,if=RGB24'
RTC
To set the RTC first set the date from Linux shell, type:
$ date 2013.08.27-15:43
Then set the real time clock from Linux shell, type:
$ hwclock --systohc
Power down your board wait 5 minutes and power up. Check your system with date and the time should be up to date.
Camera
$ modprobe ov5642_camera $ modprobe mxc_v4l2_capture $ /etc/rc5.d/S01xserver-nodm stop $ gst-launch mfw_v4lsrc ! mfw_v4lsink
External Uart
Use minicom to connect. Set the serial to ttymxc2 You can use a loopback or connect to anther computer
SATA
$ cat /proc/scsi/scsi $ fdisk /dev/sda When you get prompt "Command (m for help):" hit p
Test output example:
root@varsommx6q:~# cat /proc/scsi/scsi Attached devices: Host: scsi0 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: ST9120823AS Rev: 3.AD Type: Direct-Access ANSI SCSI revision: 05 root@varsommx6q:~# fdisk /dev/sda The number of cylinders for this disk is set to 14593. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): p Disk /dev/sda: 120.0 GB, 120034123776 bytes 255 heads, 63 sectors/track, 14593 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 9123 73280466 7 HPFS/NTFS /dev/sda2 9124 14593 43937744+ f Win95 Ext'd (LBA) /dev/sda5 9124 11035 15358108+ 7 HPFS/NTFS /dev/sda6 14319 14593 2208906 82 Linux swap /dev/sda7 11036 14318 26369024 83 Linux
PCIE
$ lspci
The output should look like:
00:00.0 PCI bridge: Device 16c3:abcd (rev 01)
01:00.0 Network controller: Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron] Network Connection (rev 61)
USB OTG as host
Plugin Disk on Key Keyboard or Mouse. It will work automaticly.
Use the file manager and the mouse to browse the file system.
You can open terminal and type in Linux commands.
USB OTG as device
Plug a cable to a A linux host.
Folow www.linux-usb.org/gadget/file_storage.html and build the backing_file.
On the Target:
modprobe g_file_storage file=./backing_file
On the Host:
use dmesg and find out your device for example /dev/sdb sudo dd if=/dev/zero of=/dev/sdb bs=128k count=1000
3 ports USB Host
Plug a DiskOnKey, Mouse or Keyboard to any of the 3 ports.
Canbus
Starting Release 4 of the Yocto Canbus is integrated into the system. No patch required.
- Connect 2 boards. Each board JP26 connect to the other with the right cable.
Set up the 2 boards by running on each of them:
$ canconfig can0 bitrate 125000 $ ifconfig can0 up
On board #1:
canecho can0 -v
On board #2:
cansend can0 -i 0x100 0x11 0x22 0x33 0x44