iMX6 TinyRex Testing in an Environmental chamber

On this page you can find all the information about testing iMX6 Tiny Rex boards in an environmental chamber.

Content

Hardware configuration

  • 7x iMX6 Tiny Rex Quad Module
    • 1GHz i.MX6 Quad 1GHz CPU – automotive temperature range (-40°C ~ 125°C)
    • 4x 4Gb DDR3 Memory chips – industrial temperature range (-40°C ~ +95°C)
    • 1GBps Ethernet PHY Tranciever KSZ9031RN – automotive temperature range (-40°C ~ +85°C)
  • 3x i.MX6 Tiny Rex Solo Module
    • 1GHz iMX6 Solo 800MHz CPU – industrial temperature range (-40°C ~ +105°C)
    • 2x 4Gb DDR3 Memory chips – industrial temperature range (-40°C ~ +95°C)
    • 1GBps Ethernet PHY Tranciever KSZ9031RN – automotive temperature range (-40°C ~ +85°C)

The modules were plugged into the standard iMX6 Tiny Rex Baseboard Lite. We used a medium-sized heatsink.

Picture: Our setup in the environmental chamber
iMX6 Tiny Rex Environmental Chamber Testing - Boards

Test description

Three of the QUAD boards were running full peripheral test to check functionality of all the peripherals in different temperature range. Rest of the boards where running CPU and Memory test to check reliability and stability of the memory settings and memory layout (this includes three SOLO boards where two of the four memory chips were not fitted).

Here are our configurations & software description:

  • 3x iMX6 Tiny Rex Quad peripheral stress testing
    • 1 thread of extensive Memory stress test
    • 1 thread of CPU stress test
    • SATA stress test
    • video playing on the X-server via HDMI output
    • copying a file from the first USB stick to SD card and vice versa
    • copying a file from the second USB stick to SATA hard drive and vice versa
    • pinging the host PC via Ethernet
    • all the messages were printed out on the serial console through connected FTDI cable
    • booting from a SATA hard drive
  • 4x iMX6 Tiny Rex Quad Memory stress testing
    • 4 threads of extensive Memory stress test
    • 4 threads of CPU stress test
    • booting from SD card
  • 3x iMX6 Tiny Rex Solo Memory stress testing
    • 1 thread of extensive Memory stress test
    • 1 thread of CPU stress test
    • booting from SD card

Notes: USB sticks and SATA hard drives were place outside of the environmental chamber. All the scripts running during the test and the board setup instructions can be found at the bottom of this page in Appendix : How to prepare the test.

The Results

Picture: Temperature profile during the test
iMX6 Tiny Rex Environmental Chamber Testing - Temperature profile
Running the boards at -40°C and -60°C – PASS

Test description: At -40°C we were running the CPU, Memory and peripheral stress tests. Then we lowered the temperature down to -60°C. All the tested boards were working OK during the whole time. Note: Notice, the Linux running on the QUAD boards incorrectly shows CPU temperature below -40°C (it shows 25 instead).


env-chamber-testing_-60°C


Running the boards at +60°C – PASS

Test description: We increased the ambient temperature (to 60°C, 65°C, 70°C) and we were running the CPU, Memory and peripheral stress tests. We stopped the test when the CPU lowered it’s frequency (it happened when CPU temperature reached 90°C). With our setup, all the boards were running at 60°C. To go higher, we would need to use a bigger heatsink.

env-chamber-testing_+60°C


Temperature stress test – multiple quick temperature change from -60°C to -10°C and back – PASS
Test description: The ambient temperature went from -60°C to -10°C and back to -60°C. The boards were running the CPU, Memory and peripheral stress tests. All the boards were working perfectly.


Switch ON/OFF test – PASS

Test description: At temperatures -40°C and -60°C we switched OFF the boards, left them OFF for 5 minutes (to cool them down) and then switched them ON to see if they boot up with no problems. Once booted up to the Linux, the boards were turned off again. All of the tested boards booted up successfully. Tested 3 times at -40°C and one time at -60°C.

Picture: The setup of the environmental chamber testing.
iMX6 Tiny Rex Environmental Chamber Testing - Setup
Picture: Zoom on the temperature chamber displaying the minimum and maximum temperature (First number shows relative humidity, second one the actual temperature and the last one the dew point).

iMX6 Tiny Rex Environmental Chamber Testing -63°C iMX6 Tiny Rex Environmental Chamber Testing 70°C

Appendix

PC Setup

During the test we used DHCP and FTP servers on our control PC. The PC was also used during ethernet ping test and to control all the boards through SSH sessions + serial console. The control PC was using Windows 7 operating system.

1. Network setup – PC
Disable the firewall (PC will not be connected to the internet) and setup static IP address: Press Windows button -> go to Control Panel -> Network and Internet -> Network and Sharing Center -> Change adapter settings (on the right side in the bar) -> double click on Local Area Connection -> Properties -> In tab Networking go to Internet Protocol Version 4 (TCP/IPv4) -> type the static IP address and subnet mask as shown below:

Static-IP

The iMX6 Tiny Rex boards and Control PC are connected to a Gigabit Ethernet Switch. Connect the PC to the switch and turn the switch on. To be able to download the files from FTP server we need to enable the sharing option first. This can be done by setting up the network as a “work network”. You can change it in Control Panel -> Network and Internet -> Network and Sharing Center -> Click to Choose homegroup and sharing options

PC-network-setup

2. Setting up the TFP and DHCP servers
As TFTP and DHCP server we used Tftpd32 software. For more details about DHCP configuration, see the screenshots below:

DHCP addresses DHCP Setup


3. SSH and Serial console
To control the iMX6 Tiny Rex boards, open TeraTerm serial console and run SSH client to read temperatures. Open one Teraterm and one SSH per board. For the boards with peripheral test, open an extra SSH client to see if any errors occurred.

Serial-console

How to prepare and start the test

1. Boot device & Software
We used different boot device (SATA or SD) for different tests:

  • Peripheral test
    For this setup we used bootloader stored on SD card, U-boot settings are burnt into the SPI Flash. Kernel was downloaded via FTP server and our default Ubuntu filesystem was stored on SATA HDD.
  • Memory test for Quad Module
    Everything on the SD card. We used the same version of software (uBoot, Kernel, Filesystem, …) as in the Peripheral test.
  • Memory test for Solo Module
    Everything on the SD card. For this configuration we used the software dedicated for iMX6 Tiny Rex SOLO version (this U-boot and this Linux).

2. Preparing the SD card for iMX6 Tiny Rex Quad Module
To create a bootable SD card, open Ubuntu 9.04 or 12.04. Insert the SD card into a reader and mount it as a drive. Open a terminal, log in as a root and find where the SD card is located (in our case /dev/sdb). Then create a new partition. Important! Leave some space for bootloader at the beginning of the partition.

# fdisk /dev/sdb
Command (m for help): d
Selected partition 1

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-19165, default 1): 100
Last cylinder, +cylinders or +size{K,M,G} (100-1916)
Using default value 19165

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

Now mount the SD card under Windows. Download cfimager (which is located in Mfgtools supplied by Freescale). Open a command line in the cfimager directory (e.g. w:\WORK\FEDEVEL\iMX6 Rex Module\V1I1\Software\Mfgtools-Rel-4.0.0_130424_MX6Q_UPDATER\Utils\cfimager\). Let assume that the SD card is mounted as a G drive:

> cfimager.exe -raw -offset 0x400 -skip 0x400 -f u-boot.bin -d G
drive = G
removable = no
device block size = 512 bytes
device block count = 0xeccc46

firmware size = 0x27e08 bytes (0x140 blocks)
extra blocks = 1727
Writing firmware...
done!

In the next step, connect SD card back to the Linux machine and format the partition we created before:

# mkfs.ext3 /dev/sdb1

Then copy the kernel and filesystem to the SD card:

# mount /dev/sdb1 /media/sdcard
# cd /media/sdcard
# cp -prv /home/fedevel/tiny-update/imx6tinyrex-linux-3.0.35/arch/arm/boot/uImage .
# tar -pxvzf /home/fedevel/imx6rex-xubuntu-13-04-production-04-AUG-2014.tar

When using SATA hard drive as a filesystem device, use similar commands. Just be aware of the SATA device name – check how it was recognized.

To use Linux kernel from an FTP server and filesystem from SATA you need to setup u-boot commands like this:

setenv ipaddr 192.168.0.150
setenv serverip 192.168.0.80
setenv gatewayip 192.168.0.1
setenv bootdelay '5'
setenv bootargs 'console=ttymxc0,115200'
setenv bootcmd_net 'run bootargs_sata; tftpboot 0x10800000 uImage; bootm 0x10800000'
setenv bootargs_sata 'setenv bootargs ${bootargs} ip=dhcp root=/dev/sda1 rootwait video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB666 vmalloc=400M fbmem=28M fbcon=28M'
setenv bootcmd 'run bootcmd_net'
saveenv

To boot from SD card you can use these settings:

setenv ipaddr 192.168.0.150
setenv serverip 192.168.0.80
setenv gatewayip 192.168.0.1
setenv bootdelay '5'
setenv bootargs 'console=ttymxc0,115200'
setenv bootcmd_mmc 'run bootargs_mmc; mmc dev 0; ext2load mmc 0 0x10800000 uImage 3850776; bootm 0x10800000'
setenv bootargs_mmc 'setenv bootargs ${bootargs} ip=dhcp root=/dev/mmcblk0p1 rootwait video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB666 vmalloc=400M fbmem=28M fbcon=28M'
setenv bootcmd 'run bootcmd_mmc'
saveenv



3. Preparing the SD card for iMX6 Tiny Rex Solo Module
Download this and run the script:

# sudo ./fsl-sdcard-partition.sh -s /dev/sdb

The original filesystem is very simple, we will replace it with our filesytem:

# mount /dev/sdb2 /media/disk
# rm -fr /media/disk/*
# cd /media/disk/
# tar -pxvzf /home/fedevel/imx6rex-xubuntu-13-04-production-04-AUG-2014.tar

All the commands in u-boot should be set correctly by default. After you boot up into the Linux serial console, you may need to setup correct Ethernet device. As a first step you need to list all the devices:

# ifconfig -a
eth3      Link encap:Ethernet  HWaddr 00:0d:15:00:d4:25
          inet6 addr: fe80::20d:15ff:fe00:d425/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:320 (320.0 B)  TX bytes:920 (920.0 B)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  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)

Based on the device which is active, you should add two additional lines to the end of the file /etc/network/interfaces:

# nano /etc/network/interfaces  
 
auto eth3
iface eth3 inet dhcp

Now you can restart the network:

# service networking restart
networking stop/waiting
networking start/running



4. Setup CRON
To be able to check the CPU temperature every minute, we setup a cron job. Before we do so, we need to install postfix package (for Ubuntu file systems):

# sudo apt-get install postfix

To setup a cron tab we will open the file containing all cron jobs. If you run the crontab for the first time you may need to select the text editor.

# sudo crontab -e

Paste following line to the end of this file:

* * * * * { echo -n $(date +\%Y/\%m/\%d-\%T); echo -n "("; echo -n $(date +\%Z); echo -n ") "; cat /sys/devices/virtual/thermal/thermal_zone0/temp; } >> /home/ubuntu/testing-env-chamber/cpu-temp.log

We will use the same time format as stressapptest. We will get the current CPU temperature and save it into the log file. Note: The char ‘%’ has a special purpose in the cron file. When using it in the date command you need to use backslash before the ‘%’.

5. Prepare boards for testing

After the board boots up we need to setup system time. We also would like to backup the old log files and create empty ones for the next measurement. Here you can find a simple script which will help you:

#!/bin/sh

ln -sf /usr/share/zoneinfo/Europe/Bratislava /etc/localtime
date $1

today=`date +%Y-%m-%d.%H:%M`

cd /home/ubuntu/tiny-rex/env-chamber-testing/

mv env-chamber-testing.log env-chamber-testing.log.$today
mv cpu-temp-measuring.log cpu-temp-measuring.log.$today

touch env-chamber-testing.log
touch cpu-temp-measuring.log

Don’t forget to change permissions to be able to run it:

# chmod 777 tiny-rex-test-setup.sh

Then save it and run it. Use time as a parameter (the sequence of digits in this order: mouth day hour minute year – in the example was used 29-July-2015 10:28).

# ./tiny-rex-test-setup.sh 072910282015



6. Show the CPU temperature in SSH
Open one SSH client per board where we will show CPU temperature. We use tail command to show the last part of the log file, which is filled up through the CRON job we setup in previous steps:

# tail -F cpu-temp-measuring.log



7. Error checking during peripheral test
To immediately see if any error occurred during peripheral test, we open a new SSH client and run the following command:

# tail -f env-chamber-testing.log | grep -i "error"



8. Start the stress test

  • Peripheral test
    Before you run the test be sure everything is plugged in. To find out where the devices are mounted you can use:

    # fdisk -l
    

    Now you can run the test. As parameters, use device names in following order: SATA, first USB stick, second USB, SD card. We will also write all the logs into one log file:

    # ./tiny-rex-peripheral-test.sh sda1 sdb1 sdc1 mmcblk0p1 | tee env-chamber-testing.log
    

    Here you can find the complete test:

    #!/bin/sh
    
    # iMX6 Tiny Rex environmental chamber peripheral test
     
    mountDevice() {
      mount /dev/$1 /media/$2
      cat /etc/mtab | grep -F "/dev/$1 /media/$2"
      if [ "$?" -eq "0" ]; then
        echo "$2 mounted"
      else
        echo "$2 not mounted"; exit 2
      fi
    }
     
    # mount devices
    mountDevice $1 sata
    mountDevice $2 usb0
    mountDevice $3 usb1
    mountDevice $4 mmc0
    
    finish_test_now() {
      echo "$(date +\%Y/\%m/\%d-\%T)($(date +\%Z)) Ctrl+C Detected: End of the test"
      $precced=0;
      kill -INT $vid_pid $str_pid $log_pid;
      sleep 6;
      test_status=`cat env-chamber-testing.log | grep -i "error" | grep -v -e "0 errors" -e "no corrected errors"`
      if [ -z "$test_status" ]
      then
        echo "*********\nTEST PASS\n*********"
      else
        echo "*********\nTEST FAIL\n*********\n"
    	echo "List of detected errors:"
    	cat env-chamber-testing.log | grep -i "error" | grep -v -e "0 errors" -e "no corrected errors"
      fi
      exit;
    }
     
    # kill all processes if Ctrl+C is detected
    trap finish_test_now 2
    
     
    # tell the X applications where they should run
    export DISPLAY=:0
     
    # run X window - wait for the process
    service lightdm start
    
    # stressapptest - one thread CPU, one thread memory, sata testing
    stressapptest -f /media/sata/tmp-file1 -s 600000 -M 500 -m 1 -C 1 --printsec 10 &
    str_pid=$!
    echo "$(date +\%Y/\%m/\%d-\%T)($(date +\%Z)) Starting stressapptest with PID: " $str_pid
     
    # play a video file in an infinite loop
    #echo 0 > /sys/class/graphics/fb2/blank
    sudo -u "ubuntu" xfce4-terminal --geometry=90x20+860+10 -x mplayer -vo fbdev2:/dev/fb0 -vf scale -zoom -loop 0 -geometry 1024x768+860+370 /home/ubuntu/Clouds.avi > /dev/null 2>&1 &
    vid_pid=$!
    echo "$(date +\%Y/\%m/\%d-\%T)($(date +\%Z)) Starting video file playback with PID: " $vid_pid
    
    # open window with a log file
    sudo -u "ubuntu" xfce4-terminal --geometry=80x140+10+10 -x tail -F env-chamber-testing.log > /dev/null 2>&1 &
    log_pid=$!
    echo "$(date +\%Y/\%m/\%d-\%T)($(date +\%Z)) Starting printing out the log file with PID: " $log_pid
      
    # top
    #sudo -u "ubuntu" xfce4-terminal --geometry=90x50+900+10 -x top &
     
    proceed=1
    file1="blackbird.wav"
    file2="blackbird2.wav"
    
    cp1_from="/media/mmc0/"
    cp1_to="/media/usb0/"
    
    cp2_from="/home/ubuntu/"
    cp2_to="/media/usb1/"
    
    #copy files in case they are missing
    cp /media/$file1 $cp1_from$file1
    cp /media/$file1 $cp1_to$file1
    cp /media/$file2 $cp2_from$file2
    cp /media/$file2 $cp2_to$file2
     
    while [ $proceed -eq 1 ]
    do
    
      ping -q -c1 192.168.0.2 >> env-chamber-testing.log
      if [ $? -ne 0 ]
      then
    	echo "$(date +\%Y/\%m/\%d-\%T)($(date +\%Z)) ERROR: Ping failed"
      fi
     
      cp1_done=`ps cax | grep $cp1_pid | grep cp`
      if [ -z "$cp1_done" ]; then # copy finished
        if cmp -s $cp1_from$file1 $cp1_to$file1; then
          echo "$(date +\%Y/\%m/\%d-\%T)($(date +\%Z)) PASS: Copying file from $cp1_from to $cp1_to successful"
        else
          echo "$(date +\%Y/\%m/\%d-\%T)($(date +\%Z)) ERROR: Difference between files on $cp1_from and $cp1_to detected"
        fi
    	cp1_temp=$cp1_from # swap destinations
    	cp1_from=$cp1_to
    	cp1_to=$cp1_temp
    	
    	rm $cp1_to$file1 # remove destination file
    	
        cp $cp1_from$file1 $cp1_to$file1 &
        cp1_pid=$!
        echo "$(date +\%Y/\%m/\%d-\%T)($(date +\%Z)) Started copying file from $cp1_from to $cp1_to"
      fi
      
      cp2_done=`ps cax | grep $cp2_pid | grep cp`
      if [ -z "$cp2_done" ]; then # copy finished
        if cmp -s $cp2_from$file2 $cp2_to$file2; then
          echo "$(date +\%Y/\%m/\%d-\%T)($(date +\%Z)) PASS: Copying file from $cp2_from to $cp2_to successful"
        else
          echo "$(date +\%Y/\%m/\%d-\%T)($(date +\%Z)) ERROR: Difference between files on $cp2_from and $cp2_to detected"
        fi
        cp2_temp=$cp2_from # swap destinations
    	cp2_from=$cp2_to
    	cp2_to=$cp2_temp
    	
    	rm $cp2_to$file2 # remove destination file
    	
        cp $cp2_from$file2 $cp2_to$file2 &
        cp2_pid=$!
        echo "$(date +\%Y/\%m/\%d-\%T)($(date +\%Z)) Started copying file from $cp2_from to $cp2_to"
      fi
    
    done
    
  • Quad Memory testing
    For Quad testing run stressapptest with these parameters:

    #stressapptest -s 600000 -M 1000 -m 4 -C 4 -W -l /home/ubuntu/testing-network/stressapptest.log
    
  • Solo Memory testing
    You can use stressapptest with these parameters:

    #stressapptest -s 600000 -M 768 -m 1 -C 1 -W -l /home/ubuntu/testing-network/stressapptest.log