VAR-SOM-MX6 Yocto Unit Testing V5 b2: Difference between revisions

From Variscite Wiki
m (Text replacement - "http://variscite" to "https://variscite")
 
(23 intermediate revisions by 2 users not shown)
Line 4: Line 4:


= WLAN  =
= WLAN  =
== Setup ==
VAR-SOM-MX6 V2.X (WiLink8):
* Select your WL183x p/n:
<pre>
$ cd /usr/bin/wlconf/
$ ./configure-device.sh wl18xx
select one out of : WL1831, WL1833, WL1835, WL1837.
As a result some additional information may be required like 1/2 antenna connected
</pre>
First time need to set mac address to be used automatically
First time need to set mac address to be used automatically
<pre>
<pre>
$ calibrator set nvs_mac /lib/firmware/ti-connectivity/wl1271-nvs.bin 00:00:00:00:00:00
$ calibrator set nvs_mac /lib/firmware/ti-connectivity/wl1271-nvs.bin 00:00:00:00:00:00
</pre>
</pre>
== Test ==
List SSIDs, from Linux shell type:  
List SSIDs, from Linux shell type:  
<pre>$ iw dev wlan0 scan | grep SSID
<pre>$ iw dev wlan0 scan | grep SSID
Line 48: Line 59:
$ aplay test.wav  
$ aplay test.wav  
</pre>
</pre>
= Resistive touch panel display boot arguments  =
By default, the display timings are set to capacitive display. To switch to resistive display:<br>
Boot the system and stop in u-boot.<br>
editenv bootargs<br>
Add:<br>
video=mxcfb0:dev=ldb,VAR-WVGA,if=RGB24<br>
to the end and<br>
saveenv<br>


= HDMI boot arguments  =
= HDMI boot arguments  =
Line 97: Line 117:
$ modprobe mxc_v4l2_capture
$ modprobe mxc_v4l2_capture
$ /etc/rc5.d/S01xserver-nodm stop
$ /etc/rc5.d/S01xserver-nodm stop
$ gst-launch mfw_v4lsrc&nbsp;! mfw_v4lsink
$ gst-launch imxv4l2src ! imxv4l2sink
</pre>
</pre>


Line 151: Line 171:
mmcblk0boot1: unknown partition table<br>
mmcblk0boot1: unknown partition table<br>
mmcblk0boot0: unknown partition table<br>
mmcblk0boot0: unknown partition table<br>
Select the eMMC device number. Bumber will change if SD card is in.
Select the eMMC device number. Number will change if SD card is in.
* Create partition
* Create partition
<pre> $fdisk /dev/mmcblk1
<pre> $fdisk /dev/mmcblk1
Line 244: Line 264:


Plug a DiskOnKey, Mouse or Keyboard to any of the 3 USB host ports on EVK
Plug a DiskOnKey, Mouse or Keyboard to any of the 3 USB host ports on EVK
= GPIO manipulation  =
Please look at the forum post: https://variscite.com/support-forum/viewtopic.php?f=5&t=29&p=51#p51


= Can-bus  =
= Can-bus  =
Line 260: Line 283:
<pre>$ cansend can0 500#1E.10.10
<pre>$ cansend can0 500#1E.10.10
</pre>
</pre>
= SPI  =
Testing SPI from user space require some changes.
* Configure your kernel and add spidev driver. Device Drivers -> SPI support -> <*>  User mode SPI device driver support<br>
* Add spidev to your device tree<br>
<pre>&ecspi1 {
fsl,spi-num-chipselects = <1>;
cs-gpios = <&gpio4 9 0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi1_2>;
status = "okay";
        chip1: spidev@0 {
              compatible = "spidev";
              spi-max-frequency = <12000000>;
              reg = <0>;
        };
/*
        chip2: spidev@1 {
              compatible = "spidev";
              spi-max-frequency = <20000000>;
              reg = <1>;
};
*/
};</pre>
Pick and choose the right chip select and you can also have multiple chip selects.
* Compile the Linux kernel and device tree.
* For testing use the application:<br>https://raw.githubusercontent.com/varigit/linux-2.6-imx/master/Documentation/spi/spidev_test.c

Latest revision as of 11:56, 10 June 2020

Unit Testing

WLAN

Setup

VAR-SOM-MX6 V2.X (WiLink8):

  • Select your WL183x p/n:
$ cd /usr/bin/wlconf/
$ ./configure-device.sh wl18xx
select one out of : WL1831, WL1833, WL1835, WL1837.
As a result some additional information may be required like 1/2 antenna connected

First time need to set mac address to be used automatically

$ calibrator set nvs_mac /lib/firmware/ti-connectivity/wl1271-nvs.bin 00:00:00:00:00:00

Test

List SSIDs, from Linux shell type:

$ iw dev wlan0 scan | grep SSID

Connecting to an encrypted network

Find your network from the above scan command.

$ mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.org
$ wpa_passphrase <YourAP> <YourPassword> >/etc/wpa_supplicant.conf
$ reboot
$ ifconfig eth0 down
$ 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 125
$ aplay /usr/share/sounds/alsa/Front_Center.wav
$ arecord -f cd -d 10 -D hw:0,0 test.wav
$ aplay test.wav 

Resistive touch panel display boot arguments

By default, the display timings are set to capacitive display. To switch to resistive display:
Boot the system and stop in u-boot.
editenv bootargs
Add:
video=mxcfb0:dev=ldb,VAR-WVGA,if=RGB24
to the end and
saveenv

HDMI boot arguments

All paramters are u-boot enviroment parameters.

Default:

U-Boot # setenv bootargs console=ttymxc0,115200 ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs 

This will set the LCD to work.

HDMI 1080P:

U-Boot # setenv bootargs console=ttymxc0,115200 ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24'

HDMI 720P:

U-Boot # setenv bootargs console=ttymxc0,115200 ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB24

LVDS boot arguments

All paramters are u-boot enviroment parameters.

Default:

U-Boot # setenv bootargs console=ttymxc0,115200 ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs 

This will set the LCD to work.

LVDS only display:

U-Boot # setenv bootargs console=ttymxc0,115200 ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs ldb=sin1

LVDS only display with screen paramters:

U-Boot # setenv bootargs console=ttymxc0,115200 ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs ldb=sin1 video=mxcfb0:dev=ldb,800x600M@60,if=RGB24

LVDS and LCD Dual display:

U-Boot # setenv bootargs console=ttymxc0,115200 ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs ldb=dul0'

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 imxv4l2src ! imxv4l2sink

External Uart

Use minicom to connect. Set the serial to ttymxc2 You can use a loopback or connect to anther computer

SATA

$ $ 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

eMMC (SOM version 2.x)

  • Check that the device is up.
$ dmesg | grep mmcblk
  • Output example

mmcblk0: mmc1:0001 MBG4GC 29.1 GiB
mmcblk0boot0: mmc1:0001 MBG4GC partition 1 4.00 MiB
mmcblk0boot1: mmc1:0001 MBG4GC partition 2 4.00 MiB
mmcblk0rpmb: mmc1:0001 MBG4GC partition 3 4.00 MiB
mmcblk0: unknown partition table
mmcblk0boot1: unknown partition table
mmcblk0boot0: unknown partition table
Select the eMMC device number. Number will change if SD card is in.

  • Create partition
 $fdisk /dev/mmcblk1
enter n p 1 <enter> <enter> w

Example of a partition root@varsomimx6:~# fdisk /dev/mmcblk1 Device contains neither a valid DOS partition table, nor Sun, SGI, OSF or GPT disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that the previous content won't be recoverable.


The number of cylinders for this disk is set to 954240. 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): n Command action

  e   extended
  p   primary partition (1-4)

p Partition number (1-4): 1 First cylinder (1-954240, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-954240, default 954240): Using default value 954240

Command (m for help): p

Disk /dev/mmcblk1: 31.2 GB, 31268536320 bytes 4 heads, 16 sectors/track, 954240 cylinders Units = cylinders of 64 * 512 = 32768 bytes

       Device Boot      Start         End      Blocks  Id System

/dev/mmcblk1p1 1 954240 30535672 83 Linux

Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table

mmcblk1: p1
  • Format and mount
$ mkfs.ext3 /dev/mmcblk1p1 
$ reboot

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

By default the OTG is configure to be "host". You can switch it to "peripheral" if you change the dr_mode in the device tree. &usbotg { vbus-supply = <&reg_usb_otg_vbus>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usbotg_var>; disable-over-current; /* dr_mode: One of "host", "peripheral" or "otg". Defaults to "otg" */ dr_mode = "host" ; status = "okay"; };

  • build Linux out of tree.
  • edit arch/arm/boot/dts/imx6qdl-var-som.dtsi
  • Change the dr_mode in usbotg section
  • re build the device tree with
$ make ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- imx6q-var-som.dtb

copy the file to the sd-card or re flash it to nand. See the relevant section in the WIKI.

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_mass_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

USB Host

Plug a DiskOnKey, Mouse or Keyboard to any of the 3 USB host ports on EVK

GPIO manipulation

Please look at the forum post: https://variscite.com/support-forum/viewtopic.php?f=5&t=29&p=51#p51

Can-bus

Starting Release 4 of the Yocto Canbus is integrated into the system. No patch required.

  1. 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:

$ ip link set can0 up type can bitrate 125000

On board #1:

$ cansniffer can0

On board #2:

$ cansend can0 500#1E.10.10

SPI

Testing SPI from user space require some changes.

  • Configure your kernel and add spidev driver. Device Drivers -> SPI support -> <*> User mode SPI device driver support
  • Add spidev to your device tree
&ecspi1 {
	fsl,spi-num-chipselects = <1>;
	cs-gpios = <&gpio4 9 0>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_ecspi1_2>;
	status = "okay";

        chip1: spidev@0 {
               compatible = "spidev";
               spi-max-frequency = <12000000>;
               reg = <0>;
        };
/*
        chip2: spidev@1 {
               compatible = "spidev";
               spi-max-frequency = <20000000>;
               reg = <1>;
	};
*/
};

Pick and choose the right chip select and you can also have multiple chip selects.