You are on page 1of 12

Model-Based Design Toolbox

i.MX RT 1xxx Series

Quick Start Guide For


How To Create A New Project

Automatic Code Generation for the i.MX RT 1xxx Family of Processors


Version 1.3.0

Target Based Automatic Code Generation Tools


For MATLAB™/Simulink™/Stateflow™ Models working with Simulink Coder ™ and Embedded Coder ®

1-1
© 2022 NXP Semiconductors. All rights reserved
Summary

1 Create an Empty Simulink Project ..................................................................................... 1-3


2 Deploy on NXP Hardware ................................................................................................. 2-8

Model-Based Design Toolbox i.MX RT 1xxx Series 1-2


Quick Start Guide for How to Create a New Project
1 Create an Empty Simulink Project
Below are the steps to follow when creating an empty Simulink model to be deployed on i.MX
RT1xxx evaluation boards.

Step 1: Create a workspace folder on the user machine and switch MATLAB current folder to
point to this workspace location:

Step 2: Create a Simulink Blank Model.

Model-Based Design Toolbox i.MX RT 1xxx Series 1-3


Quick Start Guide for How to Create a New Project
Step 3: Save and name your new model (E.g. mytest.slx).

Step 4 (Method 1): Choose the NXP IMXRT hardware board from the Model Settings in the
MODELING tab.

Step 4.1: Open Model Settings -> Hardware Implementation menu

Step 4.2: Select the NXP target from Hardware Board. This selection should match the
evaluation kit you plan to test the code for. After the selection is made, press the
Apply button.

Model-Based Design Toolbox i.MX RT 1xxx Series 1-4


Quick Start Guide for How to Create a New Project
After this step, in the user workspace, next to the Simulink model file the user will see new
files/folders:

- A file with extension <model_name>Config.mex – this is the file created with MCUX
Configuration Tool that is used for pins, clock, and peripherals initialization. This .mex
file will have enabled the peripherals that are supported by the toolbox. Starting from this
file the user can change the default configuration for any of the peripheral instances (add
new instances, disable instances, etc.) and also any of the configured pins.
- A folder with naming pattern <model_name>Config - this folder will have a structure
that is similar to the MCUXpresso IDE projects, and will contain the SDK files that are
needed to build the model and generate a binary application that will run on the board.
-

The user can now add Simulink blocks in the model from the NXP i.MXRT1xxx Simulink library
from Simulink Library Browser:

Model-Based Design Toolbox i.MX RT 1xxx Series 1-5


Quick Start Guide for How to Create a New Project
Choose the desired block to add to the model:

Step 4 (Method 2): An alternative method for the user to create the project files is to access the
Library Browser, click on NXP Model Based Design Tollbox for i.MX RT MCUs and choose
the desired blocks for the new model.

Model-Based Design Toolbox i.MX RT 1xxx Series 1-6


Quick Start Guide for How to Create a New Project
After the desired blocks were added the model needs to be saved. Then, in the workspace the
.mex file will appear.

Model-Based Design Toolbox i.MX RT 1xxx Series 1-7


Quick Start Guide for How to Create a New Project
2 Deploy on NXP Hardware
After the Simulink model is completed, before Build and Deploy, the user should follow the next
steps:

Step 1: Select the Download method from Hardware Implementation in Model Settings.

The default Download method (without the need for additional software and/or hardware probes)
is OpenSDA. For this, the user must select the Drive on his/her machine where the OpenSDA
firmware of the board is mapped after the NXP evaluation board is plugged in via USB.

Model-Based Design Toolbox i.MX RT 1xxx Series 2-8


Quick Start Guide for How to Create a New Project
Another available download method is via JTAG, using a JLink debug probe. For this, the user
must browse to the location of the JLink.exe program that is used by the toolbox to write the
application via JTAG.

Model-Based Design Toolbox i.MX RT 1xxx Series 2-9


Quick Start Guide for How to Create a New Project
Step 2: In the Simulink model click on the APPS tab and select Embedded Coder

Step 3: A new Tab called C CODE will appear. Here, to deploy the model on the hardware press
the Build button. If the user wishes to only generate the code, press the arrow under the build
button and press on Generate Code.

Model-Based Design Toolbox i.MX RT 1xxx Series 2-10


Quick Start Guide for How to Create a New Project
Step 4: After the code is generated and downloaded on the board a window will pop up and tell
you to restart the evaluation board. Restart the board and then press OK.

Congratulations! You have successfully created and deployed your Simulink model to the
hardware.

Model-Based Design Toolbox i.MX RT 1xxx Series 2-11


Quick Start Guide for How to Create a New Project
Information in this document is provided solely to enable system and software implementers to
How to Reach Us: use NXP Semiconductor products. There are no express or implied copyright licenses granted
hereunder to design or fabricate any integrated circuits or integrated circuits based on the
Home Page: information in this document.
www.nxp.com
Web Support: NXP Semiconductor reserves the right to make changes without further notice to any products
herein. NXP Semiconductor makes no warranty, representation or guarantee regarding the
www.nxp.com/support
suitability of its products for any particular purpose, nor does Freescale Semiconductor assume
any liability arising out of the application or use of any product or circuit, and specifically
disclaims any and all liability, including without limitation consequential or incidental damages.
“Typical” parameters that may be provided in NXP Semiconductor data sheets and/or
specifications can and do vary in different applications and actual performance may vary over
time. All operating parameters, including “Typicals”, must be validated for each customer
application by customer’s technical experts. NXP Semiconductor does not convey any license
under its patent rights nor the rights of others. NXP Semiconductor products are not designed,
intended, or authorized for use as components in systems intended for surgical implant into the
body, or other applications intended to support or sustain life, or for any other application in
which the failure of the NXP Semiconductor product could create a situation where personal
injury or death may occur. Should Buyer purchase or use NXP Semiconductor products for any
such unintended or unauthorized application, Buyer shall indemnify and hold NXP
Semiconductor and its officers, employees, subsidiaries, affiliates, and distributors harmless
against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of,
directly or indirectly, any claim of personal injury or death associated with such unintended or
unauthorized use, even if such claim alleges that NXP Semiconductor was negligent regarding
the design or manufacture of the part.

MATLAB, Simulink, Stateflow, Handle Graphics, and Real-Time Workshop are registered
trademarks, and TargetBox is a trademark of The MathWorks, Inc.
Microsoft and .NET Framework are trademarks of Microsoft Corporation.
Flexera Software, Flexlm, and FlexNet Publisher are registered trademarks or trademarks of
Flexera Software, Inc. and/or InstallShield Co. Inc. in the United States of America and/or other
countries.
NXP, the NXP logo, CodeWarrior and ColdFire are trademarks of NXP Semiconductor, Inc.,
Reg. U.S. Pat. & Tm. Off. Flexis and Processor Expert are trademarks of NXP Semiconductor,
Inc. All other product or service names are the property of their respective owners

©2021 NXP Semiconductors. All rights reserved.

© 2021 NXP Semiconductors. All rights reserved

You might also like