Toolbox setup and how to run an application

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Toolbox setup and how to run an application

Toolbox setup and how to run an application

 

1

Table of Contents


2

Introduction


This article walks through the complete process of setting up the NXP Model-Based Design Toolbox (MBDT) and running a first application on NXP hardware. Before starting the installation, make sure that the prerequisite toolboxes are available in MATLAB. By the end of this guide, the reader will have a fully functional MBDT environment and will have successfully generated, compiled, and deployed embedded C code from a Simulink model to NXP hardware.

3

Overview


This guide begins with the installation prerequisites and required toolboxes, then continues with the MATLAB Add-On Explorer flow for installing NXP_Support_Package_S32K3. After the support package is installed, the guide explains how to launch the multistep installer, verify the required toolboxes and installation path, download the toolbox package from NXP, and complete the toolbox installation before running the first application.

Installation Scope and Workflow

This article focuses on practical installation flow required to start working with the NXP Model-Based Design Toolbox and run a first example application. It covers the software prerequisites, the toolbox setup sequence, and the validation steps needed before opening and deploying a model on the target board. The installation content in this guide should use the current multistep installer flow.

Target Audience

This article is intended for engineers and technical professionals who want to begin developing embedded applications for NXP hardware using a Model-Based Design workflow. The main target audience includes:

  • Embedded software engineers
  • MATLAB / Simulink developers evaluating NXP hardware
  • Control and algorithm engineers
  • Students and academic researchers using NXP evaluation boards
  • Model-Based Design engineers
  • Hardware integration engineers
4

Context


3.1 Prerequisites

Before starting the installation, verify that the following prerequisite toolboxes and setup conditions are met:

  • MATLAB installed - Required by the support package and multistep installer flow.
  • Simulink installed - Required for model-based development and Simulink example execution.
  • Embedded Coder installed - Required for embedded C code generation from Simulink models.
  • MATLAB Coder installed - Required by the current S32K3 support package prerequisites.
  • Simulink Coder installed - Required by the current S32K3 support package prerequisites.
  • Embedded Coder Support Package for ARM Cortex-M Processors installed - Required by the installer verification step and target support flow.
  • NXP account - Required to access the NXP download page and retrieve the toolbox package.
  • Short local installation path - The installation path should be local, short, and should not contain whitespace to avoid setup issues.image1.png

Figure 1 - MATLAB Add-On Manager confirming requirement are installed

3.2 Toolbox Setup

NXP's Model-Based Design Toolbox is delivered as a MATLAB Toolbox Package that can be installed offline or online from MathWorks Add-ons. The recommended installation path uses the NXP Support Package, a graphical wizard that guides through download, installation, and license activation in a single workflow.

Note: Throughout this guide, the placeholder {platform} refers to the NXP MCU family targeted by the toolbox (for example S32K3, S32K1, S32M2, MPC57XX, etc.). Each family has its own dedicated Support Package and Toolbox in the MATLAB Add-On Explorer. When following the steps below, replace {platform} with the identifier matching the hardware family in use, for instance, for the S32K3 evaluation boards, the script name becomes NXP_Support_Package_s32k3.m and the path command becomes mbd_s32k3_path.

Step 1 - Install NXP Support Package from MATLAB Add-On Explorer

Install the current NXP support package directly from the MATLAB Add-On Explorer. This package provides the multistep installer flow used to verify prerequisites, download the toolbox, and guide the installation for S32K3.

In MATLAB, navigate to Home → Add-Ons → Get Add-Ons.

image2.png

Figure 2 - Open the Add-On Explorer from the MATLAB Home tab

Search for NXP_Support_Package_S32K3 in the Add-On Explorer.

image3.png

Figure 3 - Search results for NXP_Support_Package_S32K3 in the Add-On Explorer

Open the package page and click Add to start the installation.

image4.png

Figure 4 - Open the NXP_Support_Package_S32K3 page and click Add

Review the license agreement for NXP_Support_Package_S32K3 and click I Accept.

image5.png

Figure 5 - License agreement shown during installation of NXP_Support_Package_S32K3

Wait for the installation to complete. When finished, the Getting Started Guide opens automatically.

image6.png

Figure 6 - Support package installation completed successfully

In the MATLAB Command Window, run sp_s32k3.nxp.setup(); to launch the multistep installer.

sp_s32k3.nxp.setup();

image7.png

Figure 7 - Run sp_s32k3.nxp.setup(); from the MATLAB Command Window

Step 2 - Use the multistep installer to download and install the toolbox

The multistep installer guides you through prerequisite verification, toolbox download, installation, activation, and access to the documentation for S32K3.

image8.png

Figure 8 - Welcome page of the S32K3 multistep installer

In the installer, continue to the download step. On the NXP website, review the software terms and conditions and click I Agree before downloading the toolbox package. If the product download page does not open automatically, sign in to your NXP account and open the Product Download page for the required S32K3 toolbox release or click the link from Download page of the S32K3 multistep installer.

image9.png

Figure 9 - Download page of the S32K3 multistep installer

image10.png

Figure 10 - Accept the NXP software terms and conditions before downloading

Download the toolbox package from the Product Download page. The installer accepts both .zip and .mltbx files.

image11.png

Figure 11 - Product Download page for the S32K3 MBDT package

The setup verification step checks whether all required toolboxes are installed in MATLAB and whether the installation path is valid for the S32K3 toolbox setup. If any dependency is missing or an unsupported version is detected, resolve the issue before continuing to the download and installation steps.

image12.png

Figure 12 - Setup verification page showing required toolboxes and installation path checks

Important: It is recommended to install MATLAB and the NXP Toolbox into a location that does not contain special characters, empty spaces, or mapped drives. Use a short local path whenever possible.

After downloading the package, return to the installer and continue with the local file selection step. Browse to the downloaded archive or toolbox package and click Install to continue. The installer accepts both .zip and .mltbx files.

image13.png

Figure 13 - Browse to and download the S32K3 MBDT package from the Product Download page

image14.png

Figure 14 - Accept the license agreement for NXP_MBDToolbox_S32K3

Accept the toolbox license agreement to allow MATLAB to complete the MBDT installation.

image15.png

Figure 15 - Toolbox installation in progress

After the installation is complete, use the Add-On Manager context menu to open the installed toolbox folder if you need to inspect the package contents or access installed files directly.

Wait until the installation finishes. The process may take several minutes depending on the system configuration and package size.

image16.png

Figure 16 - Open the installed toolbox location from MATLAB Add-On Manager

Step 4 - Set the Path for Toolchain Generation

The MBDT uses Simulink's toolchain mechanism to enable automatic code generation with Embedded Coder. When installed as a MATLAB add-on, the toolbox path is configured automatically. If manual configuration is still required in your environment, run the platform path script from the installation directory.

If manual setup is required, in MATLAB change the Current Directory to the toolbox installation folder:

..\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_{platform}\

Then run the configuration script:

mbd_{platform}_path

image17.png

Figure 17 - Output of the mbd_{platform}_path script in the MATLAB Command Window

3.3 How to Run an Application

With the toolbox installed and the compiler configured, the following steps demonstrate how to open, build, and deploy the LED blinky example - the embedded equivalent of Hello World to an NXP evaluation board.

Open an Example Model

Open MATLAB and start Simulink by typing simulink in the Command Window (or by clicking the Simulink button on the Home tab).

In the Simulink Start Page, open the Simulink Library Browser (View → Library Browser, or press Ctrl+Shift+L).

In the Library Browser tree, expand NXP Model-Based Design Toolbox for {platform} to confirm that the NXP blocks are available. This validates that the toolbox is properly registered with Simulink.

Open the Example Projects tab from the Simulink Start Page, it lists every example shipped with the MBDT, grouped by peripheral (ADC, CAN, DIO, PWM, UART, etc.). Browse the list, select the example matching your hardware (for instance s32k3xx_dio_s32ct for the LED blinky on FRDM-A-S32K312 / FRDM-A-S32K344), and click Open to load the model.

image18.png

Figure 18 - MBDT Examples Library available from the Simulink Library Browser

Open the example model (.slx/.mdl file).

Configure the Target Hardware

image19.pngFigure 19 - Model Settings 

image20.png

Figure 20 - Code Generation

Tip: Example models that ship with the MBDT are pre-configured for a specific evaluation board. Always verify the hardware target matches your physical board before building.

Build and Deploy

  • Connect the NXP evaluation board to the PC via USB.
  • In Simulink, open the Hardware tab and click Build, Deploy & Start (or use Ctrl+B).
  • Monitor the MATLAB Diagnostic Viewer for build status messages.

Verify on Hardware

  • Confirm that the application runs on the target hardware as expected - for example, observe the LED blinking at the rate defined in the model.
  • If the application produces serial output, open a terminal and verify the expected data on the communication port.
  • Use debugging or monitoring tools to inspect variable values and system signals from the running application in real time.

 

 

6

Conclusion


This article described the complete setup of the NXP Model-Based Design Toolbox: from installation and compiler configuration to building and deploying a first application to NXP hardware.

The next article in the series focuses on the Toolbox Workflow, presenting in detail the end-to-end development flow with the MBDT, from configuring a Simulink model with NXP blocks, through code generation with Embedded Coder, to building, deploying and validating the resulting application on NXP hardware.

无评分
版本历史
最后更新:
星期三
更新人: