Difference between revisions of "iMX6 TinyRex EMC testing"

From Voipac Wiki
Jump to navigation Jump to search
Line 77: Line 77:
 
|}
 
|}
  
 +
=== iMX6 TinyRex Development kit Max bare board with SATA hard drive - PASS ===
 +
Test description:
 +
* stressapptest for CPU and memory
 +
* Ethernet loopback
 +
* running heavy testing script for USB and SD card read/write test
 +
* HDMI input and output both tested with 720p video stream
 +
* Ethernet SSH session
  
 +
This test also included SATA interface by stress testing connected SATA drive. During this test HDMI loopback option was used.<br /><br />
 +
 +
These results shows that iMX6 TinyRex Development kit complies with stricter regulation even if no enclosure is used.<br /><br />
 +
[[image:iMX6_TinyRex_Development_kit-EMC-Testing_Bare_board_with_SATA.jpg|800px]]<br /><br />
  
==== Heavy testing - PASS ====
 
 
{|style="text-align:center;"
 
{|style="text-align:center;"
| style="width: 47%;" |Vertical polarization
+
| style="width: 47%;" |'''Vertical polarization'''
 
| style="width: 6%;" |<br />
 
| style="width: 6%;" |<br />
| style="width: 47%;" |Horizontal polarization
+
| style="width: 47%;" |'''Horizontal polarization'''
 
|-
 
|-
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_kit-EMC_results-Heavy_loaded_vertical.jpg|370px]]
+
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_kit_Max_with_SATA-EMC-RE_30MHz-1GHz_Ver_Pol.jpg|370px]]<br /><br />
 
|<br />
 
|<br />
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_kit-EMC_results-Heavy_loaded_horizontal.jpg|370px]]
+
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_kit_Max_with_SATA-EMC-RE_30MHz-1GHz_Hor_Pol.jpg|370px]]<br /><br />
 +
|-
 +
|colspan="3"|iMX6 TinyRex Development kit Max with SATA: 30kHZ - 1GHz
 +
|}
 +
<br />
 +
{|style="text-align:center;"
 +
| style="width: 47%;" |'''Vertical polarization'''
 +
| style="width: 6%;" |<br />
 +
| style="width: 47%;" |'''Horizontal polarization'''
 +
|-
 +
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_kit_Max_with_SATA-EMC-RE_1GHz-4GHz_Ver_Pol.jpg|370px]]<br /><br />
 +
|<br />
 +
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_kit_Max_with_SATA-EMC-RE_1GHz-4GHz_Hor_Pol.jpg|370px]]<br /><br />
 +
|-
 +
|colspan="3"|iMX6 TinyRex Development kit Max with SATA: 1GHz - 4GHz
 
|}
 
|}
  
=== Conducted emission ===
+
=== iMX6 TinyRex Development kit Pro with enclosure - PASS ===
 +
Test description:
 +
* stressapptest for CPU and memory
 +
* Ethernet loopback
 +
* running heavy testing script for USB and SD card read/write test
 +
* HDMI input and output both tested with 720p video stream (loopback)
 +
* Ethernet SSH session
 +
<br /><br />
 +
[[image:iMX6_TinyRex_Development_kit-EMC-HDMI_loopback.jpg|800px]]<br /><br />
  
==== Heavy testing - PASS ====
 
The Development kit was powered by [https://uk.farnell.com/xp-power/ver36us120-ja/adaptor-ac-dc-12v-3a/dp/2646341?rpsku=rel3%3AVEP36US12&st=vep36us12 VER Series] AC/DC Adaptor during the tests.
 
 
{|style="text-align:center;"
 
{|style="text-align:center;"
| style="width: 47%;" |Vertical polarization
+
| style="width: 47%;" |'''Vertical polarization'''
 +
| style="width: 6%;" |<br />
 +
| style="width: 47%;" |'''Horizontal polarization'''
 +
|-
 +
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_kit_Pro-EMC-RE_30MHz-1GHz_Ver_Pol.jpg|370px]]<br /><br />
 +
|<br />
 +
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_kit_Pro-EMC-RE_30MHz-1GHz_Hor_Pol.jpg|370px]]<br /><br />
 +
|-
 +
|colspan="3"|iMX6 TinyRex Development kit Pro: 30kHZ - 1GHz
 +
|}
 +
<br />
 +
{|style="text-align:center;"
 +
| style="width: 47%;" |'''Vertical polarization'''
 
| style="width: 6%;" |<br />
 
| style="width: 6%;" |<br />
| style="width: 47%;" |Horizontal polarization
+
| style="width: 47%;" |'''Horizontal polarization'''
 
|-
 
|-
|style="width:396px; border:1px solid black;" |[[image:iMX6_TinyRex_Development_kit-EMC_radiated_emmision_power_cable_L.jpg|370px|link=http://downloads.voipac.com/files/iMX6_TinyRex_Development_kit/module/documents/EMC_conducted_emission/iMX6_TinyRex_Development_kit-Conducted_Emission_E022EL.pdf]]
+
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_kit_Pro-EMC-RE_1GHz-4GHz_Ver_Pol.jpg|370px]]<br /><br />
 
|<br />
 
|<br />
|style="width:396px; border:1px solid black;" |[[image:iMX6_TinyRex_Development_kit-EMC_radiated_emmision_power_cable_N.jpg|370px|link=http://downloads.voipac.com/files/iMX6_TinyRex_Development_kit/module/documents/EMC_conducted_emission/iMX6_TinyRex_Development_kit-Conducted_Emission_E022EN.pdf]]
+
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_kit_Pro-EMC-RE_1GHz-4GHz_Hor_Pol.jpg|370px]]<br /><br />
 +
|-
 +
|colspan="3"|iMX6 TinyRex Development kit Pro: 1GHz - 4GHz
 +
|}
 +
 
 +
 
 +
=== iMX6 TinyRex Development kit Basic with enclosure - PASS ===
 +
Test description:
 +
* stressapptest for CPU and memory
 +
* Ethernet loopback
 +
* running heavy testing script for USB and SD card read/write test
 +
* HDMI input and output both tested with 720p video stream (loopback)
 +
* Ethernet SSH session
 +
<br /><br />
 +
[[image:iMX6_TinyRex_Development_kit-EMC-HDMI_loopback.jpg|800px]]<br /><br />
 +
 
 +
{|style="text-align:center;"
 +
| style="width: 47%;" |'''Vertical polarization'''
 +
| style="width: 6%;" |<br />
 +
| style="width: 47%;" |'''Horizontal polarization'''
 +
|-
 +
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_kit_Basic-EMC-RE_30MHz-1GHz_Ver_Pol.jpg|370px]]<br /><br />
 +
|<br />
 +
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_kit_Basic-EMC-RE_30MHz-1GHz_Hor_Pol.jpg|370px]]<br /><br />
 +
|-
 +
|colspan="3"|iMX6 TinyRex Development kit Basic: 30kHZ - 1GHz
 +
|}
 +
<br />
 +
{|style="text-align:center;"
 +
| style="width: 47%;" |'''Vertical polarization'''
 +
| style="width: 6%;" |<br />
 +
| style="width: 47%;" |'''Horizontal polarization'''
 +
|-
 +
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_kit_Basic-EMC-RE_1GHz-4GHz_Ver_Pol.jpg|370px]]<br /><br />
 +
|<br />
 +
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_kit_Basic-EMC-RE_1GHz-4GHz_Hor_Pol.jpg|370px]]<br /><br />
 +
|-
 +
|colspan="3"|iMX6 TinyRex Development kit Basic: 1GHz - 4GHz
 
|}
 
|}
  
 
== Preparing the test ==
 
== Preparing the test ==
=== SD card setup ===
+
=== Boot device and software ===
[http://downloads.voipac.com/files/iMX6_TinyRex_Development_kit/module/software/linux/binaries/old/imx6TinyRex-uImage-gpu-en-audio-fix-03-APR-2014 Linux 4.1] kernel was used for this test. Modified Xubuntu filesystem can be accessed from [http://downloads.voipac.com/files/iMX6_TinyRex_Development_kit/module/software/filesystem/filesystem_download.txt here]. To create a new SD card, [[iMX6 TinyRex Pro Creating Bootable microSD Card|these instructions]] can be followed.
+
SD card was selected as a booting device for all the boards. U-boot settings were not adjusted as the default configuration was used. The only change compared to standard software package was running a multimedia filesystem. To prepare a fresh SD card follow [[iMX6 TinyRex Max Creating Bootable microSD Card|these instructions]]. Here is an example of creating a SD card suitable for Max configuration:
 +
<syntaxhighlight lang="bash">
 +
git clone https://github.com/voipac/imx6tinyrex_bin_linux
 +
cd imx6tinyrex_bin_linux/
 +
sudo ./fsl-sdcard-partition.sh -max /dev/mmcblk0
 +
</syntaxhighlight>
  
=== Set booting parameters ===
+
=== Downloading stress test ===
SD card inserted into the edge SD slot will be used as a filesystem device. Following U-Boot commands enable SD card booting and set up other parameters:
+
Stressapptest package was selected to check CPU and memory integrity. Placing this file into the same directory where the testing script will be stored is important:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
setenv bootargs_mmc 'setenv bootargs ${bootargs} ip=192.168.10.91:::255.255.255.0 root=/dev/mmcblk1p1 rootwait video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB666 vmalloc=400M fbmem=28M fbcon=28M'
+
wget http://downloads.voipac.com/files/iMX6_TinyRex_Development_kit/module/documents/EMC_radiated_emission/stressapptest
setenv bootcmd_mmc 'run bootargs_mmc ; mmc dev 1; ext2load mmc 1 0x10800000 imx6TinyRex-uImage-gpu-en-audio-fix-03-APR-2014 3915972; bootm 0x10800000'
+
</syntaxhighlight>
saveenv
+
 
</syntaxhighlight>
+
=== Starting DHCP server ===
 +
The board was mainly operated through SSH sessions. Thus it is very useful to have the same IP address all the time. The easiest way to do so is to run [[iMX6_TinyRex_Environmental_chamber_testing#Setting_up_the_TFTP_and_DHCP_servers|DHCP server]] on your controlling computer:
 +
{|
 +
|[[image:iMX6_TinyRex_Development_kit-Env_chamber-DHCP_settings.jpg|356px]]
 +
|[[image:iMX6_TinyRex_Development_kit-Env_chamber-DHCP_control.jpg|419px]]
 +
|}
  
=== Running tests ===
+
=== Preserving SSH session ===
Test scripts are displayed in the section [[#Test scripts|below]] or can be downloaded: [http://downloads.voipac.com/files/iMX6_TinyRex_Development_kit/module/documents/EMC_radiated_emission/iMX6_TinyRex_Development_kit-EMC_standard_test.sh Standard test] or [http://downloads.voipac.com/files/iMX6_TinyRex_Development_kit/module/documents/EMC_radiated_emission/iMX6_TinyRex_Development_kit-EMC_heavy_test.sh Heavy test].<br /><br />
+
To minimize the possiblity of affecting the results, the control computer was disconnected and taken outside of the test chamber (after the board was setup).<br /><br />
  
Locations of mounted devices are used as script parameters (without ''/dev/'' prefix). The command to start the test has this structure:
+
When Ethernet cable connected to PC is unplugged, all the processes started within SSH sessions are terminated by default. [https://www.gnu.org/software/screen/manual/screen.html ''Screen''] command allows to keep these sessions running. This command allow tasks to continue even if the cable is unplugged (and Ethernet loopback is plugged right away). It is important to make sure the filesystem includes this command:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
./name-of-the-test.sh SATA_DIR USB0_DIR USB1_DIR MMC0_DIR
+
sudo apt-get install screen
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Running the standard test:
+
=== Running the script ===
 +
Plug the board into mains and connect to it with SSH session. Command screen is called:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
./emc-test1.sh sda1 sdb1 sdc1 mmcblk0p1
+
screen -S tinyrex
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Running the heavy test:
+
Testing scripts command consists of following arguments
 +
* first parameter - version of tested board (-max, -pro or -basic)
 +
* second parameter - selects if and how SATA interface will be tested (only copy test: -sata_cp, stresstest: -sata_stress)
 +
* third parameter - USB drive 1 location
 +
* fourth parameter - USB drive 2 location
 +
* fifth parameter - SD card location
 +
* sixth parameter (if connected) - SATA drive location
 +
 
 +
Down below several commands are shown which were used during EMC testing:
 +
* iMX6 TinyRex Development kit Max with SATA stresstesting:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
./emc-test-all.sh sda1 sdb1 sdc1 mmcblk0p1
+
./imx6-tinyrex-emc-test.sh -max -sata_stress sdb1 sdc1 mmcblk2p2 sda2 | tee -i trx-emc-testing.log
 
</syntaxhighlight>
 
</syntaxhighlight>
 
+
* iMX6 TinyRex Development kit Pro with SATA copying file from/to USB drive:
To locate directories where the devices are mapped, ''"fdisk -l"'' command can be useful:
+
<syntaxhighlight lang="bash">
 +
./imx6-tinyrex-emc-test.sh -pro -sata_cp sdb1 sdc1 mmcblk2p2 sda2 | tee -i trx-emc-testing.log
 +
</syntaxhighlight>
 +
* iMX6 TinyRex Development kit Basic:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
fdisk -l
+
./imx6-tinyrex-emc-test.sh -basic -n sda1 sdb1 mmcblk2p2 | tee -i trx-emc-testing.log
 
Disk /dev/sda: 7998 MB, 7998455808 bytes
 
108 heads, 63 sectors/track, 2296 cylinders, total 15621984 sectors
 
Units = sectors of 1 * 512 = 512 bytes
 
Sector size (logical/physical): 512 bytes / 512 bytes
 
I/O size (minimum/optimal): 512 bytes / 512 bytes
 
Disk identifier: 0x001c2022
 
 
  Device Boot      Start        End      Blocks  Id  System
 
/dev/sda1           2048    15621983    7809968  83  Linux
 
 
Disk /dev/mmcblk0: 3904 MB, 3904897024 bytes
 
4 heads, 16 sectors/track, 119168 cylinders, total 7626752 sectors
 
Units = sectors of 1 * 512 = 512 bytes
 
Sector size (logical/physical): 512 bytes / 512 bytes
 
I/O size (minimum/optimal): 512 bytes / 512 bytes
 
Disk identifier: 0xc44e7f69
 
 
        Device Boot      Start        End      Blocks  Id  System
 
/dev/mmcblk0p1            2048    7626751    3812352  83  Linux
 
 
Disk /dev/mmcblk1: 1977 MB, 1977614336 bytes
 
61 heads, 62 sectors/track, 1021 cylinders, total 3862528 sectors
 
Units = sectors of 1 * 512 = 512 bytes
 
Sector size (logical/physical): 512 bytes / 512 bytes
 
I/O size (minimum/optimal): 512 bytes / 512 bytes
 
Disk identifier: 0x00000000
 
 
        Device Boot      Start        End      Blocks  Id  System
 
/dev/mmcblk1p1              62    3861421    1930680  83  Linux
 
 
Disk /dev/sdb: 16.2 GB, 16219373568 bytes
 
256 heads, 48 sectors/track, 2578 cylinders, total 31678464 sectors
 
Units = sectors of 1 * 512 = 512 bytes
 
Sector size (logical/physical): 512 bytes / 512 bytes
 
I/O size (minimum/optimal): 512 bytes / 512 bytes
 
Disk identifier: 0xc3072e18
 
 
  Device Boot      Start        End      Blocks  Id  System
 
/dev/sdb1             48    7372799    3686376    6  FAT16
 
 
Disk /dev/sdc: 16.0 GB, 16008609792 bytes
 
255 heads, 63 sectors/track, 1946 cylinders, total 31266816 sectors
 
Units = sectors of 1 * 512 = 512 bytes
 
Sector size (logical/physical): 512 bytes / 512 bytes
 
I/O size (minimum/optimal): 512 bytes / 512 bytes
 
Disk identifier: 0x00000000
 
 
  Device Boot      Start        End      Blocks  Id  System
 
/dev/sdc1              32    31266815    15633392    c  W95 FAT32 (LBA)
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
'''''Note:''''' In the example above the device /dev/mmcblk1p1 is a filesystem device. This SD card is tested by running the operating system.
+
The complete script can be found in [http://downloads.voipac.com/files/iMX6_TinyRex_Development_kit/module/documents/EMC_radiated_emission/imx6-tinyrex-emc-test.sh the download section] or down below:
 
 
=== Test scripts ===
 
==== Standard test script ====
 
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
#!/bin/sh
 
#!/bin/sh
 +
 +
# TinyRex EMC testing script
 
   
 
   
 
mountDevice() {
 
mountDevice() {
Line 205: Line 256:
 
   fi
 
   fi
 
}
 
}
 +
# prepare files
 +
cd ~
 +
mkdir -p emc-testing/
 +
cd emc-testing/
 +
touch trx-emc-testing.log
 
   
 
   
# mount devices a test a status
+
echo '\033[9;0]' > /dev/tty1 # disable blanking the display
mountDevice $1 sata
 
mountDevice $2 usb0
 
mountDevice $3 usb1
 
mountDevice $4 mmc0
 
 
   
 
   
# tell the X applications where they should run
+
tinybasic=0
export DISPLAY=:0
+
tinypro=0
 +
tinymax=0
 +
case $1 in
 +
  -basic)  tinybasic=1 ;;
 +
  -pro)  tinypro=1 ;;
 +
  -max)  tinymax=1 ;;
 +
  *)
 +
esac
 
   
 
   
# run X window - wait for the procces
+
imx6_sata_cp=0
service lightdm start
+
imx6_sata_stress=0
 +
case $2 in
 +
  -sata_cp) imx6_sata_cp=1 ;;
 +
  -sata_stress) imx6_sata_stress=1 ;;
 +
  *)
 +
esac
 
   
 
   
# connect ethernet loopback and force the ethernet to 100Mbit
+
# mount devices
mii-tool -F 100baseTx-HD
+
mountDevice $3 usb0
 +
mountDevice $4 usb1
 +
mountDevice $5 mmc0
 +
if [ "${imx6_sata_cp}" -eq "1" ] || [ "${imx6_sata_stress}" -eq "1" ]; then
 +
  mountDevice $5 sata
 +
fi
 
   
 
   
# play a video file in an infinite loop
+
updateLogFiles() {
echo 0 > /sys/class/graphics/fb2/blank
+
  currentTime=`date +%Y-%m-%d.%H_%M`
sudo -u "ubuntu" xfce4-terminal --geometry=70x20+100+10 -x mplayer -vo fbdev2:/dev/fb2 -vf scale -zoom -loop 0 -xy 1024 /home/ubuntu/Clou$
+
  mv trx-emc-testing.log trx-emc-testing.log.$currentTime
+
}
# ping
 
sudo -u "ubuntu" xfce4-terminal --geometry=70x25+100+600 -x ping 192.168.10.1 &
 
 
# top
 
sudo -u "ubuntu" xfce4-terminal --geometry=90x50+900+10 -x top &
 
 
proceed=1
 
file1="blackbird.wav"
 
 
while [ $proceed -eq 1 ]
 
do
 
 
  cp1_done=`ps cax | grep $cp1_pid | grep cp`
 
  if [ -z "$cp1_done" ]; then # run cp only if previous cp is done
 
    cp /media/usb0/$file1 /media/sata &
 
    cp1_pid=$!
 
    echo "started cp from usb0 to sata"
 
  fi
 
 
   
 
   
  cp2_done=`ps cax | grep $cp2_pid | grep cp`
+
finish_test_now() {
   if [ -z "$cp2_done" ]; then # run cp only if previous cp is done
+
   echo "$(date +\%Y/\%m/\%d-\%T)($(date +\%Z)) Ctrl+C Detected: End of the test"
    cp /media/usb1/$file1 /media/mmc0 &
+
   precced=0;
    cp2_pid=$!
+
   #kill -INT $vid_pid $str_pid $ping_pid;
    echo "started cp from usb1 to mmc0"
+
  sleep 3;
   fi
+
  test_status=`cat trx-emc-testing.log | grep -i "error" | grep -v -e "0 errors" -e "no corrected errors"`
+
   if [ -z "$test_status" ]
  aud_done=`ps cax | grep $aud_pid | grep aplay`
+
  then
  if [ -z "$aud_done" ]; then
+
  echo "$(date +\%Y/\%m/\%d-\%T)($(date +\%Z)) PASS - Script ended without detected errors."
    aplay -D hw:0,0 /home/ubuntu/blackbird.wav &
 
    aud_pid=$!
 
    echo "started play audio"
 
   fi
 
 
done
 
 
# kill all procceses if Ctrl+C detected
 
trap '$precced=0; kill $cp1_pid $cp2_pid &aud_pid;' 2
 
sleep 10000
 
</syntaxhighlight>
 
 
 
==== Heavy test script ====
 
<syntaxhighlight lang="bash">
 
#!/bin/sh
 
 
mountDevice() {
 
  mount /dev/$1 /media/$2
 
  cat /etc/mtab | grep -F "/dev/$1 /media/$2"
 
   if [ "$?" -eq "0" ]; then
 
    echo "$2 mounted"
 
 
   else
 
   else
    echo "$2 not mounted"; exit 2
+
  cat trx-emc-testing.log | grep -i "error" | grep -v -e "0 errors" -e "no corrected errors" -e "List of detected errors:"
 
   fi
 
   fi
 +
  updateLogFiles
 +
  exit;
 
}
 
}
 
   
 
   
# mount devices a test a status
+
# kill all processes if Ctrl+C is detected
mountDevice $1 sata
+
trap finish_test_now 2
mountDevice $2 usb0
 
mountDevice $3 usb1
 
mountDevice $4 mmc0
 
 
   
 
   
# tell the X applications where they should run
+
# connect ethernet loopback and force the ethernet to 100Mbit
export DISPLAY=:0
+
ethtool -s eth0 speed 100 autoneg off
 
   
 
   
# run X windows - wait for the procces
+
# play a video stream from HDMI input - testing also HDMI output
service lightdm start
+
gst-launch -q imxv4l2src ! autovideosink &
 
   
 
   
# connect Ethernet loopback and force the ethernet to 100Mbit
+
# stressapptest - one thread CPU, one thread memory
mii-tool -F 100baseTx-HD
+
if [ "${tinybasic}" -eq "1" ]; then
 +
  ./stressapptest -s 600000 -M 100 -m 1 -C 1 --printsec 10 &
 +
  str_pid=$!
 +
fi
 +
if [ "${tinypro}" -eq "1" ] && [ "${imx6_sata_stress}" -eq "1" ]; then
 +
  ./stressapptest -s 600000 -M 200 -m 1 -C 1 --printsec 10 &
 +
  str_pid=$!
 +
else
 +
  ./stressapptest -f /media/sata/tmp-file1 -s 600000 -M 200 -m 1 -C 1 --printsec 10 &
 +
  str_pid=$!
 +
fi
 +
if [ "${tinymax}" -eq "1" ] && [ "${imx6_sata_stress}" -eq "1" ]; then
 +
  ./stressapptest -f /media/sata/tmp-file1 -s 600000 -M 500 -m 1 -C 1 --printsec 10 &
 +
  str_pid=$!
 +
else
 +
  ./stressapptest -s 600000 -M 500 -m 1 -C 1 --printsec 10 &
 +
  str_pid=$!
 +
fi
 
   
 
   
# gpu test
+
echo "$(date +\%Y/\%m/\%d-\%T)($(date +\%Z)) Starting stressapptest with PID: " $str_pid
cd /root/gpu-viv-bin-mx6q-3.10.9-1.0.0-hfp/opt/viv_samples/vdk
 
./tutorial7 &
 
gpu_pid=$!
 
cd
 
 
   
 
   
# play a video file on the lvds display
+
ping 192.168.0.160 &
echo 0 > /sys/class/graphics/fb2/blank
+
ping_pid=$!
mplayer -vo fbdev2:/dev/fb2 -vf scale -zoom -loop 0 -xy 1024 -really-quiet /home/ubuntu/Clouds.avi &
+
echo "$(date +\%Y/\%m/\%d-\%T)($(date +\%Z)) Starting ping: " $ping_pid
vid_pid=$!
 
 
   
 
   
# stressapptest - testing sata, 2x usb, sd card, 1 thread CPU, 1 thread memory
+
proceed=1
stressapptest  -f /media/sata/tmp-file1 -f /media/usb0/tmp-file1 -f /media/usb1/tmp-file1 -f /media/mmc0/tmp-file1  -s 600000 -M 50 -m 1 $
+
file1="blackbird.wav"
str_pid=$!
+
file2="blackbird2.wav"
echo "Stressapptest: " $str_pid
 
 
   
 
   
# play a audio file
+
cp1_from="/media/mmc0/"
mplayer -loop 0 -really-quiet /home/ubuntu/blackbird.wav &
+
cp1_to="/media/usb0/"
aud_pid=$!
 
 
   
 
   
# ping
+
if [ "${imx6_sata_cp}" -eq "1" ] || [ "${imx6_sata_stress}" -eq "1" ]; then
ping 192.168.10.1 &
+
  cp2_from="/media/sata/"
ping_pid=$!
+
  cp2_to="/media/usb1/"
 +
else
 +
  cp2_from="/media/mmc0/"
 +
  cp2_to="/media/usb1/"
 +
fi
 
   
 
   
# top
+
#copy files in case they are missing
top
+
cp /media/$file1 $cp1_from$file1
top_pid=$!
+
cp /media/$file1 $cp1_to$file1
 +
cp /media/$file2 $cp2_from$file2
 +
cp /media/$file2 $cp2_to$file2
 
   
 
   
 +
while [ $proceed -eq 1 ]
 +
do
 
   
 
   
# kill all procceses if Ctrl+C detected
+
  cp1_done=`ps | grep $cp1_pid | grep cp`
trap '$procced=0; kill $gpu_pid $vid_pid $aud_pid $str_pid $ping_pid;' 2
+
  if [ -z "$cp1_done" ]; then # copy finished
sleep 10000
+
    if cmp -s $cp1_from$file1 $cp1_to$file1; then
</syntaxhighlight>
+
      echo "$(date +\%Y/\%m/\%d-\%T)($(date +\%Z)) PASS: Copying file from $cp1_from to $cp1_to successful"
 
+
    else
'''''Note:''''' If the LVDS monitor is not included in the setup, these lines need to be comment out:
+
      echo "$(date +\%Y/\%m/\%d-\%T)($(date +\%Z)) ERROR: Difference between files on $cp1_from and $cp1_to detected"
<syntaxhighlight lang="bash">
+
    fi
# echo 0 > /sys/class/graphics/fb2/blank
+
    cp1_temp=$cp1_from # swap destinations
# mplayer -vo fbdev2:/dev/fb2 -vf scale -zoom -loop 0 -xy 1024 -really-quiet /home/ubuntu/Clouds.avi &
+
    cp1_from=$cp1_to
</syntaxhighlight>
+
    cp1_to=$cp1_temp
 
+
     
To disable LVDS Interface, following command is required:
+
    rm $cp1_to$file1 # remove destination file
<syntaxhighlight lang="bash">
+
     
echo 1 > /sys/class/graphics/fb2/blank
+
    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 | 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
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
<br />
 
<br />
The original article can be accessed on the [http://www.imx6TinyRex.com/software/emc-test/ iMX6TinyRex.com website].
+
The original article can be accessed on the [https://www.imx6rex.com/imx6-tiny-rex/software/imx6-tinyrex-production-emc-testing/ iMX6TinyRex.com website].

Revision as of 09:00, 24 April 2021

Electromagnetic compatibility results for iMX6 TinyRex Development kit are shown on this page. Test setup and scripts are described in details.

These measurement were performed with boards using the actual hardware and software configuration of the web shop development kits.

Connected cables/devices

  • Power jack: +5V power supply was used for input voltage
  • SD card (Sandisk): preloaded with filesystem, used for booting and for read/write test
  • Ethernet: 1 meter 1m CAT Ethernet loopback cable connected. Forced to 100Mb and used for ping test
  • one of these two HDMI options was used:
    • HDMI loopback: when HDMI input is tested using loopback connection, HDMI input is connected to its HDMI output via a shielded 1 meter long HDMI micro to HDMI cable
    • HDMI input source and monitor used: a video source (played by another iMX6 TinyRex Development kit) is plugged into HDMI input using HDMI Micro cable. HDMI Output signal is connected to monitor through 1.8m HDMI cable, monitor is plugged into mains but not turned on. Both monitor and the second iMX6 TinyRex board lay flat on the floor to minimize its affect on results
  • 2x USB flash drive: each connected through a 2m extension cable. Both used during read/write test
  • SATA hard drive: used for read/write testing. The hard drive was placed alongside the tested board. SATA disk was not part of all the test setups (as per results below)
  • Wifi PCIE mini card: inserted, but not actively used. No antennas connected
  • Debug cable: FTDI TTL-3V3 UART to USB cable, used only to setup the board, not used and not plugged in during the measurements

800px

Test description

The main purpose of testing was to measure Radiated emission of iMX6 TinyRex Development kit performing under heavy load. Following tests were running during the measurement:

  • CPU stress test
  • Memory stress test
  • HDMI input (receiving a 720p 3Mbps video stream)
  • HDMI output (received HDMI stream is forwarded to HDMI output)
  • SD card test (read & write)
  • SATA stress test (read & write) (if applicable)
  • Ethernet ping (and Ethernet SSH session)

Results

All the results were measured in compliance with the emission limits for FCC Class B (EMC standard EN 55022B). Class B devices are suitable for both residential and industrial applications as the norm standards use more restrictive limits.

Graph description

Lower band 30kHz - 1 GHz

Radiated emission are measured and displayed as quasi-peak values. This relation is represented as a blue curve in the measurements. Class B limits are shown by red highlighted line 22F3M_B.

Higher band 1 GHz - 4GHz

Two plots displaying the power density are used to show results in higher bands. Similar to lower frequencies a blue curve represents quasi-peak values. Class B limits applied for quasi-peak measurements is plotted as the higher placed red line 22F_P_B.

Black curve depicts average-power values. Threshold for average-power measurement is shown with the lower placed limit line called 22F_AV_B.

iMX6 TinyRex Development kit Max with enclosure - PASS

Test description:

  • stressapptest for CPU and memory
  • Ethernet loopback
  • running heavy testing script for USB and SD card read/write test
  • HDMI input and output both tested with 720p video stream
  • Ethernet SSH session

This setup used HDMI option with separate video input source and monitor. Both the board and monitor were placed on the floor to minimize its effects. The power source was hidden inside the chamber tunnel under the testing table.

800px

Vertical polarization
Horizontal polarization

370px



370px

iMX6 TinyRex Development kit Max: 30kHZ - 1GHz


Vertical polarization
Horizontal polarization

370px



370px

iMX6 TinyRex Development kit Max: 1GHz - 4GHz

iMX6 TinyRex Development kit Max bare board with SATA hard drive - PASS

Test description:

  • stressapptest for CPU and memory
  • Ethernet loopback
  • running heavy testing script for USB and SD card read/write test
  • HDMI input and output both tested with 720p video stream
  • Ethernet SSH session

This test also included SATA interface by stress testing connected SATA drive. During this test HDMI loopback option was used.

These results shows that iMX6 TinyRex Development kit complies with stricter regulation even if no enclosure is used.

800px

Vertical polarization
Horizontal polarization

370px



370px

iMX6 TinyRex Development kit Max with SATA: 30kHZ - 1GHz


Vertical polarization
Horizontal polarization

370px



370px

iMX6 TinyRex Development kit Max with SATA: 1GHz - 4GHz

iMX6 TinyRex Development kit Pro with enclosure - PASS

Test description:

  • stressapptest for CPU and memory
  • Ethernet loopback
  • running heavy testing script for USB and SD card read/write test
  • HDMI input and output both tested with 720p video stream (loopback)
  • Ethernet SSH session



800px

Vertical polarization
Horizontal polarization

370px



370px

iMX6 TinyRex Development kit Pro: 30kHZ - 1GHz


Vertical polarization
Horizontal polarization

370px



370px

iMX6 TinyRex Development kit Pro: 1GHz - 4GHz


iMX6 TinyRex Development kit Basic with enclosure - PASS

Test description:

  • stressapptest for CPU and memory
  • Ethernet loopback
  • running heavy testing script for USB and SD card read/write test
  • HDMI input and output both tested with 720p video stream (loopback)
  • Ethernet SSH session



800px

Vertical polarization
Horizontal polarization

370px



370px

iMX6 TinyRex Development kit Basic: 30kHZ - 1GHz


Vertical polarization
Horizontal polarization

370px



370px

iMX6 TinyRex Development kit Basic: 1GHz - 4GHz

Preparing the test

Boot device and software

SD card was selected as a booting device for all the boards. U-boot settings were not adjusted as the default configuration was used. The only change compared to standard software package was running a multimedia filesystem. To prepare a fresh SD card follow these instructions. Here is an example of creating a SD card suitable for Max configuration:

git clone https://github.com/voipac/imx6tinyrex_bin_linux
cd imx6tinyrex_bin_linux/
sudo ./fsl-sdcard-partition.sh -max /dev/mmcblk0

Downloading stress test

Stressapptest package was selected to check CPU and memory integrity. Placing this file into the same directory where the testing script will be stored is important:

wget http://downloads.voipac.com/files/iMX6_TinyRex_Development_kit/module/documents/EMC_radiated_emission/stressapptest

Starting DHCP server

The board was mainly operated through SSH sessions. Thus it is very useful to have the same IP address all the time. The easiest way to do so is to run DHCP server on your controlling computer:

356px 419px

Preserving SSH session

To minimize the possiblity of affecting the results, the control computer was disconnected and taken outside of the test chamber (after the board was setup).

When Ethernet cable connected to PC is unplugged, all the processes started within SSH sessions are terminated by default. Screen command allows to keep these sessions running. This command allow tasks to continue even if the cable is unplugged (and Ethernet loopback is plugged right away). It is important to make sure the filesystem includes this command:

sudo apt-get install screen

Running the script

Plug the board into mains and connect to it with SSH session. Command screen is called:

screen -S tinyrex

Testing scripts command consists of following arguments

  • first parameter - version of tested board (-max, -pro or -basic)
  • second parameter - selects if and how SATA interface will be tested (only copy test: -sata_cp, stresstest: -sata_stress)
  • third parameter - USB drive 1 location
  • fourth parameter - USB drive 2 location
  • fifth parameter - SD card location
  • sixth parameter (if connected) - SATA drive location

Down below several commands are shown which were used during EMC testing:

  • iMX6 TinyRex Development kit Max with SATA stresstesting:
./imx6-tinyrex-emc-test.sh -max -sata_stress sdb1 sdc1 mmcblk2p2 sda2 | tee -i trx-emc-testing.log
  • iMX6 TinyRex Development kit Pro with SATA copying file from/to USB drive:
./imx6-tinyrex-emc-test.sh -pro -sata_cp sdb1 sdc1 mmcblk2p2 sda2 | tee -i trx-emc-testing.log
  • iMX6 TinyRex Development kit Basic:
./imx6-tinyrex-emc-test.sh -basic -n sda1 sdb1 mmcblk2p2 | tee -i trx-emc-testing.log

The complete script can be found in the download section or down below:

#!/bin/sh
 
# TinyRex EMC testing script
 
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
}
# prepare files
cd ~
mkdir -p emc-testing/
cd emc-testing/
touch trx-emc-testing.log
 
echo '\033[9;0]' > /dev/tty1 # disable blanking the display
 
tinybasic=0
tinypro=0
tinymax=0
case $1 in
  -basic)  tinybasic=1 ;;
  -pro)  tinypro=1 ;;
  -max)  tinymax=1 ;;
  *)
esac
 
imx6_sata_cp=0
imx6_sata_stress=0
case $2 in
  -sata_cp) imx6_sata_cp=1 ;;
  -sata_stress) imx6_sata_stress=1 ;;
  *)
esac
 
# mount devices
mountDevice $3 usb0
mountDevice $4 usb1
mountDevice $5 mmc0
if [ "${imx6_sata_cp}" -eq "1" ] || [ "${imx6_sata_stress}" -eq "1" ]; then
  mountDevice $5 sata
fi
 
updateLogFiles() {
  currentTime=`date +%Y-%m-%d.%H_%M`
  mv trx-emc-testing.log trx-emc-testing.log.$currentTime
}
 
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 $ping_pid;
  sleep 3;
  test_status=`cat trx-emc-testing.log | grep -i "error" | grep -v -e "0 errors" -e "no corrected errors"`
  if [ -z "$test_status" ]
  then
  echo "$(date +\%Y/\%m/\%d-\%T)($(date +\%Z)) PASS - Script ended without detected errors."
  else
  cat trx-emc-testing.log | grep -i "error" | grep -v -e "0 errors" -e "no corrected errors" -e "List of detected errors:"
  fi
  updateLogFiles
  exit;
}
 
# kill all processes if Ctrl+C is detected
trap finish_test_now 2
 
# connect ethernet loopback and force the ethernet to 100Mbit
ethtool -s eth0 speed 100 autoneg off
 
# play a video stream from HDMI input - testing also HDMI output
gst-launch -q imxv4l2src ! autovideosink &
 
# stressapptest - one thread CPU, one thread memory
if [ "${tinybasic}" -eq "1" ]; then
  ./stressapptest -s 600000 -M 100 -m 1 -C 1 --printsec 10 &
  str_pid=$!
fi
if [ "${tinypro}" -eq "1" ] && [ "${imx6_sata_stress}" -eq "1" ]; then
  ./stressapptest -s 600000 -M 200 -m 1 -C 1 --printsec 10 &
  str_pid=$!
else
  ./stressapptest -f /media/sata/tmp-file1 -s 600000 -M 200 -m 1 -C 1 --printsec 10 &
  str_pid=$!
fi
if [ "${tinymax}" -eq "1" ] && [ "${imx6_sata_stress}" -eq "1" ]; then
  ./stressapptest -f /media/sata/tmp-file1 -s 600000 -M 500 -m 1 -C 1 --printsec 10 &
  str_pid=$!
else
  ./stressapptest -s 600000 -M 500 -m 1 -C 1 --printsec 10 &
  str_pid=$!
fi
 
echo "$(date +\%Y/\%m/\%d-\%T)($(date +\%Z)) Starting stressapptest with PID: " $str_pid
 
ping 192.168.0.160 &
ping_pid=$!
echo "$(date +\%Y/\%m/\%d-\%T)($(date +\%Z)) Starting ping: " $ping_pid
 
proceed=1
file1="blackbird.wav"
file2="blackbird2.wav"
 
cp1_from="/media/mmc0/"
cp1_to="/media/usb0/"
 
if [ "${imx6_sata_cp}" -eq "1" ] || [ "${imx6_sata_stress}" -eq "1" ]; then
  cp2_from="/media/sata/"
  cp2_to="/media/usb1/"
else
  cp2_from="/media/mmc0/"
  cp2_to="/media/usb1/"
fi
 
#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 
 
  cp1_done=`ps | 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 | 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


The original article can be accessed on the iMX6TinyRex.com website.