Difference between revisions of "iMX6 TinyRex EMC testing"

From Voipac Wiki
Jump to navigation Jump to search
 
(26 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:iMX6 TinyRex Development kit]]
+
[[Category:iMX6 TinyRex Development Kit]]
 
<!-- -->
 
<!-- -->
 
<div style="float:right">__TOC__</div>
 
<div style="float:right">__TOC__</div>
  
Electromagnetic compatibility results for iMX6 TinyRex Development kit are shown on this page. Test setup and scripts are described in details.<br /><br />
+
Electromagnetic compatibility results for iMX6 TinyRex Development Kit are shown on this page. Test setup and scripts are described in details.<br /><br />
  
These measurement were performed with boards using the actual hardware and software configuration of the web shop development kits.
+
These measurements were performed with boards using the actual hardware and software configuration of the web shop development kits.
  
 
== Connected cables/devices ==
 
== Connected cables/devices ==
* '''Power jack:''' [http://downloads.voipac.com/files/iMX6_TinyRex_Development_kit/module/documents/EMC_radiated_emission/ideal-power-5v-dc-4a-psu-25hk-ab-050a400-d5-a4.pdf +5V power supply] was used for input voltage
+
* '''Power jack:''' [http://downloads.voipac.com/files/iMX6_TinyRex_Development_Kit/module/documents/EMC_radiated_emission/ideal-power-5v-dc-4a-psu-25hk-ab-050a400-d5-a4.pdf +5V power supply] was used for input voltage
 
* '''SD card (Sandisk):''' preloaded with filesystem, used for booting and for read/write test
 
* '''SD card (Sandisk):''' preloaded with filesystem, used for booting and for read/write test
* '''Ethernet:''' 1 meter 1m CAT Ethernet [https://kb.juniper.net/InfoCenter/index?page=content&id=KB22174 loopback cable] connected. Forced to 100Mb and used for ping test
+
* '''Ethernet:''' 1 meter CAT Ethernet [https://kb.juniper.net/InfoCenter/index?page=content&id=KB22174 loopback cable] connected. Forced to 100Mb and used for ping test
 
* '''one of these two HDMI options was used:'''
 
* '''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 [https://www.voipac.com/#iMX6-HHC-00000000 HDMI micro to HDMI cable]
+
** '''HDMI loopback:''' when HDMI input is tested using a loopback connection, HDMI input is connected to its HDMI output via a shielded 1 meter long [https://www.voipac.com/hdmi-high-speed-cable 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 [https://www.voipac.com/#iMX6-HHC-00000000 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
+
** '''HDMI input source and monitor used:''' a video source (from a different iMX6 TinyRex Development Kit) is plugged into HDMI input using [https://www.voipac.com/hdmi-high-speed-cable 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 laid flat on the floor to minimise its affect on results
 
* '''2x USB flash drive:''' each connected through a 2m extension cable. Both used during read/write test
 
* '''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)
+
* '''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 configurations (as per results below)
 
* '''Wifi PCIE mini card:''' inserted, but not actively used. No antennas connected
 
* '''Wifi PCIE mini card:''' inserted, but not actively used. No antennas connected
* '''Debug cable:''' [https://www.voipac.com/#iMX6-TTL-00000000 FTDI TTL-3V3 UART to USB cable], used only to setup the board, not used and not plugged in during the measurements<br />
+
* '''Debug cable:''' [https://www.voipac.com/ttl-232r-3v3-cable FTDI TTL-3V3 UART to USB cable], used only to setup the board, not used and not plugged in during the measurements
 
+
<br />
[[image:iMX6_TinyRex_Development_kit-EMC-Testing_overview.jpg|800px]]
+
[[image:iMX6_TinyRex_Development_Kit-EMC-Testing_overview.jpg|800px]]
  
 
== Test description ==
 
== 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:
+
The main purpose of testing was to measure Radiated emission of iMX6 TinyRex Development Kit performing under heavy load. Following threads were running during the measurements:
 
* CPU stress test
 
* CPU stress test
 
* Memory stress test
 
* Memory stress test
Line 28: Line 28:
 
* HDMI output (received HDMI stream is forwarded to HDMI output)
 
* HDMI output (received HDMI stream is forwarded to HDMI output)
 
* SD card test (read & write)
 
* SD card test (read & write)
 +
* 2x USB test (USB memory drive read & write stress test)
 
* SATA stress test (read & write) (if applicable)
 
* SATA stress test (read & write) (if applicable)
 
* Ethernet ping (and Ethernet SSH session)
 
* Ethernet ping (and Ethernet SSH session)
Line 35: Line 36:
  
 
=== Graph description ===
 
=== Graph description ===
==== Lower band 30kHz - 1 GHz ====
+
==== Lower band 30MHz - 1GHz ====
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'''.
+
Radiated emission is 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'''.<br /><br />
 
  
 +
==== Higher band 1GHz - 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'''.<br />
 
Black curve depicts average-power values. Threshold for average-power measurement is shown with the lower placed limit line called '''22F_AV_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 ===
+
=== iMX6 TinyRex Development Kit Max with enclosure PASS ===
 
Test description:
 
Test description:
 
* stressapptest for CPU and memory
 
* stressapptest for CPU and memory
Line 50: Line 50:
 
* HDMI input and output both tested with 720p video stream
 
* HDMI input and output both tested with 720p video stream
 
* Ethernet SSH session
 
* 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.<br /><br />
+
This setup used HDMI option with separate video input source and monitor. Both the board and the monitor were placed on the floor to minimise its effects. The power source was hidden inside the chamber tunnel under the testing table.<br /><br />
[[image:iMX6_TinyRex_Development_kit-EMC-HDMI_with_source_and_monitor.jpg|800px]]<br /><br />
+
[[image:iMX6_TinyRex_Development_Kit-EMC-HDMI_with_source_and_monitor.jpg|800px]]<br /><br />
  
 
{|style="text-align:center;"
 
{|style="text-align:center;"
| style="width: 47%;" |'''Vertical polarization'''
+
| style="width: 47%;" |'''Vertical polarisation'''
 +
| style="width: 6%;" |<br />
 +
| style="width: 47%;" |'''Horizontal polarisation'''
 +
|-
 +
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_Kit_Max-EMC-RE_30MHz-1GHz_Ver_Pol.png|370px]]<br /><br />
 +
|<br />
 +
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_Kit_Max-EMC-RE_30MHz-1GHz_Hor_Pol.png|370px]]<br /><br />
 +
|-
 +
|colspan="3"|iMX6 TinyRex Development Kit Max: 30MHz - 1GHz
 +
|}
 +
<br />
 +
{|style="text-align:center;"
 +
| style="width: 47%;" |'''Vertical polarisation'''
 
| style="width: 6%;" |<br />
 
| style="width: 6%;" |<br />
| style="width: 47%;" |'''Horizontal polarization'''
+
| style="width: 47%;" |'''Horizontal polarisation'''
 
|-
 
|-
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_kit_Max-EMC-RE_30MHz-1GHz_Ver_Pol.jpg|370px]]
+
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_Kit_Max-EMC-RE_1GHz-4GHz_Ver_Pol.png|370px]]<br /><br />
 
|<br />
 
|<br />
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_kit_Max-EMC-RE_30MHz-1GHz_Hor_Pol.jpg|370px]]
+
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_Kit_Max-EMC-RE_1GHz-4GHz_Hor_Pol.png|370px]]<br /><br />
 
|-
 
|-
|colspan="3"|iMX6 TinyRex Development kit Max: 30kHZ - 1GHz
+
|colspan="3"|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
 +
* SATA stress testing
 +
* 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 hard drive. During this test HDMI loopback option was used.<br /><br />
 +
 +
These results show that a heavy loaded 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 />
 +
 +
{|style="text-align:center;"
 +
| style="width: 47%;" |'''Vertical polarisation'''
 +
| style="width: 6%;" |<br />
 +
| style="width: 47%;" |'''Horizontal polarisation'''
 +
|-
 +
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_Kit_Max_with_SATA-EMC-RE_30MHz-1GHz_Ver_Pol.png|370px]]<br /><br />
 +
|<br />
 +
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_Kit_Max_with_SATA-EMC-RE_30MHz-1GHz_Hor_Pol.png|370px]]<br /><br />
 +
|-
 +
|colspan="3"|iMX6 TinyRex Development Kit Max with SATA: 30MHz - 1GHz
 +
|}
 +
<br />
 +
{|style="text-align:center;"
 +
| style="width: 47%;" |'''Vertical polarisation'''
 +
| style="width: 6%;" |<br />
 +
| style="width: 47%;" |'''Horizontal polarisation'''
 +
|-
 +
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_Kit_Max_with_SATA-EMC-RE_1GHz-4GHz_Ver_Pol.png|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.png|370px]]<br /><br />
 +
|-
 +
|colspan="3"|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 option)
 +
* Ethernet SSH session
 +
<br />
 +
[[image:iMX6_TinyRex_Development_Kit-EMC-HDMI_loopback.jpg|800px]]<br /><br />
  
==== Heavy testing - PASS ====
 
 
{|style="text-align:center;"
 
{|style="text-align:center;"
| style="width: 47%;" |Vertical polarization
+
| style="width: 47%;" |'''Vertical polarisation'''
 +
| style="width: 6%;" |<br />
 +
| style="width: 47%;" |'''Horizontal polarisation'''
 +
|-
 +
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_Kit_Pro-EMC-RE_30MHz-1GHz_Ver_Pol.png|370px]]<br /><br />
 +
|<br />
 +
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_Kit_Pro-EMC-RE_30MHz-1GHz_Hor_Pol.png|370px]]<br /><br />
 +
|-
 +
|colspan="3"|iMX6 TinyRex Development Kit Pro: 30MHz - 1GHz
 +
|}
 +
<br />
 +
{|style="text-align:center;"
 +
| style="width: 47%;" |'''Vertical polarisation'''
 
| style="width: 6%;" |<br />
 
| style="width: 6%;" |<br />
| style="width: 47%;" |Horizontal polarization
+
| style="width: 47%;" |'''Horizontal polarisation'''
 
|-
 
|-
|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_Pro-EMC-RE_1GHz-4GHz_Ver_Pol.png|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_Pro-EMC-RE_1GHz-4GHz_Hor_Pol.png|370px]]<br /><br />
 +
|-
 +
|colspan="3"|iMX6 TinyRex Development Kit Pro: 1GHz - 4GHz
 
|}
 
|}
  
=== Conducted emission ===
+
=== 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 option)
 +
* Ethernet SSH session
 +
<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 polarisation'''
 +
| style="width: 6%;" |<br />
 +
| style="width: 47%;" |'''Horizontal polarisation'''
 +
|-
 +
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_Kit_Basic-EMC-RE_30MHz-1GHz_Ver_Pol.png|370px]]<br /><br />
 +
|<br />
 +
|style="width:396px; border:1px solid black;" |<br />[[image:iMX6_TinyRex_Development_Kit_Basic-EMC-RE_30MHz-1GHz_Hor_Pol.png|370px]]<br /><br />
 +
|-
 +
|colspan="3"|iMX6 TinyRex Development Kit Basic: 30MHz - 1GHz
 +
|}
 +
<br />
 +
{|style="text-align:center;"
 +
| style="width: 47%;" |'''Vertical polarisation'''
 
| style="width: 6%;" |<br />
 
| style="width: 6%;" |<br />
| style="width: 47%;" |Horizontal polarization
+
| style="width: 47%;" |'''Horizontal polarisation'''
 
|-
 
|-
|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_Basic-EMC-RE_1GHz-4GHz_Ver_Pol.png|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_Basic-EMC-RE_1GHz-4GHz_Hor_Pol.png|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 create a high CPU and memory load. 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 boards were mainly operated through SSH sessions. Thus it is very useful to have the same IP address during the whole process. The easiest way to do so is to run DHCP server on the controlling computer. To allow boards using the same address enable persistent leases with a long duration (2880 min used below):<br />
 +
[[image:iMX6_TinyRex_Development_Kit-Env_chamber-DHCP_settings.png|360px]]
  
=== 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 minimise the possibility of results being affected, 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 a board is disconnected, Linux terminates all the processes started within SSH sessions 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 via SSH session. Screen environment is opened:
 
<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
 +
* the first parameter - version of tested board (-max, -pro or -basic)
 +
* the second parameter - selects if and how SATA interface will be tested (no SATA testing:-n, only copy test: -sata_cp, stresstest: -sata_stress)
 +
* the third parameter - USB drive 1 location
 +
* the fourth parameter - USB drive 2 location
 +
* the fifth parameter - SD card location
 +
* the sixth parameter (if connected) - SATA drive location
 +
<br />
 +
Several commands which were used during EMC testing are shown below:
 +
* iMX6 TinyRex Development Kit Max with SATA stresstesting:
 +
<syntaxhighlight lang="bash">
 +
./imx6-tinyrex-emc-test.sh -max -sata_stress sdb1 sdc1 mmcblk2p2 sda2 | tee -i trx-emc-testing.log
 +
</syntaxhighlight>
 +
* iMX6 TinyRex Development Kit Pro with SATA copying file from/to USB drive:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
./emc-test-all.sh sda1 sdb1 sdc1 mmcblk0p1
+
./imx6-tinyrex-emc-test.sh -pro -sata_cp sdb1 sdc1 mmcblk2p2 sda2 | tee -i trx-emc-testing.log
 
</syntaxhighlight>
 
</syntaxhighlight>
 
+
* iMX6 TinyRex Development Kit Basic:
To locate directories where the devices are mapped, ''"fdisk -l"'' command can be useful:
 
 
<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 193: Line 252:
 
   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`
 
  if [ -z "$cp2_done" ]; then # run cp only if previous cp is done
 
    cp /media/usb1/$file1 /media/mmc0 &
 
    cp2_pid=$!
 
    echo "started cp from usb1 to mmc0"
 
  fi
 
 
  aud_done=`ps cax | grep $aud_pid | grep aplay`
 
  if [ -z "$aud_done" ]; then
 
    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() {
+
finish_test_now() {
   mount /dev/$1 /media/$2
+
   echo "$(date +\%Y/\%m/\%d-\%T)($(date +\%Z)) Ctrl+C Detected: End of the test"
   cat /etc/mtab | grep -F "/dev/$1 /media/$2"
+
  precced=0;
   if [ "$?" -eq "0" ]; then
+
  #kill -INT $vid_pid $str_pid $ping_pid;
    echo "$2 mounted"
+
  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
 
   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
+
# connect ethernet loopback and force the ethernet to 100Mbit
mountDevice $4 mmc0
+
ethtool -s eth0 speed 100 autoneg off
 
   
 
   
# tell the X applications where they should run
+
# play a video stream from HDMI input - testing also HDMI output
export DISPLAY=:0
+
gst-launch -q imxv4l2src ! autovideosink &
 
   
 
   
# run X windows - wait for the procces
+
# stressapptest - one thread CPU, one thread memory
service lightdm start
+
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
 
   
 
   
# connect Ethernet loopback and force the ethernet to 100Mbit
+
echo "$(date +\%Y/\%m/\%d-\%T)($(date +\%Z)) Starting stressapptest with PID: " $str_pid
mii-tool -F 100baseTx-HD
 
 
   
 
   
# gpu test
+
ping 192.168.0.160 &
cd /root/gpu-viv-bin-mx6q-3.10.9-1.0.0-hfp/opt/viv_samples/vdk
+
ping_pid=$!
./tutorial7 &
+
echo "$(date +\%Y/\%m/\%d-\%T)($(date +\%Z)) Starting ping: " $ping_pid
gpu_pid=$!
 
cd
 
 
   
 
   
# play a video file on the lvds display
+
proceed=1
echo 0 > /sys/class/graphics/fb2/blank
+
file1="blackbird.wav"
mplayer -vo fbdev2:/dev/fb2 -vf scale -zoom -loop 0 -xy 1024 -really-quiet /home/ubuntu/Clouds.avi &
+
file2="blackbird2.wav"
vid_pid=$!
 
 
   
 
   
# stressapptest - testing sata, 2x usb, sd card, 1 thread CPU, 1 thread memory
+
cp1_from="/media/mmc0/"
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 $
+
cp1_to="/media/usb0/"
str_pid=$!
 
echo "Stressapptest: " $str_pid
 
 
   
 
   
# play a audio file
+
if [ "${imx6_sata_cp}" -eq "1" ] || [ "${imx6_sata_stress}" -eq "1" ]; then
mplayer -loop 0 -really-quiet /home/ubuntu/blackbird.wav &
+
  cp2_from="/media/sata/"
aud_pid=$!
+
  cp2_to="/media/usb1/"
 +
else
 +
  cp2_from="/media/mmc0/"
 +
  cp2_to="/media/usb1/"
 +
fi
 
   
 
   
# ping
+
#copy files in case they are missing
ping 192.168.10.1 &
+
cp /media/$file1 $cp1_from$file1
ping_pid=$!
+
cp /media/$file1 $cp1_to$file1
 +
cp /media/$file2 $cp2_from$file2
 +
cp /media/$file2 $cp2_to$file2
 
   
 
   
# top
+
while [ $proceed -eq 1 ]
top
+
do
top_pid=$!
 
 
   
 
   
 +
  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
 
   
 
   
# kill all procceses if Ctrl+C detected
+
done
trap '$procced=0; kill $gpu_pid $vid_pid $aud_pid $str_pid $ping_pid;' 2
 
sleep 10000
 
</syntaxhighlight>
 
 
 
'''''Note:''''' If the LVDS monitor is not included in the setup, these lines need to be comment out:
 
<syntaxhighlight lang="bash">
 
# echo 0 > /sys/class/graphics/fb2/blank
 
# mplayer -vo fbdev2:/dev/fb2 -vf scale -zoom -loop 0 -xy 1024 -really-quiet /home/ubuntu/Clouds.avi &
 
</syntaxhighlight>
 
 
 
To disable LVDS Interface, following command is required:
 
<syntaxhighlight lang="bash">
 
echo 1 > /sys/class/graphics/fb2/blank
 
 
</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/ iMX6Rex.com website].

Latest revision as of 15:25, 15 June 2022

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

These measurements 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 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 a 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 (from a different 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 laid flat on the floor to minimise 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 configurations (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


iMX6 TinyRex Development Kit-EMC-Testing overview.jpg

Test description

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

  • 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)
  • 2x USB test (USB memory drive read & write stress test)
  • 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 30MHz - 1GHz

Radiated emission is 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 1GHz - 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 the monitor were placed on the floor to minimise its effects. The power source was hidden inside the chamber tunnel under the testing table.

iMX6 TinyRex Development Kit-EMC-HDMI with source and monitor.jpg

Vertical polarisation
Horizontal polarisation

iMX6 TinyRex Development Kit Max-EMC-RE 30MHz-1GHz Ver Pol.png



iMX6 TinyRex Development Kit Max-EMC-RE 30MHz-1GHz Hor Pol.png

iMX6 TinyRex Development Kit Max: 30MHz - 1GHz


Vertical polarisation
Horizontal polarisation

iMX6 TinyRex Development Kit Max-EMC-RE 1GHz-4GHz Ver Pol.png



iMX6 TinyRex Development Kit Max-EMC-RE 1GHz-4GHz Hor Pol.png

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
  • SATA stress testing
  • 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 hard drive. During this test HDMI loopback option was used.

These results show that a heavy loaded iMX6 TinyRex Development Kit complies with stricter regulation even if no enclosure is used.

iMX6 TinyRex Development Kit-EMC-Testing bare board with SATA.jpg

Vertical polarisation
Horizontal polarisation

iMX6 TinyRex Development Kit Max with SATA-EMC-RE 30MHz-1GHz Ver Pol.png



iMX6 TinyRex Development Kit Max with SATA-EMC-RE 30MHz-1GHz Hor Pol.png

iMX6 TinyRex Development Kit Max with SATA: 30MHz - 1GHz


Vertical polarisation
Horizontal polarisation

iMX6 TinyRex Development Kit Max with SATA-EMC-RE 1GHz-4GHz Ver Pol.png



iMX6 TinyRex Development Kit Max with SATA-EMC-RE 1GHz-4GHz Hor Pol.png

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 option)
  • Ethernet SSH session


iMX6 TinyRex Development Kit-EMC-HDMI loopback.jpg

Vertical polarisation
Horizontal polarisation

iMX6 TinyRex Development Kit Pro-EMC-RE 30MHz-1GHz Ver Pol.png



iMX6 TinyRex Development Kit Pro-EMC-RE 30MHz-1GHz Hor Pol.png

iMX6 TinyRex Development Kit Pro: 30MHz - 1GHz


Vertical polarisation
Horizontal polarisation

iMX6 TinyRex Development Kit Pro-EMC-RE 1GHz-4GHz Ver Pol.png



iMX6 TinyRex Development Kit Pro-EMC-RE 1GHz-4GHz Hor Pol.png

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 option)
  • Ethernet SSH session


Vertical polarisation
Horizontal polarisation

iMX6 TinyRex Development Kit Basic-EMC-RE 30MHz-1GHz Ver Pol.png



iMX6 TinyRex Development Kit Basic-EMC-RE 30MHz-1GHz Hor Pol.png

iMX6 TinyRex Development Kit Basic: 30MHz - 1GHz


Vertical polarisation
Horizontal polarisation

iMX6 TinyRex Development Kit Basic-EMC-RE 1GHz-4GHz Ver Pol.png



iMX6 TinyRex Development Kit Basic-EMC-RE 1GHz-4GHz Hor Pol.png

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 create a high CPU and memory load. 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 boards were mainly operated through SSH sessions. Thus it is very useful to have the same IP address during the whole process. The easiest way to do so is to run DHCP server on the controlling computer. To allow boards using the same address enable persistent leases with a long duration (2880 min used below):
iMX6 TinyRex Development Kit-Env chamber-DHCP settings.png

Preserving SSH session

To minimise the possibility of results being affected, the control computer was disconnected and taken outside of the test chamber (after the board was setup).

When Ethernet cable connected to a board is disconnected, Linux terminates all the processes started within SSH sessions 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 via SSH session. Screen environment is opened:

screen -S tinyrex

Testing scripts command consists of following arguments

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


Several commands which were used during EMC testing are shown below:

  • 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 iMX6Rex.com website.