Getting Started with M.2 Modules & i.MX RT Datasheet by Embedded Artists

View All Related Products | Download PDF Datasheet
eamm 2020 @ Emma mg; AB @Emm
Getting Started with M.2 Modules and i.MX RT
Copyright 2020 © Embedded Artists AB
Getting Started with
M.2 Modules and i.MX RT
httg //www EmbeddedAmsls.com ask you may have for improvemems www.embeddedar1ists com/contact
Getting Started with M.2 Modules and i.MX RT
Page 2
Copyright 2019 © Embedded Artists AB
Rev A
Embedded Artists AB
Jörgen Ankersgatan 12
SE-211 45 Malmö
Sweden
http://www.EmbeddedArtists.com
Copyright 2020 © Embedded Artists AB. All rights reserved.
No part of this publication may be reproduced, transmitted, transcribed, stored in a retrieval system, or
translated into any language or computer language, in any form or by any means, electronic,
mechanical, magnetic, optical, chemical, manual or otherwise, without the prior written permission of
Embedded Artists AB.
Disclaimer
Embedded Artists AB makes no representation or warranties with respect to the contents hereof and
specifically disclaim any implied warranties or merchantability or fitness for any particular purpose.
Information in this publication is subject to change without notice and does not represent a
commitment on the part of Embedded Artists AB.
Feedback
We appreciate any feedback you may have for improvements on this document. Send your comments
by using the contact form: www.embeddedartists.com/contact.
Trademarks
All brand and product names mentioned herein are trademarks, services marks, registered
trademarks, or registered service marks of their respective owners and should be treated as such.
Getting Started with M.2 Modules and i.MX RT
Page 3
Copyright 2019 © Embedded Artists AB
Rev A
Table of Contents
1 Document Revision History ................................. 4
2 Introduction ........................................................... 5
2.1 Conventions .................................................................................... 5
3 QuickStart Guide ................................................... 6
3.1 Step #1: Downloading and Installing MCUXpresso SDK ............ 6
3.2 Step #2: Mount M.2 Module ......................................................... 11
3.3 Step #3: Example Application - iperf .......................................... 14
3.3.1 Import wiced-iperf ........................................................................ 14
3.3.2 Patch ........................................................................................... 17
3.3.3 Configure the Example ................................................................ 18
3.3.4 Compile and Run/Debug ............................................................. 19
3.3.5 Explanation of the example ......................................................... 20
3.3.6 Troubleshooting ........................................................................... 23
3.4 Step #4: Example Application - Bluetooth ................................. 24
3.4.1 Import wiced_ble_4343W ............................................................ 25
3.4.2 Patch ........................................................................................... 28
3.4.3 Configure the Example ................................................................ 29
3.4.4 Compile and Run/Debug ............................................................. 30
3.4.5 Explanation of the example ......................................................... 31
3.4.6 Troubleshooting ........................................................................... 34
4 Debug Interface ................................................... 35
4.1 J-LINK/J-TRACE Support............................................................. 36
4.1.1 Install J-LINK Software ................................................................ 36
4.1.2 MCUXpresso 10.3.0 .................................................................... 37
4.2 Debug Troubleshooting ............................................................... 37
5 Improved IPERF performance ............................ 38
Revision Date Descripfl'on PA1 2019-04-30 First release. PA2 2019-05-03 Updated screen shots and some pictures. PA3 2019-09-10 Updated screen shots in 3.1. Updated debug troubleshooting in 3.3.6. PA4 2020-01-14 Updated to match SDK 2.7.0 PAS 2020-01-31 Added note in section 5 about broken instructions
Getting Started with M.2 Modules and i.MX RT
Page 4
Copyright 2019 © Embedded Artists AB
Rev A
1 Document Revision History
Date
Description
2019-04-30
First release.
2019-05-03
Updated screen shots and some pictures.
2019-09-10
Updated screen shots in 3.1. Updated debug troubleshooting in 3.3.6.
Added Bluetooth example in section 3.4
2020-01-14
Updated to match SDK 2.7.0
2020-01-31
Added note in section 5 about broken instructions
Getting Started with M.2 Modules and i.MX RT
Page 5
Copyright 2019 © Embedded Artists AB
Rev A
2 Introduction
This document describes how to add wireless functionality with M.2 modules to an iMX RT1062
Developer's Kit. The kit will be referred to as the iMX RT Developer's Kit for the rest of the document.
Additional documentation you need is:
iMX RT1052/1062 Developer's Kit Program Development Guide - called Program
Development Guide for short in this document
iMX RT1062 Developer's Kit User's Guide
iMX RT1052/1062 OEM Board Datasheet
M.2 Module Datasheet for the specific M.2 module you are using
2.1 Conventions
A number of conventions have been used throughout to help the reader better understand the content
of the document.
Constant width text is used for file system paths and command, utility and tool names.
$ This field illustrates user input in a terminal running on the
development workstation, i.e., on the workstation where you edit,
configure and build Linux
# This field illustrates user input on the target hardware, i.e.,
input given to the terminal attached to the COM Board
T
Th
hi
is
s
f
fi
ie
el
ld
d
i
is
s
u
us
se
ed
d
t
to
o
i
il
ll
lu
us
st
tr
ra
at
te
e
e
ex
xa
am
mp
pl
le
e
c
co
od
de
e
o
or
r
e
ex
xc
ce
er
rp
pt
t
f
fr
ro
om
m
a
a
d
do
oc
cu
um
me
en
nt
t.
.
This field is used to highlight important information
Getting Started with M.2 Modules and i.MX RT
Page 6
Copyright 2019 © Embedded Artists AB
Rev A
3 QuickStart Guide
This chapter is a step-by-step guide to get Wi-Fi up and running in shortest possible time:
1. The first step is to download and install the SDK.
2. The second step describes how to physically mount the M.2 module.
3. The third step describes how to setup, patch and run the example project.
Above are the three simple steps to get up-and-running immediately!
There are a couple of more sections describing different aspects, like debugging and a performance
patch for iperf.
iMX RT1052
Note that as of January 2020 the NXP SDK (2.7.0) includes Wi-Fi support for the 1DX and 1LV M.2
modules and Bluetooth support only for the 1DX M.2 module. Additional Bluetooth support is
scheduled for a coming release as well as support for the 1MW and 1LV M.2 modules. Exact
release date is TBD.
iMX RT1062
Note that as of January 2020 the NXP SDK (2.7.0) includes Wi-Fi support for the 1DX and 1LV M.2
modules and Bluetooth support only for the 1DX M.2 module. Additional Bluetooth support is
scheduled for a coming release as well as support for the 1MW and 1LV M.2 modules. Exact
release date is TBD.
NXP's SDK supports several IDEs but this guide is focusing on the free MCUXpresso IDE from NXP.
Combining this document and the more general Program Development Guide should make it easy to
use another IDE as well.
3.1 Step #1: Downloading and Installing MCUXpresso SDK
This section will walk you through the installation of the MCUXpresso SDK, which is a package of
sample software projects (with device drivers and peripheral examples and demos) that will get you
started immediately with your i.MX RT software development. Note that even though the name of the
SDK suggests the code package is for the MCUXpresso IDE, the sample projects have project files for
other IDEs as well, such as Keil uVision/MDK, IAR Embedded Workbench, and more.
First download the MCUXpresso SDK by following this URL: https://mcuxpresso.nxp.com/en/welcome.
This is the online SDK builder that makes sure you will get the latest version of the software.
Note that some details in the screen dumps in this section might change over time, but the basic
walkthrough steps are the same.
You will need to login to your NXP account. Then click on Select Development Board.
, I Vietnam: mum» c fisaksr H!p§’nmxpr:ssanxp.3ie( hum a Scircincvciopmcniauard ‘ i n An: sMySDKDashbnard ‘ OVERViL‘r so’nvm: AND ’OOLS )ZVELOPER QEGOURCES Getting started with MCUXpresso SDK is simple. DD You have a development board? Sign by Eiirkiflg on seiqri iimrpinnmani Hoamln dmmiozd a usiomized SDK ior mi Spetii’it piairurm Are you retuming and seeking previouslydawnloaded SDKs? Ci ck on Dashboard for quick access to your nisiow or downioads
Getting Started with M.2 Modules and i.MX RT
Page 7
Copyright 2019 © Embedded Artists AB
Rev A
Figure 1 MCUXpresso SDK Builder
+ sAmk-szuanasm A \M- .. «MA KM. ._ _ w <- c="" a="" mpmmcmpmummmmm="" n="" m="" mama="" select="" development="" board="" 5m»="" by="" m.="" mm="" a,="" m="" w="" w="" named="" i="" ‘="" ea‘m="" balm="" sun/ch="" by="" nam-="" '="" a="" exwum="" '="" a="" m="" mwm="" n="" v="" sin:="" i="" dew:v="" land,="" nr="" kl!="" i="" m;="" emmwxmu:="" a="" m="" mm="" |="" a="" www="" m:="" www.="" mm="" m="" muxwa="" .="" w="" mmmm="" _="" mmmmm="" m="" mcuxm-sm="" mi="" i="" 5?="" ”www="" evkmmxwidh)="" camvm="" vamluannsa="" vamernow="" mek="" mm="" v="" um.="" yul-="" sax="" pm="" us.="" m="" mummmmsux="" puvaeypu="" n="" ‘evmeusi‘="" carmel="" eziqvkpsamccrcu="">
Getting Started with M.2 Modules and i.MX RT
Page 8
Copyright 2019 © Embedded Artists AB
Rev A
Then select the Boards i.MX EVK-MIMXRT1060. This is the NXP evaluation board, but most of
the samples will work unmodified on the iMX RT Developer's Kit.
Figure 2 MCUXpresso SDK Builder - Select Development Board
I saw aw: mzuanasm c a mpsuvmmammwm.mm n smowmmm Select Development Board gem lor you. mu m h. lo M mm l' WM mm”. mm- q [mm mm vamwmmm M. Mlmnm mm. “n _Mu_m‘"“ WHWMMN cannun‘xmnmm MWWW. mm . “MW EvKwawnms A WWW mmumm fl Pm'sm“ EVKMMXRYIHSO Annun- WWW: mmummu m wuw-mlnf WWW @ Emmmwmm a mum“ max mm mm, @ EW‘WSWWMMM mm mm , m , W lhml m. snK sax; 5 szxrmxmnw um us. an m u. m. a m sax PuvaEyFnllw l Immu‘e \ can” Mm \xpgammmg Mum; W n snxmm SDK Builder Own”! a dawnmm. suxmm m. .9 mm mama» MGHXpmun lnMu Dnuhwimmnmm|mnr |. MN WWWWMWWWW Q (”hm SDKVQW mm: W m.” m V Mm . um Wm.“ KN mm “W" CM . Mam mum WWWW MM . m. MW , _ m : Mam. ‘ cakvonr‘ n-wnvmn "Hyman-ms W ’< my“;="" .="" .="" .,="" mm.="" “awl“="" mssws="" cmsxsnsvsnnmreuu-vy="" um,="" wm="" m.-="" m="" mme="" h="" a”="" w="" awsm="" mmdkw-r:="" .wsm="" ““="" q="" m“="" 2="" mm...="" ”w="" gmw'”="" um="" an="" mlddkwu:="" mm="" samrmcmum="" mm;="" b="" m="" a="" munmm="" ath="" ..="" m...»="" m="" 22:1"="" 0="" "www="" d="" :s‘anam="" mam.”="" cmnlsmryna-mnmingm="" www="" mm“="" m="" d="" w="" mw="" .k.="" m="" www="" cms‘snnmem-‘nl="" "wm="" m="" .1="" manual="">
Getting Started with M.2 Modules and i.MX RT
Page 9
Copyright 2019 © Embedded Artists AB
Rev A
After selecting the NXP EVK, click on the Build MCUXpresso SDK button.
Figure 3 MCUXpresso SDK Builder - Build MCUXpresso SDK
Select All Toolchains under the Toolchain/IDE dropdown list. Select SDK version 2.7.0 2019-12-19.
Figure 4 MCUXpresso SDK Builder - Select Toolchain
Click the Select All button to select all optional software components.
. mm“. a Put-Ma- 111 mm“ as at mum-w MM. 3 mm. g HEW-(m Smur- mum m 3 mm mm”... AzmuanDK a“... Mm“... Lrwibv'! a.» mum mam—m cmmmmmm... «a “mum.“ summmmm .m mama: wms‘wummmawm m we, Emma a mm“ mm”... Emwaedwxnmcm 'MIIIWXV—usllmvflwon .mmmmmw PmsyPany «mm. mm sum 7 uwwxamn M u. -.n Dun-m m.” Mmm mm m mam mum, m- up um. Dunn-1m an em wm cu, ; m ”an.“ Emma mum am mm, mm mam... Emu—muss mmm mam Imu- me; w, mm. mm nMp—hm. mm m «m. mammal" n m ,9 sun-u n m... Mus m Charm Lw omwwwmm Auwmrmm
Getting Started with M.2 Modules and i.MX RT
Page 10
Copyright 2019 © Embedded Artists AB
Rev A
Scroll to the bottom of the page and press the Download SDK button. This will give you a complete
package with all software.
Figure 5 MCUXpresso SDK Builder - SDK Builder
Also agree to the Software Terms and Conditions by clicking on the I Agree button.
Downloads MCUXDressoSDK a. mmm sDK Arum: (m ME) I. mwmmuanxMmmm l? wamad Slanda‘mleExzmv‘e mum Addlflolul Yank nmlmauummmmeanfiv-wmwmnmmm m», m-u- m mg "mm—m... mm... mu m ._ sax E' cm swam l? Emh‘dd-d w‘m 5mm mi... Dualmlmniml a» Vlew m m Mm. Mam w \SSDK w Mm. Mam Mouxmm CAMIKYook .l. owl,“ Co'ww Tad: dun @nmlledsxs :3 ’Pmpeme: Fynalems Gimme >‘Telmma‘ m1 Imaqthfu Qnemqqacmme ‘ [unfilled SDKS 111mm Tn inmll In sun simply mag and duly In SDK (zip ale/lama) imam 'InsIalled snxs' view. [Common 'mweso' foll‘kl] imam 50K} Available llama; Availablz mg Nam: sox Vaslan Manila Vum'lwl Loan“ 3 SDKJLEVKrMIMXKTlM no mo ‘54 \sou;
Getting Started with M.2 Modules and i.MX RT
Page 11
Copyright 2019 © Embedded Artists AB
Rev A
Download of a (about) 170MByte zip-file will begin.
Figure 6 MCUXpresso SDK Builder - SDK Downloads
Save the file on your computer. Note the download location. As of January 2020, the file name is
SDK_2.7.0_EVK-MIMXRT1060.zip but the version number (i.e., 2.7.0) will likely increment
over time.
The SDK needs to be installed in MCUXpresso before it can be used. To do that start MCUXpresso
and then drag-n-drop the SDK archive (SDK_2.7.0_EVK-MIMXRT1060.zip) on to the
"Installed SDKs" tab:
During the installation MCUXpresso will make a copy of the archive that you drag-n-dropped so it is ok
to delete the SDK_2.7.0_EVK-MIMXRT1060.zip afterwards if you don't need it for one of
the other IDEs.
3.2 Step #2: Mount M.2 Module
Make sure the iMX RT Developer's Kit is powered off and then mount the M.2 Module, as illustrated in
the picture below:
Getting Started with M.2 Modules and i.MX RT
Page 12
Copyright 2019 © Embedded Artists AB
Rev A
Figure 1 M.2 Module on iMX OEM Carrier Board
Do not put too much force/pressure on the M2 screw (into the M.2 connector stand-off) so that the
PCB is bent. Bending the PCB too much will damage the board!
Use your fingers on the bottom side (while screwing) to give a counter-force, keeping the PCB
straight.
The picture below illustrates the typical angle (about 25 degrees) to use when inserting the M.2 module
into the connector. The pictures illustrate another carrier board, but the principle is exactly the same,
regardless of carrier board.
Getting Started with M.2 Modules and i.MX RT
Page 13
Copyright 2019 © Embedded Artists AB
Rev A
Figure 2 M.2 Module on Carrier Board
The picture below illustrates how to use two fingers, placed under the grounding stand-off, to avoid
bending the board. Make sure to always use this method to avoid damaging the board.
Figure 3 M.2 Module on Carrier Board
oQui... ursm ".“an 7. Ere L om '= MCUXpresso [DE - Quickstan Panel £ No project selected ' Cruteot'lnportapmject New prOJECt Import SDK example( rom file system... -oehgympmjed ..E3.flv
Getting Started with M.2 Modules and i.MX RT
Page 14
Copyright 2019 © Embedded Artists AB
Rev A
3.3 Step #3: Example Application - iperf
As of January 2020 there are five Wi-Fi example applications in the SDK:
wiced_iperf_43012 - this is a performance test application for the 1LV M.2 module
wiced_iperf_4343W - this is a performance test application for the 1DX M.2 module
wiced_iperf3_4343W - this is a performance test application for the 1DX M.2 module. This
example is only available in the SDK for the iMX RT1052 and the functionality/configuration is
the same as for the two other iperf examples (except that it is for the newer iperf3 protocol) so
it will not be covered by this document
wiced_mfg_test_43012 - this is a special application that is used for RF measurements and it
will not be covered by this document
wiced_mfg_test_4343W - this is a special application that is used for RF measurements and it
will not be covered by this document
Running one of the Wi-Fi examples requires the following steps:
1. Import the example application and change flash configuration
2. Patch the example code
3. Configure the example for your environment (e.g. SSID + password for your network)
4. Compile and debug/run
3.3.1 Import wiced-iperf
The following steps will guide you through opening the wiced-iperf application from the SDK.
1. Install the SDK as described in section 3.1 if you have not done so already
2. Click the "Import SDK example(s)…" link in the Quickstart Panel
Select the MIMXRT1060 and evklmxrthGD Click Next 10 o to lhe ro'ect selector. flaw WWWWWMW Mpg I ma ud/allkvlmnekdlm We «mum, lilfilm ‘ _ mm“ [M M: Wm ”New m... mmmmmmmmu ‘‘‘‘‘ m .mwmmm m WWWWW mwmmmm
Getting Started with M.2 Modules and i.MX RT
Page 15
Copyright 2019 © Embedded Artists AB
Rev A
3. Select the MIMXRT1060 and evkimxrt1060. Click Next to go to the project selector.
Select me wiced_iperf example and make sure 10 swimh 1mm Semihos Debu Console men click Nexi to o to the Advanced Senin 5 Pa e 4mmmfififi NPE I mm my“: Wamm mun-m 1 Mum,“ A “we.“ ~ , numumwmy m lnr‘mnwmm‘mmln mm.- nun-was “mm ("mm :3"me 1N>La1nhhuw “Macaw: 5.. ,(Wfimukzs 7mm...“ a.“ WW” Mun » dmu:mv\a “mm. my“: Vll‘Luu-nvk: mew-um Mummx '\ E Mums _ 1 my“. Nowgggbgfidvaqged Senings page, look 31 me 1ab|e for the Memory Configurafion: vmumyfinfyllh'm w] - M mm mm» manfWKE I W mm W g, ‘7 mm 9.. mm um mm m I | m mm mm w
Getting Started with M.2 Modules and i.MX RT
Page 16
Copyright 2019 © Embedded Artists AB
Rev A
4. Select the wiced_iperf example and make sure to switch from Semihost to UART for the SDK
Debug Console then click Next to go to the Advanced Settings Page.
5. Now on the Advanced Settings page, look at the table for the Memory Configuration:
6. Click and change the Size for BOARD_FLASH to 0x00400000 (both iMX RT1052 and
RT1062 have 4MB flash)
7. Click in the table cell for the driver and then on the small button that appears. Change the
Driver for BOARD_FLASH to MIMXRT1050-EcoXiP_ATXP032.cfx using the dropdown
menu.
Tile same flash driver is ueed for both i.MX RT1052 and RT1062. Dmslx‘nmlr I muxpmlx ._ mmmmmr Walsh-imp: . W.m m M m wkmn mm Wk 1! D Margaux v uh." (”m-.9.“- mannisfilum “unnummsm‘ "awry duals manmyuw “mamasvmex wulummmimemM mm. — m File to copy Destination Comment pin_mux.c board! Replace existing file fsl_lpi20.c drivers] New file fsl_lpi20.h drivers! New file pcaG41G.c source/ New file pcaG416.h source/ New file wwd_platfomi.c wicedl43xxx_Wi-Fi/WICED/plafiomthCU/LPCANWD/ Replace existing file wwd_SDl0.c wiced/43xxx_Wi-Fi/WICED/plalfcmilMCU/LPCANWD/ Replace existing file
Getting Started with M.2 Modules and i.MX RT
Page 17
Copyright 2019 © Embedded Artists AB
Rev A
The same flash driver is used for both i.MX RT1052 and RT1062.
8. With all the changes made, click ok and then finish to have MCUXpresso complete the project
setup
3.3.2 Patch
This section describes how to modify the project to be compatible with the features of the iMX RT
Developer's Kit, like the EcoXiP.
The SDK supports hyper flash but the iMX RT Developer's Kit has EcoXip flash from Adesto. Ideally
the EcoXip flash driver should be placed in a new file with _ecoxip in the name but that would require
changes to every project for every IDE in the SDK and that is a huge task. The solution is instead to
replace the file content but keep the filename. This way none of the projects have to be modified.
Download the zip-file from the Resources tab on the product page on Embedded Artists' website. The
name of the file is imxrt1062_ea_files_<date>.zip
Unpack the downloaded zip-file in a temporary directory, for example: c:/temp/ea_files, and
then copy the following files from that directory into the project in MCUXpresso. It is typically easiest to
do this outside of the IDE using for example Windows Explorer.
File to copy
Destination
Comment
pin_mux.c
board/
Replace existing file
fsl_lpi2c.c
drivers/
New file
fsl_lpi2c.h
drivers/
New file
pca6416.c
source/
New file
pca6416.h
source/
New file
wwd_platform.c
wiced/43xxx_Wi-Fi/WICED/platform/MCU/LPC/WWD/
Replace existing file
wwd_SDIO.c
wiced/43xxx_Wi-Fi/WICED/platform/MCU/LPC/WWD/
Replace existing file
evkmimxrt1060_fie xip/ Replace existing file Kmmmmmwhmmmtmmmmmmm jmvmm mvsvg‘c", ‘11: travkvjaarvgafl H'E‘khl’ n .1 U A. «ath- JJ uAum.“ and: :1 __ W, n ‘ W 1% m = a m “mmm m m M I v ‘7 fisj‘m'tm“ 4 e Mnmlullflfi),wxm iyuuww (Dem-p . I 25 Definitions )amxjm 2.; , ) m m 3., >ficu§s ‘u 1’ (mm Mm mm"; ., \wmm :2 an.“ muffin) B 33 Mefin: HE’SSID "m iwf‘ > F “a" n ma" ) m 35 mm: :5 mm; mrI rm )6“ 17 mm": m gm ‘wxvanansmsa' \ 43 mm 2 w 39 > " " K m nit-dd urtiximrn'v - w m n ma... mgmm mczoismwimiuxmjsx [, m MW .2 mm “mm”, ,,, ‘11-). . m . up.“ 1 1 F K . mum my“ m,- E .5 mm; mrliviuwmn “ W‘ «5 Mtfln: Inn, 7mm) gm... .7 mm > s m u; gm. a mm": mm, gum 'IszmssJJ' in” 5. um... um, 34mm 455,255 a a' 51 ’b‘h‘ SZ /' mgr! fih((d Duramt(r3 'l 53 so Iifndz‘ IvEnFiszmewnEss 55 mm: xrwgmcumsss "191.153.1401‘ 5:, mm
Getting Started with M.2 Modules and i.MX RT
Page 18
Copyright 2019 © Embedded Artists AB
Rev A
evkmimxrt1060_fle
xspi_nor_config.c
xip/
Replace existing file
After copying the files into the project the IDE must be told to look for the new files. In MCUXpresso
this is done by right clicking the project and selecting Refresh in the menu.
3.3.3 Configure the Example
Before the wiced_iperf example can be used some settings must be changed to allow it to find and
connect to your network. These settings are found near the top of the wiced_iperf.c file and looks like
this:
Change the WIFI_SSID, WIFI_PASSWORD and WIFI_SECURITY to match your network.
Change the IPERF_SERVER_ADDRESS to the server you want to test against. This option will be
explained more in detail later but it is good to know where the setting is in the code.
Click Build in the Quickslarl Panel o Quin“ M-be. (WV-Ii... 0. mu. $ om. =' l MCUXpresso [DE - Quicksmn Panel ms ijm: zwhninmuosmwkaajpm [Debug] Vflefleu‘lllpoflapmied > I New pvojecl... I Impon SDK :xample(s)u. 3 lmpon prejecfls) from file system... v main-rpm (5an an .ndngymrmjm .vmvfl. Click the "Debug" butlon in me Quickstarl Panel to download Q) Quk... oa= Glob... :x>= Vui... 0. Rm... :5 amt. .2 l MCUXpresso [DE - Quickstan Panel m Projed: ahnimxnloflkaedjpd [Debug] v Cram or inpm a puject I New pmjefl... I Impnn SDK example“)... 3 Import projlifls) horn in: symm... v napalm fl Bulld 1 Clean - nah-Jpnymjm
Getting Started with M.2 Modules and i.MX RT
Page 19
Copyright 2019 © Embedded Artists AB
Rev A
3.3.4 Compile and Run/Debug
To download and run the application, perform these steps:
1. Click Build in the Quickstart Panel
2. The program builds without errors
3. Connect the debug probe (LPC-Link2, ULINK2, J-LINK, etc.) to development platform to your
PC via USB cable. See chapter 4 for details how to connect the debug probe.
4. Open the terminal application on the PC, such as TeraTerm or PuTTY, and connect to the
debug serial port number. Configure the terminal with 115200 baud, 8N1.
You can alter the baud rate be searching for the reference
BOARD_DEBUG_UART_BAUDRATE variable in file: board.h
5. Click the "Debug" button in the Quickstart Panel to download the application to the target.
Run the code by clicking the "Resume" button to Help D'fENx) U» ml; 3.03.) E COM49:115200bps - Tera Term - MBED VT file Edit §elup C_ontml mum. fielp a: c Access point made : Client made Enter made: «at«at«aa«a«at«at«aawaithinnnnnaaaaaawwwwaaaaaaa IPERF example «tatttttttttttttttttaaaallannananntttttttttteeee Please select WiFi operation mode: [er on the local network (https://iperf.fr/iperf—down\oad.ghg hugs:I!)gerf.fr/igerf—servers.ghp hrtps:l/iperur/igerf-download.ghg : TCP 2: TCP 3: TCP 4: TCP 5: UDP 6: UDP 7: UDP : UDP Enter made Please select one server client client client server client client client Euccessfully joined: VSGl I etting IP address from DHCP server I IPv9 Address got from DHCP : 192.168.50.212 of the following modes to run IPERF with: mode (RX only mode (TX only dual mode (TX tradeoff mode mode (Rx only mode (IX only dual mode (TX tradeoff mode number: I test) test) and RX in parallel) (TX and Rx sequentially) test) test) and Rx in parallel) (TX and RX sequentially)
Getting Started with M.2 Modules and i.MX RT
Page 20
Copyright 2019 © Embedded Artists AB
Rev A
6. The application is then downloaded to the target and automatically runs to the main() function.
7. Run the code by clicking the "Resume" button to start the application.
8. The wiced_iperf application is now running and a banner is displayed on the terminal. If this is
not true, check your terminal settings and connections. Select Client mode by typing c.
3.3.5 Explanation of the example
Ping is a great way to test if the hardware is connected to the network, or not, but to really test the
network interface it is better to use a program like iperf. Iperf requires both a server and a client to
run the tests. The client is typically run on the iMX RT1062 board and the server software can either be
installed on a computer on the local network (https://iperf.fr/iperf-download.php) or one of the online
servers can be used (https://iperf.fr/iperf-servers.php). It is also possible to run the server on the iMX
RT1062 and the client on a PC in the same local network.
Make sure to select the latest version of the 2.0.* branch (2.0.9 as of May 2019) when downloading
the iperf software from https://iperf.fr/iperf-download.php. Version 3.* is not supported by the demo
code and it will not work as iperf and iperf3 are completely different protocols.
The wiced_iperf example implements eight different modes of testing:
Getting Started with M.2 Modules and i.MX RT
Page 21
Copyright 2019 © Embedded Artists AB
Rev A
Mode 1 - Server RX Only
Type a "1" to start server mode. Check the IP number that was assigned (in this case 192.168.50.164
as shown in the image above) and then run the following command on the PC (the program exists for
most common operating systems but is shown here for Windows):
C:\temp> iperf -c 192.168.50.164 -i 2 -t 20 -P 4
The parameters specifies the IP number of the iMX RT1062 board, that a report should be printed
every 2 seconds, that the test will run for 20 seconds and use 4 threads/connections.
After the test completes it will print something like this on the PC:
[SUM] 0.0-20.0 sec 92.5 MBytes 37.3 Mbits/sec
The log from the iMX RT1062 will show something like this for each of the 4 connections after the test
completes:
-------------------------------------------------
TCP_DONE_SERVER (RX)
Local address : 192.168.50.164 Port 5001
Remote address : 192.168.50.2 Port 43036
Bytes Transferred 24248344
Duration (ms) 27485
Bandwidth (kbitpsec) 7056
-------------------------------------------------
The information shown on the target is not entirely correct. It shows the correct number of bytes
transferred but does not calculate the time correctly. As seen above the time is 27485ms for a test
that takes 20 seconds. The wiced_iperf code measures time from the connection is established and
not from the first byte is sent over the connection. Depending on the PC software it may take extra
time (in this case roughly 7.5 seconds) to setup the test and this should not be included in the test
result but it is. When checking the result look at the PC instead of the target (i.e., the iMX RT1062).
Press SPACE to return to the main menu to run this or another test again.
Mode 2 - Client TX Only
Before running this test the PC must be running the server:
C:\temp> iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 208 KByte (default)
------------------------------------------------------------
Type a "2" to start client mode. It will run the tests against the server IP number configured in section
3.3.3 . Make sure that matches the IP number of the PC running the server.
After the test completes (it takes 10 seconds) it will print the following:
-------------------------------------------------
TCP_DONE_CLIENT (TX)
Local address : 192.168.50.164 Port 49153
Getting Started with M.2 Modules and i.MX RT
Page 22
Copyright 2019 © Embedded Artists AB
Rev A
Remote address : 192.168.50.2 Port 5001
Bytes Transferred 23600924
Duration (ms) 10000
Bandwidth (kbitpsec) 18880
Press SPACE to return to the main menu to run this or another test again.
Mode 3 - Client RX+TX in Parallel
Before running this test the PC must be running the server:
C:\temp> iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 208 KByte (default)
------------------------------------------------------------
Type a "3" to start in client mode. It will run the tests against the server IP number configured in section
3.3.3 . Make sure that matches the IP number of the PC running the server.
After the test completes (it takes 10 seconds) it will print the following:
-------------------------------------------------
TCP_DONE_CLIENT (TX)
Local address : 192.168.50.164 Port 49153
Remote address : 192.168.50.2 Port 5001
Bytes Transferred 16591464
Duration (ms) 10000
Bandwidth (kbitpsec) 13272
-------------------------------------------------
TCP_DONE_SERVER (RX)
Local address : 192.168.50.164 Port 5001
Remote address : 192.168.50.2 Port 43052
Bytes Transferred 19004004
Duration (ms) 10520
Bandwidth (kbitpsec) 14448
-------------------------------------------------
Press SPACE to return to the main menu to run this or another test again.
Mode 4 - Client RX+TX in Sequence
Before running this test the PC must be running the server:
C:\temp> iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 208 KByte (default)
------------------------------------------------------------
Type a "4" to start in client mode. It will run the tests against the server IP number configured in section
3.3.3 . Make sure that matches the IP number of the PC running the server.
After the test completes (it takes 10 seconds) it will print the following:
Getting Started with M.2 Modules and i.MX RT
Page 23
Copyright 2019 © Embedded Artists AB
Rev A
-------------------------------------------------
TCP_DONE_CLIENT (TX)
Local address : 192.168.50.164 Port 49153
Remote address : 192.168.50.2 Port 5001
Bytes Transferred 23441784
Duration (ms) 10000
Bandwidth (kbitpsec) 18752
-------------------------------------------------
TCP_DONE_SERVER (RX)
Local address : 192.168.50.164 Port 5001
Remote address : 192.168.50.2 Port 43054
Bytes Transferred 30276044
Duration (ms) 10005
Bandwidth (kbitpsec) 24208
Press SPACE to return to the main menu to run this or another test again.
Modes 5 to 8 - UDP
The first four modes were for TCP and modes 5 through 8 are for UDP. The tests are run in the same
way except for one thing: the -u option must be used on the PC side to force iperf into UDP mode.
C:\temp> iperf -s -u
------------------------------------------------------------
Server listening on UDP port 5001
Receiving 1470 byte datagrams
UDP buffer size: 208 KByte (default)
------------------------------------------------------------
Or
C:\temp> iperf -u -c 192.168.50.164 -i 2 -t 20 -P 4
3.3.6 Troubleshooting
Some things to check if the application is not working as expected:
Program not starting after being flashed.
This is typically because either the flash algorithm/flash size was not changed when importing
the project or the project files were not patched.
The iperf tests fail.
Check that there in actual connection to the (wireless) network. Look for these prints in the
boot log:
i'—__-_-¢—fi_.—.—v - lelSW-Taa'lum-MBEDVT Be [a SIM: W W Help
Getting Started with M.2 Modules and i.MX RT
Page 24
Copyright 2019 © Embedded Artists AB
Rev A
In order for the tests to work the "Successfully joined" message must be shown and the board
must have received an IP address from DHCP. If one of those is missing check the SSID
information again (see 3.3.3 ).
Cannot find M.2 module.
A successful detection of the M.2 module looks like this:
If the M.2 module cannot be detected, check that the module is correctly inserted and that all
patches were applied as specified in section 3.3.2 Make sure that the project matches the M.2
module - the wiced_iperf_43012 is for 1LV and wiced_iperf4343W is for 1DX.
Firewalls
As with all network tests make sure that the firewall on the test PC is not stopping the traffic
from the iMX RT1062 board. This is probably not a problem when running the iperf client on
the PC as it is outgoing traffic, however when running the iperf server it expects incoming
connections and those may be blocked by a firewall.
Throughput
The exact speed that can be achieved during testing is heavily dependent on the test
environment including but not limited to:
o Use of onboard antenna vs external antenna
o Wireless router performance
o Distance between iMX RT1062 and router
o PC that is running the software
o Usage of the 2.4GHz/5GHz band by others
3.4 Step #4: Example Application - Bluetooth
As of January 2020 there are two Bluetooth example applications in the SDK:
oQui... ursm ".“an n Ere L MCUXpresso [DE - Quickstan Panel £ No project selected ' Cruteot'lnportapmject New pro,e Import SDK example(s) -oehgympmjed ..E3.flv
Getting Started with M.2 Modules and i.MX RT
Page 25
Copyright 2019 © Embedded Artists AB
Rev A
wiced_ble_4343W - this is a Bluetooth Low Energy (BLE) + Wi-Fi application for the 1DX M.2
module
wiced_bt_passthrough_4343W - this application allows direct communication over UART
between the 1DX M.2 module and a PC. It requires the CyBluetool from Cypress to work and
it will not be covered by this document
Running one of the examples requires the following steps:
1. Import the example application and change flash configuration
2. Patch the example code
3. Configure the example for your environment (e.g. SSID + password for your network)
4. Compile and debug/run
3.4.1 Import wiced_ble_4343W
The following steps will guide you through opening the wiced_ble_4343W application from the SDK.
1. Install the SDK as described in section 3.1 if you have not done so already
2. Click the "Import SDK example(s)…" link in the Quickstart Panel
Select the MIMXRT1060 and evklmxrthGD Click Next 10 o to lhe ro'ect selector. flaw WWWWWMW Mpg I ma ud/allkvlmnekdlm We «mum, lilfilm ‘ _ mm“ [M M: Wm ”New m... mmmmmmmmu ‘‘‘‘‘ m .mwmmm m WWWWW mwmmmm
Getting Started with M.2 Modules and i.MX RT
Page 26
Copyright 2019 © Embedded Artists AB
Rev A
3. Select the MIMXRT1060 and evkimxrt1060. Click Next to go to the project selector.
Select the wiced_b|e_4343W example and make sure to switch irom Semihostt the SDK Deb Console then click Next to o to the Advanced Se I u...“ my.“ Wu” mm.» 1 WW.“ 1‘ , numulnwmy m mimwimmm may nun-was “m (.7 mm :3"me 1N>La1nhhuw summit 5.. , m» was 7mm...“ Mun » Now on the Advanged Settings page, look at the table for the Memory Configuration: van-gm . mm mammm m . W h “.5 m A , 5 I Huh minis" M mill!) will!) mnwsrw
Getting Started with M.2 Modules and i.MX RT
Page 27
Copyright 2019 © Embedded Artists AB
Rev A
4. Select the wiced_ble_4343W example and make sure to switch from Semihost to UART for
the SDK Debug Console then click Next to go to the Advanced Settings Page.
5. Now on the Advanced Settings page, look at the table for the Memory Configuration:
6. Click and change the Size for BOARD_FLASH to 0x00400000 (both iMX RT1052 and
RT1062 have 4MB flash)
7. Click in the table cell for the driver and then on the small button that appears. Change the
Driver for BOARD_FLASH to MIMXRT1050-EcoXiP_ATXP032.cfx using the dropdown
menu.
Getting Started with M.2 Modules and i.MX RT
Page 28
Copyright 2019 © Embedded Artists AB
Rev A
The same flash driver is used for both i.MX RT1052 and RT1062.
8. With all the changes made, click ok and then finish to have MCUXpresso complete the project
setup
3.4.2 Patch
This section describes how to modify the project to be compatible with the features of the iMX RT
Developer's Kit, like the EcoXiP.
The SDK supports hyper flash but the iMX RT Developer's Kit has EcoXip flash from Adesto. Ideally
the EcoXip flash driver should be placed in a new file with _ecoxip in the name but that would require
changes to every project for every IDE in the SDK and that is a huge task. The solution is instead to
replace the file content but keep the filename. This way none of the projects have to be modified.
Download the zip-file from the Resources tab on the product page on Embedded Artists' website. The
name of the file is imxrt1062_ea_files_<date>.zip
Unpack the downloaded zip-file in a temporary directory, for example: c:/temp/ea_files, and
then copy the following files from that directory into the project in MCUXpresso. It is typically easiest to
do this outside of the IDE using for example Windows Explorer.
File to copy
Destination
Comment
pin_mux_ble.c
board/pin_mux.c
Replace existing file
fsl_lpi2c.c
drivers/
New file
fsl_lpi2c.h
drivers/
New file
pca6416.c
source/
New file
pca6416.h
source/
New file
wwd_platform.c
wiced/43xxx_Wi-Fi/WICED/platform/MCU/LPC/WWD/
Replace existing file
wwd_SDIO.c
wiced/43xxx_Wi-Fi/WICED/platform/MCU/LPC/WWD/
Replace existing file
platform_imxrt.c evkmimxrt1060_lle xip/ wlced/43xxx_BLE/wiced_blfimxrumrll Replace existing file Replace existing file m “was.“ .fi'lallu Svsvm‘::>:‘o~.a‘\ln>nm: =5 “van“: “a: w (y . a Masaydkgunmamp . l» . rm Sal-h; l, g M l» 3 mm l, w an,“ l» a mum l w miss l» 3 mm l w I»... l» w «2-wa- l i am. l» w m l» a as l» w Imp l» a ,4...“ . s m...“ l @ beastm‘ l @ magma”). @ rmm @ W IE puma]: @ pawn. IE ”ninth-Hm @ mime V a will,“ l, w m, l» a m I la nun-me ‘bkjlelloisensorvh mammmmnmmvmmmmwmm Heme? flaunijx 111.11“me B minim: n ,7 1- 1 - (mum in mm, mm Samar-mm, m - “may. meme m - m ring meme - sPoxVLinnerdgmilkr: usuaxluux lune; ,, .............................................................................., n u mam. "Mp/«pipm 15 mam. "hearth" )5 mam "Wm" n mum "mfiam" m mum "unnumJ-nmm" 19 mum '15]J:bug_(ansole. 11 n mum. WWW”- 2; mam. wwgmisw 2o mam. "abmnm 2;,,............................................................................... 25 'Dtlinilirm: Z7 .............................................................................., 25 “cu“ w 35m "nu" 29 men“ ASS'NlPfi1234567EE" 3a Mum: [c ucmgxuummmemgm 31 3,,,............................................................................... 33 - vmmyw ;. ..............................................................................,
Getting Started with M.2 Modules and i.MX RT
Page 29
Copyright 2019 © Embedded Artists AB
Rev A
platform_imxrt.c
wiced/43xxx_BLE/wiced_bt/imxrt_port/
Replace existing file
evkmimxrt1060_fle
xspi_nor_config.c
xip/
Replace existing file
After copying the files into the project the IDE must be told to look for the new files. In MCUXpresso
this is done by right clicking the project and selecting Refresh in the menu.
3.4.3 Configure the Example
Before the wiced_ble_4343W example can be used some settings must be changed to allow it to find
and connect to your network. These settings are found near the top of the wiced_ble.c file and looks
like this:
Change the AP_SSID, AP_PASS and AP_SEC to match your network.
Click Build in the Quickslarl Panel o Quin“ M-be. (WV-Ii... 0. mu. $ om. =' l MCUXpresso [DE - Quicksmn Panel ms ijm: zwhninmuosmwkaajpm [Debug] Vflefleu‘lllpoflapmied > I New pvojecl... I Impon SDK :xample(s)u. 3 lmpon prejecfls) from file system... v main-rpm (5an an .ndngymrmjm .vmvfl. Click the "Debug" butlon in me Quickstarl Panel to download Q) Quk... oa= Glob... :x>= Vui... 0. Rm... :5 amt. .2 l MCUXpresso [DE - Quickstan Panel m Projed: ahnimxnloflkaedjpd [Debug] v Cram or inpm a puject I New pmjefl... I Impnn SDK example“)... 3 Import projlifls) horn in: symm... v napalm fl Bulld 1 Clean - nah-Jpnymjm
Getting Started with M.2 Modules and i.MX RT
Page 30
Copyright 2019 © Embedded Artists AB
Rev A
3.4.4 Compile and Run/Debug
To download and run the application, perform these steps:
1. Click Build in the Quickstart Panel
2. The program builds without errors
3. Connect the debug probe (LPC-Link2, ULINK2, J-LINK, etc.) to development platform to your
PC via USB cable. See chapter 4 for details how to connect the debug probe.
4. Open the terminal application on the PC, such as TeraTerm or PuTTY, and connect to the
debug serial port number. Configure the terminal with 115200 baud, 8N1.
You can alter the baud rate be searching for the reference
BOARD_DEBUG_UART_BAUDRATE variable in file: board.h
5. Click the "Debug" button in the Quickstart Panel to download the application to the target.
Run the code by clicking the "Resume" button to Help wgefy‘n» HENEHI @ COM145:115200bp5 - Tera Term < mbed="" vt="" file="" edit="" fielup="" c_ontrnl="" flindow="" flelp="" anan...an...aaaaaaaaaannnunnnnnnnnnnnaaaaaaaannn="" wi—fi="" +="" ble="" example="" acanaan.aantanawawwwwwhhhaukannnnnaaaaaaaaannnnn="" initializing="" wifi="" connection...="" assuming="" the="" m.2="" module="" is="" inserted="" setting="" pca_wl_reg_on_1v8="" —="" high="" asynclnterrupt="" is="" not="" supported="" lan="" mac="" address="" 00:5d:gb:89:eb:76="" lan="" firmware="" v10:="" feb="" 12="" 2018="" 04:08:14="" version="" 7.79.2="" (r="" lan="" clm="" api:="" 12.2="" data:="" 9.10.39="" compiler:="" 1.29.4="" c1="" successfully="" initialized="" wie‘i="" connection="" scanning="" available="" networks.="" .="" .="" scan="" completed="" ’001="" ssid="" :="" guest—544a9e="" nee‘rn="" .="" f:.ei-!h-:a.ai.xfl="" channel="" :="" 11="" joining="" :="" vsgl="" successfully="" joined="" :="" vsgl="" getting="" ip="" address="" from="" dhcp="" server="" ipv4="" address="" got="" from="" dhcp="" :="" 192.168.50.83="" initializing="" ble...="" hello="" sensor="" start="" minimum="" ever="" free="" heap="" size:="" 34352="" setting="" pca_bi_reg_0n_1ve="" —="" high="" hello_sensar_app1ication_init="" wiced_bt_gatt_regi="" s="" te="" t:="" d="" wiced_bt_gatt_db_init="" 0="" wiced_bt_cfg_settings="" .="" device_name="" :mcuxpresso—hello—sensor="" wiced_bt_ble_set_edverti="" s="" ement_dete="" 0="" [hiced_bt_b1e_set_s="" :an_respuns="" e_data="" 0="" advertisement="" state="" change:="" 3="" i="" hiced_bt_start_adve="" rt="" is="" ements="" o="">
Getting Started with M.2 Modules and i.MX RT
Page 31
Copyright 2019 © Embedded Artists AB
Rev A
6. The application is then downloaded to the target and automatically runs to the main() function.
7. Run the code by clicking the "Resume" button to start the application.
8. The wiced_ble_4343W application is now running and some information is displayed on the
terminal. If this is not true, check your terminal settings and connections.
3.4.5 Explanation of the example
The example will start by scanning for nearby Wi-Fi networks and show some information about each
network that is found. It will then connection to the Wi-Fi network specified in section 3.4.3 above.
: https://p\ay.qooq\e.com/store/apps/details?id=no.nordicsemiandmidmcp https://p\ay.qooqlemm/storelapps/details?id=com.punchthrouqh.quhtblueexplorer Devices SCANNER “WNW ‘ No filter Devices STOP SCANNING SCANNER WWW" “INPUT?“ No finer v N/A FCfl319F25326521 5 NOT BONDED 1-102 dBm H152 ms mcuxpresso-hello-sensor 43:43:A1:12:1F:AC ‘ BONDED 1-49 dam Hum: V N/A 24:7B:BZ:F3:BC:DS NOT BONDED 1-101 dBm 9102 ms 7B:77:60:26:FE:BB NOT BONDED 1-96 dBm 9273 ms N/A 04:43:57:3D:5k44 NOTBDNDED A400 dBm HOBms
Getting Started with M.2 Modules and i.MX RT
Page 32
Copyright 2019 © Embedded Artists AB
Rev A
When the network connection has been established it will start BLE advertising with the device name
"mcuxpresso-hello-sensor". Download and install one of the following apps on your phone:
1. nRF Connect: https://play.google.com/store/apps/details?id=no.nordicsemi.android.mcp
2. LightBlue: https://play.google.com/store/apps/details?id=com.punchthrough.lightblueexplorer
Start the nRF Connect app and press the SCAN button:
The Bluetooth device should appear like this:
Click CONNECT to get a list of attributes and information like this:
4°: Leiii' Devices DISCONNKCT MCIIXPRF OSFNSOR . l . CONNECTED BONDED CLIENT SERVER Generic Attrlbute UUID: 0x1ao1 PRIMARY SERVICE This service ls empIy. Generic ACCESS UUID: 0x1800 PRIMARY SERVICE Device Name i UUiD. UXZAOO Properties READ Appearance L UUiD. DXZAO1 Prapemes‘ READ Unknown Service UUIDV 1b7e8251»2877-4103»b46&cf0576562023 PRIMARY SERVICE Device Information UUI D: 0x1 anA BONDED Generic Attribute UU|D' 0x1801 PRIMARY SERVICE This service ls empty. Generic ACCESS UUID: 0X1BOO PRIMARY SERVICE Device Name i UUID: UXZAOU Propemes: READ Value: hellovsensor Appearance L UUID: UxZAm Properties, READ
Getting Started with M.2 Modules and i.MX RT
Page 33
Copyright 2019 © Embedded Artists AB
Rev A
Click the marked button to read the device name. It will look like this:
fl COM145:115200bps - Tera T=rm - MBED VT file [an Setup Cszmml window Help 0-.-0--gnu-alumangina-ana-haunt-annuaaaawn-an-aa Hi-Fi + ELIE exampla Initlalizinq “in Connection... Assumina cue 21.2 module is inserted Satcing PCA_HL_REG_OII_1VB - HIGH Asynclncexx‘up: u no: supponnn Hum MAC Address : ou:9n:65:as:za:7s MILAN Fimuarl : HID. Feb 12 2018 04:03:14 version 7.79.2 (r683798 CY) ml!) 0 Wm cm : MI: 12.2 nun: 5.10.39 Comilez: 1.29.4 cmmpazc: 1.36.! c Successfully Initialized wai Comaccxon Scanning available newuxka. . . scan cmleced Cannot find Bluetooth device when searching with the a A successful initializaiion of 1he M.2 module looks like this: Initializing BLE. . . I e110 Sensor Star: I inimum ever free heap size: 34352 [Setting PCA_BT_REG_ON_1VB - HIGH I ello_sensor_app1icacion_inic wiced_bc_ga:c_register: 0 iced_bt_gatt_db_init D iced_bt_cfg_5ettinga . device_name :mcuxpreuu—hnnu—sensux iced_bt_ble_5et_advertisement_data o iced_bt_ble_:et_:can_respon:e_data o vertisemen: State Change: 3 iced_bt_=tart_advertisements o
Getting Started with M.2 Modules and i.MX RT
Page 34
Copyright 2019 © Embedded Artists AB
Rev A
3.4.6 Troubleshooting
Some things to check if the application is not working as expected:
Program not starting after being flashed.
This is typically because either the flash algorithm/flash size was not changed when importing
the project or the project files were not patched.
Cannot find M.2 module.
A successful detection of the M.2 module looks like this:
If the M.2 module cannot be detected, check that the module is correctly inserted and that all
patches were applied as specified in section 3.3.2 Make sure that the project matches the M.2
module - the wiced_ble_4343W is for 1DX.
Cannot find Bluetooth device when searching with the app.
A successful initialization of the M.2 module looks like this:
If Bluetooth cannot be initialized, check that the M.2 module is correctly inserted and that all
patches were applied as specified in section 3.3.2 Make sure that the project matches the M.2
module - the wiced_ble_4343W is for 1DX.
Dmg cm Jump-ls “ER sac/no amma as: ESMHQ unm ENE] m: ‘ mbug Conn-mm
Getting Started with M.2 Modules and i.MX RT
Page 35
Copyright 2019 © Embedded Artists AB
Rev A
4 Debug Interface
It is strongly recommended to use a debug/JTAG probe during program development. The low-cost
LPC-Link2 is an excellent choice. Keil ULINK2 and ULINKplus, as well as Segger J-LINK, are also
excellent debug probes.
There are two debug interface connectors available on the iMX OEM Carrier board:
J10 this is a Cortex Debug connector. It is a 2x5 pos, 50 mil pitch connector without a
shroud. Be careful when inserting the debug probe cable. Position 1 is in specifically marked
on the PCB silkscreen. It is located in the lower right corner, see Figure 7 below.
The connector supports both the SWD and JTAG interfaces.
J11 this is an ARM Debug connector. It is a 2x10 pos, 100 mil pitch connector with shroud.
Both connector are defined and supports both the SWD and JTAG type of debug interfaces.
Note that in order to enable the JTAG/SWD interface on the i.MX RT, JP5 shall not be
shorted/inserted.
Figure 7 Debug Interfaces on rev B1 iMX OEM Carrier board
Note that due to the powering sequencing requirements on the i.MX RT family, the debug
probe I/O voltage MUST follow the i.MX RT I/O voltage.
Debug Ctrl Jumpers
JP5 - shall not be inserted
Debug Connectors
J10
Note pos 1 in lower left
corner
Debug Connectors
J11
Getting Started with M.2 Modules and i.MX RT
Page 36
Copyright 2019 © Embedded Artists AB
Rev A
The debug adapter must not drive any output higher than the Vcc/Vref voltage (and if that
voltage is zero, then the debug adapter must not drive any output signal). Vcc/Vref is pin 1
on both J10 and J11.
Make sure the debug probe does not have a fixed output voltage, but rather follow Vcc/Vref.
If using LPC-Link2 as debug interface, make sure there is NO jumper inserted in JP2 on the
LPC-Link2.
4.1 J-LINK/J-TRACE Support
This section describes the steps necessary to get the Segger J-TRACE to work with NXP
MCUXpresso and Keil uVision. The same instructions are likely to work for Segger J-LINK as well, but
it has not been verified.
4.1.1 Install J-LINK Software
The software for the J-TRACE/J-LINK is installed in a central location (i.e. outside of the IDEs). The
latest version (v6.60d) as of January 2020 have support for the iMX RT1062 but needs a configuration
change to support the EcoXiP flash memory:
1. Download and install the latest version of Segger's
software: https://www.segger.com/downloads/jlink/JLink_Windows.exe (v6.42, or later). The
rest of the steps will use <jdir> as abbreviation for the folder that the driver was installed
in, for example c:\Program Files (x86)\SEGGER\JLink_V642b\
2. Open <jdir>\JLinkDevices.xml
3. Search for MCIMXRT1062 to find <Device> entries
4. In each of the <Device> entries, change
Loader="Devices/NXP/iMXRT106x/NXP_iMXRT106x_HyperFlash.elf"
to
Loader="Devices/NXP/iMXRT106x/NXP_iMXRT106x_QSPI.elf"
Change the MaxSize="0x04000000" to MaxSize="0x00400000" and then save
the file.
Getting Started with M.2 Modules and i.MX RT
Page 37
Copyright 2019 © Embedded Artists AB
Rev A
4.1.2 MCUXpresso 10.3.0
MCUXpresso will detect the J-LINK / J-TRACE and configure itself correctly.
If this dialog appears:
Then copy the missing file from the folder that was created in see section 3.3.2
(c:/temp/ea_files/)
4.2 Debug Troubleshooting
In some cases the IDE complains about not being able to connect to the target. This is most likely
because the program already running on the target is interfering. The solution is to put the hardware in
ISP mode before starting the flash/debug operation in the IDE. To do this:
1. Push and hold down the ISP enable button
2. Press the Reset button
3. Release the Reset button
4. Wait 1 seconds
5. Release the ISP enable button
If the LPC-Link2 debugger is used then there are some additional things to note:
1. Make sure that the J2 jumper on the LPC-Link2 is not inserted. If the jumper is
inserted/closed then the target will be powered by the LPC-Link2 which might be too much
power for the usb port that the LPC-Link2 is connected to.
2. If the LPC-Link2 is not found by the IDE and you are working on a laptop then try using a
powered usb hub instead.
3. The troubleshooting section in this forum post has a couple of additional things to try:
https://community.nxp.com/thread/388964
4. There is a Using and troubleshooting LPC-Link2 in the Appendix - Additional Hints and Tips of
the User Guide for MCUXpresso IDE. The location of the document is
c:\nxp\MCUXpressoIDE_11.0.0_2516\MCUXpresso_IDE_User_Guide.pdf if the IDE was
installed with the default settings.
I Mm bamwmbm Pf W \ypmhu‘m um mug. : v ,3 v v mags . Avn llble pm: . mu m mum-nus ‘33 , E' ""' '““ mum Wilt“: mm”? mum mmuaisum mum wmm mmwmcflnm MW“ m wmenW 1., when. ‘ m ., wum V 0C" J x» mm 1) walk MC“ ‘Mmcy'w‘s ‘» mam I» Mum ““1" , . mum p wcunix fill/Mm Wham » wcmn "h" .7 mum V V“ 1) wall»: p mu. p mum » mum . mam-mm (mm awn—Wm I: mm. Mum mama" Mmuymwwmtmz-mnr wummm m m an; mm m mm mm) mm m. um um mun nu W m w ml: nm on mm w mm me mm mm mm mm Mm mm mm mu mm m 9.... hp... m5... 5.»... m“. mmcm
Getting Started with M.2 Modules and i.MX RT
Page 38
Copyright 2019 © Embedded Artists AB
Rev A
5 Improved IPERF performance
There are some improvements that can be made to the wiced_iperf example to more than double the
throughput. The changes include rearranging the memory layout, increasing the TCP receive window
and increasing the number of buffers.
The instructions below were written for an older version of the SDK. As of 2.7.0 the memory ranges
and buffers have been modified and as a result the instructions below will result in a too big binary
that cannot be used. The instructions are left here as pointers for the reader that wants to
experiment with performance tweaking themselves.
1) Setup the wiced_iperf example as explained in 3.3 and verify that it works
2) Right click the project and select Properties… from the menu. Expand the tree and locate the
MCU Settings node:
Delete the SRAM_ITC and then change the sizes of SRAM_DTC and SRAM_OC so that it
Type Name Ans [m Site Dnva Nash DOARDJIAS’I Flash W mono MIMXRm-E. ‘ MM SRAM_DTC RAM (km W RAM SRAM_OC MMZ 0.20m om RAM BOARDVSDRAM RAM! memo 0120000130 377 373 1' Region 5 sening: Memory with Nor-a] type, not W outer/inner am: back -/ 37s IW-)RBAA - Am_wu_m(5, mm); m nan-mun - Ann_rru_|usn(o, Am_wu_AP_ruu, I, I, J, 1, a, m_wu_nia:w_5!zi_um); 199* l‘ ---------- W options ---------- 'l 110 /' PBUF_POOL_SIIE: the number of buffers in the em pool. ‘I 111 aifndef PBUF_PO0L_SIZE 112 Mine PBUF_PwL_SIZE 9 113 #endif In the same file (sourcellwipomsh ) locate these lines: 155 /‘ TCP receive window. ‘I 156 Sifndef TOLD!” 157 Mine T(P_lll) (9 ‘ TCP_HSS) 158 sendif 159 0 45;: _attribute_ ((used, section(".isr_vector"))) 425 void (‘ (oust uanectors[])(void) = ( 426 // (ore Level 7 CH7 427 &_vstaek1op, // The initial statk pointer 428 ResetISR, II The reset handler 429 IllI_Handler, // The m1 handler 430 HardFaultJlandler, // The hard fault handler 431 a, // Reserved A11 1: u Darnmlnd
Getting Started with M.2 Modules and i.MX RT
Page 39
Copyright 2019 © Embedded Artists AB
Rev A
looks like below and then save the changes and close the dialog
3) Open board/board.c and locate these lines that control the size of the SRAM_DTC (region 5):
Replace the ARM_MPU_REGION_SIZE_128KB to ARM_MPU_REGION_SIZE_512KB. This
aligns the size with the 0x80000 value entered in the previous dialog for SRAM_DTC.
4) Open source/lwipopts.h and locate these lines:
Change from 9 to 44 buffers in the pool. This is what the increase of SRAM_DTC was used
for.
5) In the same file (source/lwipopts.h ) locate these lines:
Replace the constant 9 with 44
6) Open startup/startup_mimxrt1062.c and locate these lines:
Replace the &_vStackTop with (0x20200000 + 0x1000U) to move the initial stack pointer to
the end of the first block of SRAM_OC. It should look like this after the change:
424 _attrilmte_ ((used, section(”.isr_vector"))) 425 void (‘ const uanectorsUXvoid) = { 426 // (ore Level - (H7 427 (8x20290000 + exlaow), // The initial stack pointer 428 Rese'tISR, II The reset handler 429 IIII_Handler, // The MI handler 430 HardFault_Handler, // The hard fault handler 431 o. // Reserved A)1 n n n HHHHHH .4 646 7 _attrioute_ ((seetion( " .after_ve(tors. reset") )) 647 void neseusnomid) ( 648 649 // Disable interrupts 650 _as- valatile ("W i"); 651 £57 Ilif defined I IKF (INTfi\ 646* _iltribute_ ((s:(tion(".after_ve(tors.reset"))) 647 void ResetlSMvoid) ( 643 649 // nisaole interrupts 659 _asl| volatile ("W i"); 65] 652 ‘((vnlatill unsiyled int ‘)fixma(m) - cousin-on; 65: ‘((vnlatilz unsigned int ‘)Wacw) - mm; // nrc am uitn W m 654 ‘((volatile unsigned int ‘)Wac038) - W; // or: - 512. ITC - a 655
Getting Started with M.2 Modules and i.MX RT
Page 40
Copyright 2019 © Embedded Artists AB
Rev A
7) In the same file (startup/startup_mimxrt1062.c) locate the ResetISR function:
Insert the following lines after the _asm… line:
*((volatile unsigned int *)0x400ac044) = 0x5aaaaaaa;
*((volatile unsigned int *)0x400ac040) = 0x00200006; // DTC RAM with flexram config
*((volatile unsigned int *)0x400ac038) = 0x00A00000; // DTC - 512, ITC - 0
so that it now looks like this:
8) Compile and run. Compare iperf throughput results with, and without, this patch.

Products related to this Datasheet

1MW M.2 MODULE
IMX RT1062 DEVELOPER'S KIT
1DX M.2 MODULE
1LV M.2 MODULE