iMX6 Rex Module production test

Content

Before you start, be sure, the module is properly inserted in a baseboard and all the 4 screws are tight up.

Prepare SD card with filesystem and kernel

Before you start testing the module, prepare SD card. Follow these steps >>

Boot up the board from SD card to Linux

To boot up from an SD card, we need to setup the uboot environmental variables. After the board is powered up, stop the autoboot and paste these commands:
> setenv bootargs 'console=ttymxc0,115200'
> setenv bootargs_mmc 'setenv bootargs ${bootargs} ip=dhcp root=/dev/mmcblk0p1 rootwait'
> setenv bootcmd_mmc 'run bootargs_mmc ; mmc dev 1; ext2load mmc 1 0x10800000 uImage 3916624; bootm 0x10800000'
> setenv bootcmd 'run bootcmd_mmc'
> saveenv;reset
Note: If you want to use one of the older kernels, you may also need to set up a ping in u-boot. Replace 192.168.1.1 in the command below with an IP address from your network and PASTE it to the u-boot:
> setenv bootcmd 'ping 192.168.1.1; run bootcmd_mmc'
> saveenv
> reset
If your server does not support dhcp, you need to paste also the following commands (otherwise skip this). In the first command update the IP address which will be assigned to the Rex board and the subnet mask of your network (in format 192.168.1.78:::255.255.255.0):
> setenv bootargs_mmc 'setenv bootargs ${bootargs} ip=192.168.1.78:::255.255.255.0 root=/dev/mmcblk0p1 rootwait'
> saveenv
> reset
Insert the prepared SD card to the J29 SD slot (it is the slot placed on the board edge). Unplug and plug power cable (this will reset the board). The board should boot up to the Linux command line within one minute. If the booting is slower, your network configuration is possibly incorrect (kernel is waiting for an answer from DHCP server).

DDR3 Memory

This is a good memory test. It will run for 20 seconds. If you need to run it for longer change the number "20" to something higher (e.g. 600000). If you need to run it on more then 100MB, change the number "100" (e.g. 256). To interrupt the test use CTRL+C:
# stressapptest -s 20 -M 100 -m 4 -W

2014/03/11-16:27:41(UTC) Status: PASS - please verify no corrected errors
Check out the Status by the end of the test. It must PASS.

Ethernet

To test the ethernet, we will use a simple ping test. Don't forget to update the IP address and use one from your network:
# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_req=1 ttl=64 time=0.223 ms
64 bytes from 192.168.1.1: icmp_req=2 ttl=64 time=0.187 ms
^C
--- 192.168.1.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.187/0.205/0.223/0.018 ms
All the packets have to be received (0% packet loss).

UART

Interface UART1 (RS232) is used as a serial console - so if you see uboot and Linux booting up and you can write some commands, the UART1 is working. To test UART2 we will use a simple serial loopback test. Before you start the test, fit a link to connect pins: J31.3 together with J31.5. Following test application will check if data sent are received back correctly:
# cd ~/serial-loopback-test/
# ./serial-loopback-test /dev/ttymxc1 115200 "fedevel"
stdalt not opened; Alternative file descriptor: 3
Opening port /dev/ttymxc1;
Got speed 115200 (4098/0x1002);
Got file/string 'fedevel';
+++START+++
CTRL+C to exit
^C
+++DONE+++
CYCLES PASS: 30385 FAILED: 0
Wrote: 212695 bytes; Read: 212696 bytes; Total: 425391 bytes.
Test time: 37 s 675100 us.
Measured: write 5645.51 Bps, read 5645.53 Bps, total 11291.04 Bps.
Run the serial-loopback-test command, wait few seconds (e.g. 10 seconds) and then press CTRL+C. FAILED must be 0.

CFAST SATA

Turn the board OFF (disconnect power). Plug a CFAST card into the J15 holder and connect the board power back. The board will boot up into Linux. Use "dmesg" command to find out, where the CFAST disk is located:
# dmesg | tail
From the dmesg, you will see how the CFAST was recognized. In our case, the CFAST is located in /dev/sda and has one partition at /dev/sda1. We will map this sda1 partition into /media and do a simple copy test:
# mount /dev/sda1 /media/
# ls -la /media/
# mv ~/iMX6\ Rex\ V1I1\ -\ Schematic.PDF /media/
# cp -prv /media/iMX6\ Rex\ V1I1\ -\ Schematic.PDF ~/
‘/media/iMX6 Rex V1I1 - Schematic.PDF’ -> ‘/root/iMX6 Rex V1I1 - Schematic.PDF’
# umount /media/
You should see no errors during this operation.

SD card

The SD2 interface (SD2 interface is connected to the slot placed on the board edge) has been already tested (you have successfully booted up Linux from an SD card plugged into this socket). To test the SD3 interface, we use a simple copy test. First, check how the SD card was recognized:
# dmesg | tail

mmcblk1: mmc0:e624 SU32G 29.7 GiB
 mmcblk1: p1
In this example, the card is recognized as /dev/mmcblk1 and has one partition called /dev/mmcblk1p1. Check if a jumper on the header JP3 is fitted on. If the header is open, fit the jumper and reboot the board. (Note: If the jumper is not fitted, the SD3 is read only. If the jumper is fitted on, the SD card is read/write). Insert SD3 card after the board has booted up (when the Linux command line is ready). COPY & PASTE these commands:
# mount /dev/mmcblk1p1 /media/
# ls -la /media/
# mv ~/iMX6\ Rex\ V1I1\ -\ Schematic.PDF /media/
# cp -prv /media/iMX6\ Rex\ V1I1\ -\ Schematic.PDF ~/
‘/media/iMX6 Rex V1I1 - Schematic.PDF’ -> ‘/root/iMX6 Rex V1I1 - Schematic.PDF’
# umount /media/
You should see no errors during this operation.

I2C

This is a simple I2C test which lists RTC registers. COPY & PASTE this command:
# i2cdump -r 0-0xf 1 0x51 b
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1, address 0x51, mode byte
Probe range limited to 0x00-0x0f.
Continue? [Y/n]
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 08 80 83 b8 87 80 80 04 80 a0 85 b2 b3 80 03 20    ???????????????
You should see something similar as above. The numbers must not be all FF or 00.

LVDS

Connect an LVDS display to the Rex board. Connect the LVDS backlight to a power. Fit a link to the header J17 between pins 2-3. Be aware! If you connect the link wrong way you may damage your LVDS display! (Note: the link selects LVDS power voltage between 3.3V or 5V). COPY & PASTE this command to run a test video on the LVDS display:
# mplayer -vo fbdev2 -vf scale -zoom -xy 1024 ~/Clouds.avi

HDMI

Connect HDMI monitor. Be sure that the monitor has selected the correct input (hdmi). Paste these commands and you should see the test video:
# echo 0 > /sys/class/graphics/fb3/blank
# mplayer -vo fbdev2:/dev/fb3 -vf scale -zoom -loop 0 -xy 1024 ~/Clouds.avi

Audio

Plug your headphones into the black jack connector and your speakers into the green jack connector. Set up audio first (in the alsamixer set headphones volume to the maximum - first column - and turn ON the speakers):
# alsamixer
Run this command to play a simple audio test file (you should hear birds):
# aplay -D hw:0,0 ~/blackbird.wav 

PCIE

Turn off the board. Plug Intel 4965AGN wifi card to PCIE mini card slot J4. Connect also antennas in the ports 1 and 3. After you power up the board stop autoboot and paste these commands to the u-boot:
> setenv bootcmd_mmc 'run bootargs_base bootargs_mmc; mmc dev 1; ext2load mmc 1 0x10800000 uImage-wifi-and-modem-no-fec 4095972; bootm 0x10800000'
> setenv bootcmd 'run bootcmd_mmc'
> saveenv; reset
Run these commands after the board has booted up:
# cd ~/iwlwifi-4965-ucode-228.61.2.24
# nano wpa.conf
Insert your Wifi network information into the opened file (replace "wifinetworkname" and "wifipassword" with your Wifi settings):
network={
    ssid="wifinetworkname"
        psk="wifipassword"
}
This command will connect your board to the Wifi network. Ignore the Invalid argument warning:
# wpa_supplicant -B -Dwext -iwlan0 -cwpa.conf
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
Now check the connection. This is how it should look when everything is configured properly:
# iwconfig
lo        no wireless extensions.

wlan0     IEEE 802.11abgn  ESSID:"s15as"
          Mode:Managed  Frequency:2.412 GHz  Access Point: D4:CA:6D:6B:64:57
          Bit Rate=1 Mb/s   Tx-Power=15 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=70/70  Signal level=-20 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:2   Missed beacon:0

# ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 00:13:e8:44:2b:51
          inet addr:192.168.110.120  Bcast:192.168.110.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:33 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2237 (2.2 KB)  TX bytes:1899 (1.8 KB)
The last thing we have to do is to configure static IP. Use an IP address from the range of your Wifi network:
# ifconfig wlan0 192.168.110.120
# route add -net 0.0.0.0 netmask 0.0.0.0 gw 192.168.110.1
Internet now should work. Try to ping google:
# ping www.google.com
PING www.google.com (62.197.198.208) 56(84) bytes of data.
64 bytes from cache.google.com (62.197.198.208): icmp_req=1 ttl=60 time=8.50 ms
64 bytes from cache.google.com (62.197.198.208): icmp_req=2 ttl=60 time=7.56 ms
64 bytes from cache.google.com (62.197.198.208): icmp_req=3 ttl=60 time=7.50 ms
64 bytes from cache.google.com (62.197.198.208): icmp_req=4 ttl=60 time=9.00 ms
64 bytes from cache.google.com (62.197.198.208): icmp_req=5 ttl=60 time=8.05 ms
^C
--- www.google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 7.505/8.126/9.004/0.578 ms
All the packets have to be received (0% packet loss).

USB 0

To test the USB ports is simple. Just plug in an USB device (e.g. mouse) into the first USB port of the stacked connector. Check if the USB was recognized:
# dmesg | tail
usb 1-1.1: new low speed USB device number 3 using fsl-ehci
usb 1-1.1: device v046d pc518 is not supported
input: Logitech USB Receiver as /devices/platform/fsl-ehci.0/usb1/1-1/1-1.1/1-1.1:1.0/input/input1
generic-usb 0003:046D:C518.0001: input,hidraw0: USB HID v1.11 Mouse [Logitech USB Receiver] on usb-fsl-ehci.0-1.1/input0
input: Logitech USB Receiver as /devices/platform/fsl-ehci.0/usb1/1-1/1-1.1/1-1.1:1.1/input/input2
generic-usb 0003:046D:C518.0002: input,hidraw1: USB HID v1.11 Device [Logitech USB Receiver] on usb-fsl-ehci.0-1.1/input1
The Red LED diode next to the USB stacked connector indicates that USB is plugged in. Test if the mouse is working in the graphical GUI - move it and see the cursor on the LVDS display. It has to work. Do exactly same for the second USB connector (unplug the USB mouse and plug it into the second position):
# dmesg | tail
usb 1-1.1: USB disconnect, device number 3
ehci_fsl_bus_resume ends, DR
usb 1-1.2: new low speed USB device number 4 using fsl-ehci
usb 1-1.2: device v046d pc518 is not supported
input: Logitech USB Receiver as /devices/platform/fsl-ehci.0/usb1/1-1/1-1.2/1-1.2:1.0/input/input3
generic-usb 0003:046D:C518.0003: input,hidraw0: USB HID v1.11 Mouse [Logitech USB Receiver] on usb-fsl-ehci.0-1.2/input0
input: Logitech USB Receiver as /devices/platform/fsl-ehci.0/usb1/1-1/1-1.2/1-1.2:1.1/input/input4
generic-usb 0003:046D:C518.0004: input,hidraw1: USB HID v1.11 Device [Logitech USB Receiver] on usb-fsl-ehci.0-1.2/input1

USB 1 & SIM card

To test USB 1, we need to plug in the Telit HE 910 modem. Plug also the SIM card to the holder J5 located on the bottom side. Turn off the board. Insert the modem card into the PCIE mini slot J4 and connect an antenna to the center RF connector. Power up the board. Run serial console on the modem port:
# picocom /dev/ttyACM3 -b 115200
To test the USB interface and setup the modem, use these AT commands (COPY & PASTE the commands starting with AT):
AT
OK
AT#DVI=1,2,1
OK
AT#DVIEXT=1,0,0,1,0
OK
Now, the iMX6 Rex is ready to receive a call. Call your modem (use the SIM card number which is inserted in the Baseboard). You should see the RING message in the picocom. Use "ATA" command to receive the call:
RING

RING

ATA
OK
To exit from the picocom, press CTRL+A and then CTRL+X.

Important!

Before you send the tested module to a customer, update the u-boot environmental variables (run these commands):
> setenv  bootargs 'console=ttymxc0,115200'
> setenv bootargs_mmc 'setenv bootargs ${bootargs} ip=dhcp root=/dev/mmcblk0p1 rootwait video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB666 vmalloc=400M fbmem=28M fbcon=28M'
> setenv bootcmd_mmc 'run bootargs_base bootargs_mmc; mmc dev 1; ext2load mmc 1 0x10800000 uImage 3916420; bootm 0x10800000'
> setenv bootcmd 'run bootcmd_mmc'
> saveenv; reset
Now test if the board will boot up successfully and if you will see the command prompt on the HDMI monitor.