Let's take your MIMXRT1040-EVK for a test drive. The pictures below show the MIMXRT1040-EVK image.
1.1 Configure Boot Mode
The device has four boot modes (one is reserved for NXP use). The boot mode is selected based on the binary
value stored in the internal BOOT_MODE register. Switch SW4 is used to select the boot mode on the
MIMXRT1040-EVK board.
To boot from the QSPI flash, make sure SW4 is set to 0010.
1.2 Attach the USB Cable
The MIMXRT1040-EVK comes preprogrammed with a demo that will initiate the LED on the board to flash
periodically when plugged in. When the board is tilted, the green LED gradually illuminates based on the
degree of tilt on the X-axis.
2.1 Jump Start Your Design with the MCUXpresso SDK
The MCUXpresso SDK is complimentary and includes full source code under a permissive open-source license
for all hardware abstraction and peripheral driver software.
Click below to download a pre-configured SDK release for the MIMXRT1040-EVK
No problem! The MCUXpresso SDK includes support for other tools such as
IAR,
Keil,
and
command-line GCC.
2.3 PC Configuration
Many of the example applications output data over the MCU UART so you'll want to make sure that the
driver for the board's virtual COM port is installed.
Before you run the driver installer, you MUST have the board plugged into your PC.
With the serial port driver installed, run your favorite terminal application to view the serial
output from the MCU's UART. Configure the terminal to 115200 baud rate, 8 data bits, no
parity and 1 stop bit. To determine the port number of the MIMXRT1040-EVK virtual COM port, open
the device manager and look under the "Ports" group.
Not sure how to use a terminal application? Try one of these tutorials:
Tera Term is a very popular open source terminal emulation application. This program
can be used to display information sent from your NXP development platform's virtual
serial port.
Download Tera Term from SourceForge. After the download, run
the installer and then return to this webpage to continue.
Launch Tera Term. The first time it launches, it will show you
the following dialog. Select the serial option. Assuming your board is plugged
in, there should be a
COM port automatically populated in the list.
Configure the serial port settings (using the COM port number
identified earlier) to 115200 baud rate, 8 data bits, no parity and 1 stop bit.
To do this, go to
Setup -> Serial Port and change the settings.
Verify that the connection is open. If connected, Tera Term
will show something like below in it's title bar.
You're ready to go
PuTTY Tutorial
PuTTY is a popular terminal emulation application. This program can be used to
display information sent from your NXP development platform's virtual serial port.
Download PuTTY using the button below. After the download, run
the installer and then return to this webpage to continue.
Launch PuTTY by either double clicking on the *.exe file you
downloaded or from the Start menu, depending on the type of download you
selected.
Configure In the window that launches, select the Serial radio
button and enter the COM port number that you determined earlier. Also enter the
baud rate, in this
case 115200.
Click Open to open the serial connection. Assuming the board is
connected and you entered the correct COM port, the terminal window will open.
If the configuration
is not correct, PuTTY will alert you.
You're ready to go
3.1 Explore the MCUXpresso SDK Example Code
The MCUXpresso SDK comes with a long list of example application code. To see what's available, browse
to the SDK boards folder of your SDK installation and select your board, the
MIMXRT1040-EVK (/boards/evkMIMXRT1040) or MIMXRT1040-EVK (/boards/MIMXRT1040EVK).
To learn more about specific example code, open the readme.txt file in an example’s directory.
3.2 Build, Run and Debug MCUXpresso SDK Examples
If one or more of the demo applications or driver examples sounds interesting, you're probably wanting
to know how you can build and debug yourself. The getting started with MCUXpresso SDK
guide provides easy, step-by-step instructions on how to configure, build and debug demos for all
toolchains supported by the SDK.
Use the guide below to learn how to open, build and debug an example application using MCUXpresso IDE.
Using a different toolchain?
Run a demo application using IAR
1. Build an example application
The following steps guide you through opening the hello_world example
application. These steps may change slightly for other example applications
as some of these applications
may have additional layers of folders in their path.
If not already done, open the desired demo application workspace.
Most example application workspace files can be located using the
following path:
/boards///
/iar
Using the the hello_world demo as an example, the path is located in:
Select the desired build target from the drop-down.
For this example, select the “hello_world – Debug”
target.
To build the demo application, click the “Make” button,
highlighted in red below.
The build completes without errors.
2. Run an example application
To download and run the application, perform these steps:
Connect the development platform to your PC via USB cable.
Open the terminal application on the PC, such as PuTTY or TeraTerm,
and connect to the debug COM port. Configure the terminal with these
settings:
a. 115200 baud rate, (reference BOARD_DEBUG_UART_BAUDRATE
variable in board.h file)
b. No parity
c. 8 data bits
d. 1 stop bit
In IAR, click the "Download and Debug" button to download the
application to the target.
The application is then downloaded to the target and automatically
runs to the main() function.
Run the code by clicking the "Go" button to start the application.
The hello_world application is now running and a banner is displayed
on the terminal. If this is not true, check your terminal settings
and connections.
Run a demo using Keil®
MDK/µVision®
1. Install CMSIS device pack
After the MDK tools are installed, Cortex®
Microcontroller Software Interface Standard (CMSIS) device packs must be
installed to fully support the device from a
debug perspective. These packs include things such as memory map
information, register definitions and flash programming algorithms.
Follow these steps to install the
MIMXRT105x CMSIS pack.
Download the iMXRT pack
After downloading the DFP, double click to install it.
2. Build an example application
The following steps will guide you through opening the hello_world
application. These steps may change slightly for other example
applications as some of these applications may
have additional layers of folders in their path.
If not already done, open the desired example application
workspace in:
/boards///
/mdk
The workspace file is named .uvmpw, so for this
specific example, the actual path is:
To build the demo project, select the "Rebuild" button,
highlighted in red.
The build completes without errors.
3. Run an Example Application
To download and run the application, perform these steps:
Connect the development platform to your PC via USB cable.
Open the terminal application on the PC, such as PuTTY or
TeraTerm, and connect to the debug serial port number. Configure
the terminal with these settings:
115200 baud rate, (reference BOARD_DEBUG_UART_BAUDRATE
variable in board.h file)
No parity
8 data bits
1 stop bit
After the application is properly built, click the "Download"
button to download the application to the target.
To debug the application, click the “Start/Stop Debug
Session” button, highlighted in red.
Run the code by clicking the "Run" button to start the
application.
The hello_world application is now running and a banner is
displayed on the terminal. If this is not true, check your
terminal settings and connections.
Running a demo using MCUXpresso IDE
1. Import the MCUXpresso SDK
Open MCUXpresso IDE
Choose a directory on your computer as a workspace.
Switch to the Installed SDKs view within the MCUXpresso IDE window.
Open Windows Explorer, and drag and drop the EVK-MIMXRT1040 SDK zip
file into the Installed SDKs view.
You will get a prompt as follows. Click on OK to
continue the import:
The installed SDK will appear in the Installed SDKs view as shown
below:
2. Build an Example Application
The following steps will guide you through opening the hello_world
example.
Find the Quickstart Panel in the lower left hand corner
Then click on Import SDK examples(s)…
Click on the evkMIMXRT1040 board to select that you want to
import an example that can run on that board, and then click on
Next.
Use the arrow button to expand the demo_apps
category, and then click the checkbox next to
hello_world to select that project. Make sure
UART is selected as the SDK Debug Console.
Then, click on Finish.
Now build the project by clicking on the project name and then
click on the Build icon.
You can see the status of the build in the Console tab.
3. Run an Example Application
Now that the project has been compiled, you can now flash it to the
board and run it.
2. Make sure the USB cable is plugged into the OpenSDA debug
connector on the MIMXRT1040-EVK, and click on Debug
in the QuickStart Panel.
MCUXpresso IDE will probe for connected boards and should find
the CMSIS-DAP debug probe that is part of the integrated OpenSDA
circuit on the MIMXRT1040-EVK. Click on
OK to continue.
The firmware will be downloaded to the board and the debugger
started.
Open up a terminal program and connect to the COM port the board
enumerated as. Use 115200 baud 8 data bits, no parity and 1 stop
bit.
Start the application by clicking the "Resume" button:
The hello_world application is now running and a banner is
displayed on the terminal. If this is not the case, check your
terminal settings and connections.
Use the controls in the menu bar to pause, step into, and step
over instructions, and then stop the debugging session by click
on the Terminate icon:
Running a demo using Arm
1. Set Up Toolchain
This section contains the steps to install the necessary components
required to build and run a KSDK demo application with the Arm GCC
toolchain, as supported by the Kinetis
SDK. There are many ways to use Arm GCC tools, but this example
focuses on a Windows environment. Though not discussed here, GCC
tools can also be used with both Linux
OS and Mac OSX.
Install GCC Arm Embedded Toolchain
Download and run the installer from launchpad.net/gcc-arm-embedded. This is the actual
toolchain (i.e., compiler, linker, etc.). The GCC toolchain should
correspond to the latest supported version, as described in the
Kinetis SDK Release Notes.
Install MinGW
The Minimalist GNU for Windows (MinGW) development tools provide a set
of tools that are not dependent on third party C-Runtime DLLs (such as
Cygwin). The build environment
used by the KSDK does not utilize the MinGW build tools, but does
leverage the base install of both MinGW and MSYS. MSYS provides a basic
shell with a Unix-like interface and
tools.
Run the installer. The recommended installation path is C:\MinGW,
however, you may install to any location.
NOTE
The installation path cannot contain any spaces.
Ensure that the "mingw32-base" and "msys-base" are selected under
Basic Setup.
Click "Apply Changes" in the "Installation" menu and follow the
remaining instructions to complete the installation.
Add the appropriate item to the Windows operating system Path
environment variable. It can be found under
Control Panel -> System and Security -> System ->
Advanced System Settings in the "Environment
Variables..." section. The path is:
\bin
Assuming the default installation path, C:\MinGW, an
example is shown below. If the path is not set correctly, the
toolchain does not work.
NOTE
If you have "C:\MinGW\msys\x.x\bin" in your PATH variable (as
required by KSDK 1.0.0), remove it to ensure that the new
GCC build system works correctly.
Add a New Environment Variable for ARMGCC_DIR
Create a new system environment variable and name it
ARMGCC_DIR. The value of this variable should point to the Arm GCC
Embedded tool chain installation path, which,
for this example, is:
C:\Program Files (x86)\GNU Tools Arm Embedded\4.9 2015q3
Reference the installation folder of the GNU Arm GCC Embedded tools
for the exact path name of your installation.
Install CMake, ensuring that the option "Add CMake to system
PATH" is selected when installing. It's up to the user to
select whether it's installed into the PATH for all
users or just the current user. In this example, the
assumption is that it's installed for all users.
Follow the remaining instructions of the installer.
You may need to reboot your system for the PATH changes to
take effect.
2. Build an Example Application
To build an example application, follow these steps.
1. If not already running, open a GCC ARM Embedded tool chain
command window. To launch the window, from the Windows operating
system Start menu, go to “Programs
-> GNU Tools ARM Embedded ” and select
“GCC Command Prompt”.
Change the directory to the example application project
directory, which has a path like this:
Type “build_flexspi_nor_debug.bat” on the command
line or double click on the "build_flexspi_nor_debug.bat" file
in Windows operating system Explorer to perform
the build. The output is shown in this figure:
3. Run an Example Application
This section describes steps to run a demo application using J-Link GDB
Server application. To perform this exercise, two things must be done:
Make sure that either:
The OpenSDA interface on your board is programmed with the
J-Link OpenSDA firmware. If your board does not support
OpenSDA, then a standalone J-Link pod is required.
You have a standalone J-Link pod that is connected to the debug
interface of your board. Note that some hardware platforms
require hardware modification in order to
function correctly with an external debug interface.
After the J-Link interface is configured and connected, follow these
steps to download and run the demo applications:
This board supports the J-Link debug probe. Before using it,
install SEGGER software, which can be downloaded from
segger homepage
Connect the development platform to your PC via USB cable
between the OpenSDA USB connector and the PC USB connector. If
using a standalone J-Link debug pod, also connect
it to the SWD/JTAG connector of the board.
Open the terminal application on the PC, such as PuTTY or
TeraTerm, and connect to the debug serial port number. Configure
the terminal with these settings:
115200 baud rate, (reference BOARD_DEBUG_UART_BAUDRATE variable
in board.h file)
No parity
8 data bits
1 stop bit
Open the J-Link GDB Server application. Go to the SEGGER install
folder, for example, C:\Program Files (x86)\SEGGER\JLink_V616f. Open
the command windows here, for Debug and
Release targets, and use the command "JLinkGDBServer.exe". Note: for
the sdram_debug and sdram_release targets, use the command
"JLinkGDBServer.exescriptfile
/boards/evkMIMXRT1040/demo_apps/hello_world/evkMIMXRT1040_sdram_init.jlinkscript
".
The target device selection chosen for this example is the Cortex-M7.
After it is connected, the screen should resemble this figure:
If not already running, open a GCC ARM Embedded tool chain window.
To launch the window, from the Windows operating system Start menu,
go to “Programs -> GNU Tools
ARM Embedded ” and select “GCC Command
Prompt”.
Change to the directory that contains the example application output.
The output can be found in using one of these paths, depending on
the build target selected:
Run the command “arm-none-eabi-gdb.exe
.elf”. For this example, it is
“arm-none-eabi-gdb.exe hello_world.elf”.
Run these commands:
"target remote localhost:2331"
"monitor reset"
"monitor halt"
"load"
The application is now downloaded and halted at the reset vector.
Execute the “monitor go” command to start the demo
application.
The hello_world application is now running and a banner is displayed on
the terminal. If this is not true, check your terminal settings and
connections.
Boot Options
Learn more about the different boot sources supported by the i.MX RT family, including Execute in Place
(XIP).
Boot Options for i.MX RT Crossover MCUs
Security
i.MX RT Secure Boot Lab Guide -
Learn how to use
the secure boot features of the i.MX family, including how to generate key pairs and certificates,
program fuses using leftosb tool, and sign firmware.
One-stop secure boot tool:
NXP-MCUBootUtility v1.0.0 is released
- NXP-MCUBootUtility is a GUI tool specially designed for NXP MCU secure boot. It includes all the
features of NXP’s official security enablement toolset with support for full graphical user
interface operation.
External Memory
How to Enable Boot from QSPI Flash - This document
describes how to use Flashloader step by step to program a bootable image into the external storage
device either by using Open SDA or MfgTool.
Get
Your Motor Spinning with i.MX RT
– This presentation covers the MCU requirements, motor control basics and framework to spin a BLDC, PMSM
or ACIM motor and how to implement motor control on the i.MX RT.
PMSM Field-Oriented Control on MIMXRT10xx EVK User’s
Guide
- Step-by-step guide on how to open, compile, debug, and run Permanent Magnet Synchronous Motor (PMSM)
projects in most common IDEs, such as IAR Embedded Workbench®, MCUXpresso, and
Vision® Keil® IDEs. It also describes how to turn the NXP Freedom PMSM power stage
and the i.MX RT10xx evaluation kit into a complete motor control reference design, as
well as initializing the FreeMASTER GUI tool for controlling motor-control applications.
eIQ
Glow Lab for i.MX RT – Learn how
to use the Glow neural network compiler tool by running a handwritten digit recognition
model example. A step-by-step video covering this lab is also available below
Getting started with Glow Neural Network Compiler:
Learn more about the RT1040 with design tips, training documents, and the NXP Community. If you need
additional help, contact NXP
Support.
Design Tips
Hardware Design Tips for
i.MX RT Crossover MCUs -
Helpful hints to get your first i.MX RT1040 design off to a good start, including using the power
management unit, different boot modes and configuration options.
Get Your Motor Spinning with i.MX RT - This
presentation covers the MCU requirements, motor control basics and framework to spin a BLDC, PMSM or
ACIM motor and how to implement motor control on the i.MX RT.
How to Create Graphics with i.MX RT - Learn
how to
develop graphics on the i.MX RT, which supports product designs with advanced multimedia for GUI and
enhanced human machine interface (HMI) experience.
Voice Solutions with i.MX RT - Introduction
to the
features, architecture, cost and ease of use benefits for the MCU Alexa Voice solution. This session
also shows the Out-of-Box Experience of on-boarding Alexa using Wi-Fi as well as
interacting with Alexa using a cost effective far-field Implementation.
Build Your First Zephyr Application on i.MX
RT
- Learn how to get started with the Zephyr Project on i.MX RT. Gain hands-on experience with the
Zephyr build environment and program your first Zephyr application onto a board.
Communities
Connect with other engineers and get expert advice on designing with i.MX RT Crossover MCUs on one of our
community sites.