NXP Model-Based Design Tools Knowledge Base

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NXP Model-Based Design Tools Knowledge Base

Discussions

Sort by:
In this video we discuss about power stage (DevKit MotorGD) configuration that involves the configuration and initialization of the MC34GD3000 FET pre-driver via SPI commands and the setup of the FlexPWM peripheral to generate PWM commands to the inverter MOSFETs via pre-driver MC34GD3000.   We discuss about: - Pre-driver MC34GD3000 initialization sequence; - Pre-driver MC34GD3000 programming via SPI; - How to configure and test the FlexPWM peripheral; - How to test and validate the SPI communication between MPC5744P and MC34GD3000; NOTE: Chinese viewers can watch the video on YOUKU using this link 注意:中国观众可以使用此链接观看YOUKU上的视频
View full article
General Tip of the day Tip of the day  Licensing MBDT license missing error  Toolbox functionality Registers, Linkers not displaying options  Profiler/Execution S32k144 Simulation Time and Profiler  Peripherals How to put MCU into sleep? Apps Motor Control
View full article
PMSM Motor Control Application for S32K396 with MBDT and Custom Code Examples were designed on XS32K396-BGA-DC EVB and 3-phase PMSM pre-driver board(with connection cable) MATLAB Simulink-based project (s32k396_pmsm_mc_mbdt) is build using Model-Based Design Toolbox (MBDT) and can be downloaded from NXP Model-Based Design Toolbox for S32K3xx - version 1.5.0 or newer releases. For all models file and document, please find the attachment. 1. Introduction This article aims to introduce and demonstrate how a PMSM control algorithm targeting the S32K396 MCU can be designed inside the Simulink ® environment. The demo introduced by this article is built using (but is not part of) the NXP ® Model-Based Design Toolbox (MBDT) for S32K3xx, hence it has not been fully tested inside the MBDT development environment, neither been passed through the verification and validation processes imposed for the applications delivered within the toolbox. The demo presented in the following article is just an example of how NXP's software and hardware products can be used for developing motor control algorithms, using the MATLAB ® and Simulink ecosystem capabilities. The S32K39 is an Arm ® Cortex ® -M7 based Microcontroller series which runs up to 320 MHz, which contains an advanced motor control co-processor (eTPU) designed with the purpose of offloading the main CPU from motor control tasks, and a high-resolution PWM. It is developed to meet the next generation SiC traction inverter requirements and to enable high efficiency and low latency features. Also, S32K39 is suitable for applications like Automotive Inverter, On-board Charger (OBC), and High-performance Battery Management System (BMS). The NXP Model-Based Design Toolbox (MBDT) is a comprehensive collection of tools that plug into the MATLAB and Simulink model-based design environment to support verification, validation, and rapid prototyping of complex algorithms for real targets based on NXP microcontrollers and processors. For enabling hardware access from the Simulink applications development environment, MBDT offers integration with Real-Time Drivers (RTD) for controlling the system and peripheral devices. The configuration of the on-board peripherals, pins, and clocks, is realized by enabling the integration with dedicated configuration tools, like NXP’s S32 Configuration Tools delivered inside the toolbox, and EB Tresos. MBDT delivers a library of Simulink blocks, which implement functionalities of MCU peripherals and generate code on top of specific drivers' functions. Together with these, the toolbox integrates the AMMCLIB library, for facilitating the development of motor control algorithms. The toolbox offers support for software-in-the-loop and processor-in-the-loop (SIL and PIL) development workflows, allowing the design, verification and validation at each development step. It also generates and deploys code automatically, from Simulink models, to start up the MCU and run complex applications, which enables control engineers and embedded developers to shorten project life cycles. Hence, by using NXP's Model-Based Design Toolbox, complex algorithms, which can be modelled, simulated and verified hardware independently, using the rich ecosystem of solutions the MathWorks ® environment provides, can be tailored to become hardware aware for targeting specific NXP platforms. The S32K39 is an Arm Cortex-M7-based Microcontroller series, which contains an advanced motor control co-processor (eTPU), a high-resolution PWM, and runs up to 320 MHz. It is developed to meet the next-generation SiC traction inverter requirements and to enable high efficiency and low latency features. Also, S32K39 is suitable for applications like Automotive Inverter, On-board Charger (OBC), and High-performance Battery Management System (BMS). This demo aims to give a quick start guide on building up a motor control system with NXP MBDT on S32K396. It contains the environment setup, module configuration, system initialization, and interruption structure, Permanent Magnet Synchronous Motor (PMSM) control algorithm, and FreeMASTER configuration. 2. Hardware and Software Setup For more details on how this can be achieved, the following diagram is introduced, mapping the PMSM algorithm on top of the existing hardware for the S32K396 MCU. The App, Algorithm, Data processing section can be implemented using Simulink libraries blocks, AMMCLib blocks and Simulink custom code functionalities to include eTPU drivers that address this co-processor access and control. The MBDT section is covered by the blocks provided by the toolbox, ensuring hardware access to the peripherals implied in such applications, while the MCU, Motor, circuits refers to the hardware elements used for the design.  The following picture presents the application mapping of the software and hardware used to develop PMSM Motor Control on S32K396: Figure 2.1 Application mapping of software and hardware used to develop PMSM Motor Control on S32K396 For an overview of the elements necessary for modeling such a diagram inside a Simulink model, the following picture is introduced, showcasing the software components and functionalities that can be used inside this scenario, which will be furtherly detailed in the following sections. Figure 2.2 Software Components for modeling the PMSM Motor Control on S32K396 This demo aims to give a quick start guide on building up a motor control system with NXP MBDT on S32K396. It contains the environment setup, module configuration, system initialization, and interrupts structure, Permanent Magnet Synchronous Motor (PMSM) control algorithm, and FreeMASTER configuration, demonstrating the following features: 3-phase PMSM speed Field Oriented Control. Integrated eTPU software resolver functions for position and speed measurement. Develop PIL models for hardware simulation and PIL test. Application control user interface using FreeMASTER debugging tool. (Please get more details on FreeMASTER from section 9 and the references part) 2.1 Required software S32 Design Studio for S32 Platform 3.5 EB tresos Studio 29.0 FreeMASTER 3.2 MATLAB R2023b with “Embedded Coder ® for ARM Cortex-M Processors” NXP Model-Based Design Toolbox for S32K3xx version 1.5.0 SW32K3_S32M27x_RTD_R21-11_4.0.0_P19(contained in the toolbox) 2.2 Required hardware The following is a list of required hardware: Boards: XS32K396-BGA-DC EVB and MC33937 MOSFETs pre-driver (with connection cable). Motor: 3-phase PMSM TGT2-0032-30-24. Debugger: Lauterbach for Cortex-M7 or Multilink PE micro debugger. Power: 12V power supply for EVB and 24V power supply for pre-driver board. PCIE Cable. Micro USB Cable. Note: The debugger Lauterbach is not integrated in the MBTD tool, it is only a method to debug the code. 2.3 Prepare the demo The central controller EVB board runs the control algorithm, and the pre-driver drives the motor. Connect the hardware devices with the following steps: Figure 2.3.1 Hardware Setup Connect the PMSM’s three-phase winding to J4 on the pre-driver and connect the resolver signal to J8 on the pre-driver. Connect motor control signals from J14 on the pre-driver to J44 on the EVB board. Connect the debugger between JTAG J20 and the computer. Connect the USB cable between J15 and the computer, then the EVB LED D30 will be solid green. Plug in the 12V power supply port J1 on the EVB board, then the EVB LED D4 will be solid green. Plug in the 24V driver power on port J13 of the pre-driver, and then the pre-driver LED D14 will be solid yellow. 2.4 Running the demo Please refer to the  S32K396_MBDT_BASED_MOTOR_CONTROL_Quick_Start_Guide_0_9_0.pdf  in the project doc folder. 3. Demo blocks introduction In the following figure, an overview of the main Simulink model is presented. The motor control application model has the following structure: Initialization and Interrupt. Figure 3.1 Simulink Application Top Model  Var Init contains the variables used by the model and can be visualized in FreeMASTER. Initialize subsystem contains the FreeMASTER configuration, state machine and control mode initialization, and BCTU hardware trigger enablement. This subsystem is executed only once, at the beginning of the application. Hardware Interrupt Callback calls the motor control block to run. This block delivered by the MBDT, allows the implementation of specific actions inside a callback function which is executed when an interrupt occurs on the configured peripheral instance, at a specific event. Callbacks are associated with specific events inside the configuration project used with the model, which ensures the on-board configuration of the peripherals, pins, and clocks. Motor Control function-call subsystem runs every time an ADC interrupt occurs. Inside the Motor Control subsystem, as illustrated below, the ADC hardware trigger is disabled (Step 1) until the PMSM control algorithm calculation is finished (Step 2), and reenabled at the end of this computation (Step 3). The priority order of the generated code is achieved by setting the “Priority” value, accessible inside the Properties of each Simulink block. Figure 3.2 Motor Control Subsystem The pmsm_mc_algo algorithm is a subsystem reference model. It collects the input sensor signals, calculates the PMSM control algorithm, and drives PWMs to generate the output voltage. Following figure shows the main blocks: Current Voltage Measurement reads BCTU FIFO data and calls the following blocks. Board Buttons control the motor with hardware pins on board. State Machine subsystem contains the Stateflow® of the motor control application and each state will call a dedicated function block. Enable Outputs enables the PWM output function. Disable Outputs disables the PWM output function. Green LED Toggle controls a green LED to blink. Update PWM calls the MBDT PWM block to update the duty cycle value. Figure 3.3 PMSM Motor Control Algorithm 4. Startup initialization The startup initialization is a subsystem of the initialize function block. It’s used to configure some basic functionality at the start of the application: FreeMASTER Config which configures the UART to communicate with FreeMASTER GUI. FreeMASTER Config block allows the users to configure the FreeMASTER embedded-side software driver, which implements the serial interface between the application and the host PC. It actually inserts the service in the application, and it is the only one mandatory to be added to the Simulink canvas in order to have the FreeMASTER functionality available. Gpt_StartTimer enables one GPT channel for pre-driver MC33937 dead time configuration. Adc_CtuEnableHwTrigger enables the BCTU hardware trigger feature. Set the event and state to reset values and set the default control mode as speed control. Figure 4.1 Initialize Subsystem 5. Interrupt and measurements This part describes the configuration and usage of BCTU and ADC modules for analog data capturing. BCTU is triggering parallel ADC conversions for 3-phase current measurements. After all measurements are fulfilled, the BCTU FIFO notification is used to read the stored ADC data and to call the main control loop of the application for further processing.  5.1 Interrupt configuration and service The following picture shows the configuration for the BCTU FIFO notification callback feature. The BCTU FIFO 1 is used to store the ADC results, the watermark value decides when to call the function configured in the notification. Also, enabling the BCTU IRQ in configuration is required. Figure 5.1.1 BCTU Watermark Notification Configuration  Figure 5.1.2 BCTU Interrupt Enablement In the Simulink model, the configured notification for BCTU is selected inside the Hardware Interrupt Callback block. This will execute the connected function-call subsystem when the End-of-Conversion interrupt occurs. Figure 5.1.3 Interrupt Callback Subsystem 5.2 Measurements of currents and voltage This section describes the measurement of analog quantities: 3-phase currents and DC bus voltage. BCTU receives the hardware trigger to start the ADC measurements (parallel conversions). Once all results have been stored into the FIFO, the interrupt will call the main control loop. BCTU FIFO notification is used to call the main loop of the motor control, which ensures the sampling is finished before using them. How to get sampled values for processing is presented in this section. The following picture shows the steps and operations to transfer the current and voltage to their real physical values. To acquire the currents and voltage from BCTU FIFO for further processing, the Adc block from MBDT library is used and the Adc_CtuReadFifoData is selected.  Figure 5.2.1 Process converted data to physical values 6. eTPU resolver Software resolver is now widely used in the Inverter application, which can help to save the BOM (Bill of Materials) cost. The eTPU on S32K39 supplies a function to the customer to implement a software resolver via a software package. It uses one eTPU channel to generate a 50% duty-cycle PWM output signal to be passed through an external low-pass filter and used as a resolver excitation signal. In the resolver position sensor, this excitation signal is modulated by the sine and cosine of the actual motor angle. The feedback Sine and Cosine signals are sampled by an SDADC and processed by a followed DSP. The conversion results can be transferred to eTPU DATA RAM by DMA. Then, the eTPU can process the digital samples of resolver output signals and output the position and speed for the FOC. For more details about the eTPU resolver, please refer to AN13038. Figure 6.1 eTPU Resolver Diagram 6.1 Resolver functions call in MATLAB The eTPU Resolver Block is not yet available in MBDT. The System Output block is used to insert custom code for getting resolver data. The getMotorControlResolver(&mbd_ebt_DW_FOC_one.Resolver_SW) function is used to get resolver data. Figure 6.1.1 Simulink custom code for eTPU access The speed and angle are estimated from the Resolver Angle subsystem and are provided to the slow & fast control loops. Finally, the sine and cosine values from the estimated electrical angle are computed. Figure 6.1.2 Computation of the speed and angle 7. State machine This is a critical part of the motor control application model, each state has a dedicated block to handle the related functions. Figure 7.1 Motor Control States Implementation The state machine block controls the workflow of the motor control application, it has been designed using Stateflow. Figure 7.2 Finite State Machine 8. PWM control and update Subsystems Enable Outputs and Disable Outputs control the output of PWM. They are called by the state functions. In the subsystems, the flag PWM_enabled and gate driver output status are changed via the pwm_enable_output or the pwm_disable_output function. Figure 8.1 Enable Outputs Subsystem Figure 8.2 Disable Outputs Subsystem Update PWM subsystem is used to generate the PWM duty cycle value according to the output from the control loop. This value is eventually set for the FlexPWM peripheral to generate PWM voltages to drive the motor. The FlexPWM is configured to generate complementary signals for bridges and is updated synchronously according to a reload signal in the EB project. Here it is only needed to pass the duty cycle values to the Pwm function in the model. Figure 8.3 PWM Duty Cycle Values Computation Figure 8.4 PWM Duty Cycle Values Update 9. Buttons Buttons are used to control the running of the motor. The algorithm reads the value of the button from the board to change the running state or speed. The Dio block in the MBDT library is used to read the value of I/O. The I/O port of buttons has been configured in the EB project. Two buttons on the board are used to increase or decrease the running speed of the motor. Also, they are used to clear the fault information when pressed together. One button is used to control the start or stop of the motor. The following picture shows the subsystem for the button control logic. Figure 9.1 Buttons Control Logic 10. FreeMASTER GUI FreeMASTER is a user-friendly real-time debug monitor and data visualization tool that enables runtime configuration and tuning of embedded software applications. To enable FreeMASTER in this project, the interface needs to be configured first. MBDT supplies blocks to support FreeMASTER’s configuration. In this project, LPUART_0 is used to transmit data between the GUI and the board. The following figure shows the MCAT GUI, which can be used to observer parameters/variables and also used to control the status of the motor. It can be found in the project folder, under “./mbd/FreeMASTER_control”. Figure 10.1 MCAT GUI 11. PIL model PIL represents a verification and validation step where the code generated for the developed control algorithm is cross-compiled and deployed on the target hardware, then stimulated with test inputs from the Simulink application executed on the host PC, containing the plant model. The test inputs are sent to the target via Serial Communication. By enabling this simulation mode, users could test the performance of the processor long before having the final hardware design, testing whether the model and the generated code are numerically equivalent, and being able to perform code execution profiling. Hence, for this motor control design, we have also developed a PIL model (pil_model_ebt) used to verify the model-generated code on the S32K396 microcontroller. The PIL top model contains two parts: Simulation Model and Hardware Model. The Simulation Model contains the model of the real system (pre-driver and PMSM), as depicted inside Section 11.1. The Hardware Model contains the control algorithm which is the same as in the application previously introduced (mbd_ebt.slx). For the hardware Model part, the code will be generated, built and an executable file will be deployed on hardware. Input and output signals processing blocks will generate the necessary test inputs for the code that runs on the hardware controller, as depicted in the screenshot below. Figure 11.1 PIL Top Model 11.1 PIL Model introduction The PIL top model runs the simulation model part inside the Simulink environment and exchanges signal data with the hardware controller through Serial Communication. 11.2 Simulation model The simulation model simulates the hardware of the pre-driver and PMSM using Simscape™ Electrical™ blocks. Duty to PWM simulates the function of a central aligned FlexPWM with the frequency of 20kHz. Inverter simulates three-phase full-bridge circuit with the same parameters as in MC33937 MOSFETs pre-driver. PMSM is defined with the same parameters as the real motor. Resolver is simplified as an ideal rotational motion sensor. Phase Current Sensing, Bus Current Sensing and Bus Voltage Sensing are built up regarding MC33937 MOSFETs pre-driver. SARADC block samples signal simultaneously with the PWM module and generates a function call after data conversion is completed. Figure 11.2.1 PIL Host Model 11.3 Hardware model The hardware model is a referenced model that generates code and deploys it into the microcontroller. It’s called by ADC conversion completion signal. In the initialization process, it initializes the global variables and drivers. In the normal running process, when a function call comes, the model will calculate the input signal, run the state machine, and generate the output signal in the order defined in subsystem “pmsm_mc_algo”. Figure 11.3.1 PIL Target Model 12. Conclusions NXP's MBDT enables the usage of hardware optimized tools: Real-Time Drivers (RTD), Automotive Math and Motor Control Library (AMMCLib), Configuration (S32 Configuration Tools and EB Tresos), and Build Tools in the Simulink environment. This article gives examples on the construction and environment setup process for designing motor control models, and how they can be verified and validated through PIL simulation before being deployed on the target hardware. It focuses on how NXP’s Model-Based Design Toolbox and the software NXP provides could be used together with MathWorks tools and functionalities for rapid prototyping complex embedded designs on NXP targets. Together with the rich MathWorks ecosystem, it allows users to model complex algorithms, and generate optimized code for the NXP’s microcontrollers and processors, ensuring thus a fast and reliable programming environment. Please note that the demo was not fully tested inside MBDT ecosystem and application development workflow it proposes, as the depicted example uses custom code functionalities for addressing the eTPU co-processor access, currently not supported by MBDT, and a specific version of the RTD, different than the one the toolbox was released and tested with. For more information about MBDT, tutorials, webinars and other resources, please visit the MBDT Community Page. You might also visit NXP.com for additional information on the development ecosystem that NXP offers. 13. References 3-phase Motor Control Kit with S32K396 The workshop “3-Phase PMSM Control Workshop with NXP's Model-Based Design Toolbox” from NXP Community Module 4: Space Vector Modulation from NXP Community MC33937: 3-Phase Field Effect Transistor Pre-driver. Automotive Math and Motor Control Library Set for NXP S32K3xx devices. FreeMASTER Run-Time Debugging Tool. Application Note: AN13902: 3-Phase Sensorless PMSM Motor Control Kit with S32K344 using MBDT Blocks
View full article
  Product Release Announcement Automotive Processing NXP Model-Based Design Toolbox for S32K3xx – version 1.2.0 RTM   The Automotive Processing, Model-Based Design Tools Team at NXP Semiconductors, is pleased to announce the release of the Model-Based Design Toolbox for S32K3xx version 1.2.0. This release supports automatic code generation for S32K3xx peripherals and applications prototyping from MATLAB/Simulink for NXP S32K3xx Automotive Microprocessors. This new product adds support for S32K312, S32K314, S32K322, S32K324, S32K341, S32K342, and S32K344 MCUs and part of their peripherals, based on RTD MCAL components (ADC, PWM, MCL, DIO, CAN, SPI, UART, GPT). To enable BMS applications development, we have added support for MC33775A and MC33772C battery cell controllers (& MC33665PHY). In this release, we have also updated FreeMASTER, AMMCLib, and MATLAB support for the latest versions. The product comes with over 130 examples, covering everything that is supported, including demos for battery cell controllers (BCC) and motor control.   Target audience: This product is part of the Automotive SW – S32K3 Standard Software Package.   FlexNet Location: https://nxp.flexnetoperations.com/control/frse/download?element=13593437   Technical Support: NXP Model-Based Design Toolbox for S32K3xx issues will be tracked through the NXP Model-Based Design Tools Community space. https://community.nxp.com/community/mbdt     Release Content Automatic C code generation from MATLAB® for NXP S32K3xx derivatives: S32K312 S32K314 S32K322 S32K324 S32K341 S32K342 S32K344     Support for the following peripherals (MCAL components): ADC PWM MCL CAN SPI UART GPT DIO   Support for MC33775A and MC33772C battery cell controllers & MC33665PHY The toolbox provides support for the MC33775A, MC33772C, and MC33665. The MC33775A and MC33772C are lithium-ion battery cell controller ICs designed for automotive applications which perform ADC conversions of the differential cell voltages and battery temperatures, while the MC33665 is a transceiver physical layer transformer driver, designed to interface the microcontroller with the battery cell controllers through a high-speed isolated communication network. The ready-to-run examples provided with the MBDT for S32K3 show how to communicate between the S32K344 and the MC33775A and MC33772C via the MC33665 transceiver. For the MC33775A, the examples show how to configure the battery cell controller to perform Primary and Secondary chains conversion, and read the cell voltages conversion results from the MC33775A, while for the MC33772C the examples show how to configure the Battery cell controller to read current. All the converted values are displayed to the user over the FreeMaster application.           Support for custom default project configuration The toolbox provides support for users to create their custom default project configurations. This could be very useful when having a custom board design – only needing to create the configuration for it once. After it is saved as a custom default project, it can be used for every model that is being developed.         Support for component restore to default settings The toolbox allows users to restore the configuration of a component (for models which use the EB Tresos configuration tool) to the settings corresponding to the Default Configuration Template the model uses. This allows reverting changes (if made) to the default values.   Support for AUTOSAR blockset (SW-C deployment) New RTD version supported  (v2.0.0) New S32Config Tools version supported (v1.5) Provides 2 modes of operation: Basic – using pre-configured configurations for peripherals; useful for quick hardware evaluation and testing Advanced – using S32Configuration Tool or EB Tresos to configure peripherals/pins/clocks Integrates the Automotive Math and Motor Control Library release 1.1.29: All functions in the Automotive Math and Motor Control Functions Library v1.1.29 are supported as blocks for simulation and embedded target code generation.   FreeMASTER Integration We provide several Simulink example models and associated FreeMASTER projects to demonstrate how our toolbox interacts with the real-time data visualization tool and how it can be used for tuning embedded software applications.     Support for MATLAB versions We added support for the following MATLAB versions: R2020a R2020b R2021a R2021b R2022a   S32Design Studio Integration We provide a simple mechanism to let users the opportunity to export the code generated from Simulink and import it directly into S32Design Studio. This functionality can be useful if the model needs to be integrated into an already existing project or for debugging purposes.          Simulation modes: We provide support for the following simulation modes (each of them being useful for validation and verification): Software-in-Loop (SIL) Processor-in-Loop (PIL) External mode     Examples for every peripheral/function supported: We have added over 130 examples, including: Battery Management Systems examples Motor control applications Communication (SPI, CAN, UART) AMMCLib Timer control (GPT) DIO FreeMASTER SIL / PIL / External mode   For more details, features, and how to use the new functionalities, please refer to the Release Notes document attached.   MATLAB® Integration The NXP Model-Based Design Toolbox extends the MATLAB® and Simulink® experience by allowing customers to evaluate and use NXP’s S32K3xx MCUs and evaluation board solutions out-of-the-box with: NXP Model-Based Design Toolbox for S32K3xx version 1.2.0 is fully integrated with MATLAB® environment in terms of installation:         Target Audience This release (1.2.0) is intended for technology demonstration, evaluation purposes, and prototyping S32K3xx MCUs and Evaluation Boards.   Useful Resources Examples, Trainings, and Support: https://community.nxp.com/community/mbdt            
View full article
This video shows how to build a simple S32K application with NXP's Model-Based Design Toolbox that consists in: Read the SW2 push button state at each 0.1 seconds Switch on/off the Blue LED Record the value of the push button and display its state via serial communication in FreeMASTER
View full article
Four-Part How-To Series Model-Based Design Toolbox (MBDT) is an integrated development environment and toolchain for configuring and generating all the necessary software automatically to execute complex applications. The MBDT includes integrated Simulink® embedded target for NXP processors, peripheral device blocks and drivers, the Math and Motor Control library set, and bit-accurate simulation results. Watch on-demand each of our Model-Based Design Toolbox four-part How-To series and learn the basics of MBDT, also its SPI and CAN communication and its PWM control blocks.   Session 1/4 = Get to Know the User-Friendly NXP MBDT for Application Development in MATLAB/Simulink dumitru-daniel.popa‌ will show you how to configure and use the MBDT, engineered to help you speed up application development in MATLAB/Simulink Environment for NXP hardware. Get to know its main features and capabilities through the creation, simulation, built, deployment, and validation of a basic "hello world" type of application on theS32K144EVB.  Session 2/4 = Introducing the SPI Communication Blocks from NXP MBDT nxf46081‌ will highlight the key aspects of communication in the automotive industry while showing you how to configure and use designated blocks that implement the SPI communication inside the MATLAB/Simulink Environment for creating a quick and easy data transfer application using MBDT and the S32K144EVB. Session 3/4 = Introducing the CAN Communication Blocks from NXP MBDT constantinrazvan.chivu‌ will highlight the key aspects of communication in the automotive industry while showing you how to use MBDT and the S32K144EVB to simplify CAN applications with only a few blocks: configuration, transmit, and receive. Session 4/4 = Introducing the PWM Control Blocks from NXP MBDT mariuslucianandrei‌ will showcase how to start using PWM, its features and functionalities while showing you how to build a first application able to generate different types of PWM signals using MBDT and the S32K144EVB; also, learn to sample the external signals to determine the key values: duty-cycle, period, among others.   Your software development processes can speed up by using the free-of-charge NXP Model-Based Design Toolboxes for MATLAB and Simulink development environments, providing full integration, an out-of-the-box configuration, and action blocks for basic/advanced features for designing complex automotive solutions.
View full article
This video discuss about how to mix together the ADC and GPIO models to obtain a common speed reference for the BLDC speed closed loop control system.   We discuss about: - How to use analog and digital inputs - How to create a variable that can be changed in real time via Freemaster - How to test the final application - Finalize the Speed Reference Block - Short Quiz NOTE: Chinese viewers can watch the video on YOUKU using this link 注意:中国观众可以使用此链接观看YOUKU上的视频
View full article
This video shows how to program the GPIO with Model Based Design Toolbox to obtain the speed reference for the BLDC speed closed loop control system.   We discuss about: - How to implement a simple program to read data from the GPIO - How to test in real time with FreeMaster - How to transform GPI pulses into a speed reference data that represents the rpm. - How to implement from scratch a Simulink model to cover the GPIO functionality NOTE: Chinese viewers can watch the video on YOUKU using this link. 注意:中国观众可以使用此链接观看YOUKU上的视频
View full article
This page summarizes all Model-Based Design Toolbox tutorials and articles related to i.MX RT Product Family Facial Recognition Application in Co-Simulation mode for IMXRT117X Sensor application for IMXRT1060
View full article
1. Introduction The NXP HCP Toolbox enables automatic code generation for applications prototyping from Simulink for NXP’s S32G2xx and S32S2xx MPUs. This article details the steps to build, deploy, and run the HEV demo on S32G2xx, and also collect telemetry data using AWS IoT Greengrass. 2. Hardware overview The following hardware components are needed for running the HEV demo: an S32G274A RDB2 Evaluation Board Configure the evaluation board to boot from the SD card. a microSD card We'll flash and boot the GoldVIP Linux from this card a micro USB cable Connect the cable to the UART0 port and your host machine. This connection will be shown in Windows as a serial port and we'll use it to connect from a terminal emulator for the initial Linux setup. two Ethernet cables Connect another Ethernet cable to the P3A port and to your LAN network. This connection will be used for AWS data telemetrics. Connect one Ethernet cable to the P3B port and to your LAN network. This connection will be used for PIL communication between MATLAB and the application running on the board. a Logitech F310 or compatible gamepad Connect the gamepad to your host machine before opening the HEV model. We'll use it to drive the car in the virtual 3D environment: to steer, accelerate, and brake. The following figure shows the USB, UART, CAN and power connectors on the S32G2 RDB2 evaluation board. The following figure shows the Ethernet connectors on the S32G RDB2 evaluation board. 3. Software overview To run the HEV demo we must perform the following steps to install the required software. 3.1 Mathworks MATLAB and Add-Ons Install the following software from Mathworks required to build and run any model that uses the NXP Model-Based Design Toolbox for HCP : MATLAB 2020a or newer MATLAB Embedded Coder, the key component that allows us to generate the C code that will be cross-compiled to be executed on the target Embedded Coder Support Package for ARM Cortex-A Processors Install the following additional toolboxes from Mathworks required to build and run the HEV demo: Powertrain Blockset Vehicle Dynamics Blockset Automated Driving Toolbox Simulink 3D Animation Mapping Toolbox All these toolboxes can be installed from MATLAB, by opening Get Add-Ons window and searching for each of these toolboxes.   3. 2 NXP Model-Based Design for HCP Toolbox Install NXP MBDT HCP Toolbox to add the HCP target support to the MATLAB environment to allow code generation and deployment. Following are the steps to install NXP’s Model-Based Design Toolbox for HCP Series of MPUs: 1. Go to nxp.com and sign in to your NXP account. If you don't have an NXP account, create one from the Registration page. Toolbox is for free but an account is required to download the tool and access training & support on NXP Model-Based Design Toolbox Community). 2. Go to NXP Model-Based Design Toolbox (MBDT) page, select the DOWNLOADS tab and press the Download page, which will open the Model-Based Design Toolbox download page. 3. From the Model-Based Design Toolbox download page select the Model-Based Design Toolbox for HCP 1.0.0, and then on the next page, you will be asked if you agree to the Software Terms and Conditions. 4. On the Model-Based Design Toolbox for HCP download page, download the following files: SW32_MBDT_HCP_1.0.0_EAR_D2111.mltbx, the toolbox installer MBDToolbox_HCP_1.0.0_S32S2xx_Tools.zip, the S32G2xx build toolchain Some browsers will download the .mltbx file as .zip file.  To avoid that, please press right click on the download link and select Save link as. 5.  Open MATLAB, navigate to where you downloaded the toolbox installer, and run the installer (press double click or right-click and select Install). 6. After a few minutes (~4-5min), the NXP’s Model-Based Design Toolbox should be visible as a new add-on in the Add-On Manager. 7. The Model-Based Design Toolbox uses the toolchain mechanism exposed by the Simulink to build the  code generated with Embedded Coder toolbox. By default, the toolchain is configured for the MATLAB R2020a / R2020b / R2021a releases. For any other MATLAB release, the user needs to execute a toolbox m-script to generate the appropriate settings for his/her installation environment. This is done by running the mbd_hcp_path.m script.     >> mbd_hcp_path No compatible target currently available for NXP S32G2xx. Creating one.. Creating folders for the target 'NXP S32G2xx' in the folder 'C[…]\NXP_MBDToolbox_HCP\mbdtbx_hcp\codertarget\2021b\s32g2'... Creating the framework for the target 'NXP S32G2xx'... Registering the target 'NXP S32G2xx'... Done. No compatible target currently available for NXP S32S2xx. Creating one.. Creating folders for the target 'NXP S32S2xx' in the folder 'C[…]\NXP_MBDToolbox_HCP\mbdtbx_hcp\codertarget\2021b\s32s2'... Creating the framework for the target 'NXP S32S2xx'... Registering the target 'NXP S32S2xx'... Done. Successful.       3.3 Gold Vehicle Integration Platform (GoldVIP) In the case of S32G2 at the start of the PIL simulation a Linux application is cross-build on the MATLAB host machine, deployed to the evaluation board via SSH, and executed inside a Linux operating system running on that board. We'll use the Linux image from Gold Vehicle Integration Platform (GoldVIP) package that supports telemetry to cloud using AWS IOT Greengrass. Telemetry statistics are fetched from the device, calculated and sent to the cloud counterpart of the application. Statistics received in the cloud are then displayed into user-friendly graphs. The statistics include but may not be limited to: Networking accelerator usage statistics, Realtime cores load, Domain-0 VCPU load and Domain-0 Memory utilization statistics. The GoldVIP is a reference software platform for a vehicle service-oriented gateway running on NXP vehicle network processors like the S32G274A. Following figure shows the GoldVIP high-level architecture. NOTE: GoldVIP is available upon NXP approval as an Early Access Release. Please contact your NXP sales representative for more information. Once you get the approval, go to the GoldVIP download page and download the following files: GoldVIP-0.11.0-binaries.zip GoldVIP-0.11.0_User-Manual.pdf Next we unzip the GoldVIP-0.11.0-binaries.zip archive and  we'll find the Linux image fsl-image-goldvip-s32g274ardb2.sdcard in GoldVIP-0.11.0-binaries\binaries folder. 5. Toolbox setup NXP Model-Based Design Toolbox for HCP offers a Setup GUI to select which toolchain to use, flash the Linux image card, configure and test the network connection. After the installation of the toolbox has finished the GettingStarted.mlx file is opened. To run it go to the LIVE EDITOR tab and push the Run button. Running it will open the Setup GUI that will help you configure the toolbox. 5.1 Select Target We are going to select S32G274A and push the Next button. 5.2 Setup Toolchain  Select I need to acquire the toolchain and push the Next button. In case you already have the toolchain the steps are a subset of the one below. 5.3 Download Toolchain Next download the S32G2xx toolchain by following the steps from 3.2, step 4, if you haven't already done so, and then select the path to the downloaded toolchain archive. Then select the folder to where the archive should be unzipped. Next press the Unzip button to unzip the selected toolchain archive. This step will take around 10 minutes. If the toolchain archive is unzipped successfully, the Next button is enabled. 5.4 Validate build toolchain Select the toolchain folder using the Browse button to verify it. Push the Validate button. If everything is alright the message is Toolchain is valid, otherwise the message is Toolchain is not valid. If the toolchain is valid the Next button is enabled and should be pushed to continue the configuration 5.5 Write Linux on the microSD card This page helps you to write the Linux on a microSD card. First, insert the microSD card, then push the Refresh button to actualize the drive list. If the microSD is available in Windows the list should be not empty. Select a drive from the list and push the Next button. Select the Linux image using the Browse button. Finally, push the Write button to write the Linux image. 5.6. Get additional software In order to connect to the S32G2 board we'll need to install additional software. You can use Terminal Emulator familiar to you, such as Tera Term, Putty or other. Also install FTDI CDM WHQL driver for serial configuration from FTDI chip, otherwise you will not be able to connect to the board using the serial port. 5.7 Connect Hardware Connect the board using the following instructions: 1. Remove the memory card from the host computer and insert into the S32G2 board micro SD card slot. 2. Connect two Ethernet cables to S32G2 board, one to P3A port and another one to P3B port. Connect the other ends of the cables to your LAN or HOME network. 3. Connect an USB cable between the UART0 port on the S32G2 board and your host computer. 4. Connect the 12 V power supply to the S32G2 board and power on the board. 5. Open the terminal emulator (e.g. putty) to connect to the board and configure the network settings. Select the serial port added to Ports (COM & LPT) in Device Manager when the micro USB cable is connect to the host machine, and select 115200 as the baud rate. If you didn't install the FTDI driver in the previous steps, a new COM port will not be added when you connect the USB cable. Once you connect over the serial to the board, you will be asked to log into Linux in the terminal emulator. The default username is root, without a password.  If your network assigns IP address automatically via DHCP, you don't need to do any network configuration on Linux. Otherwise, you will have to configure the network settings for pfe2 interface. Run ifconfig pfe2 to get the IP address that we'll use for PIL simulation. The field that we are looking for is inet, and in the bellow output the IP address is 192.168.2.152.     root@s32g274ardb2:~# ifconfig pfe2 pfe2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.2.152 netmask 255.255.255.0 broadcast 192.168.2.255 inet6 fe80::6da:49da:68c3:24d9 prefixlen 64 scopeid 0x20<link> ether 00:01:be:be:ef:33 txqueuelen 1000 (Ethernet) RX packets 190 bytes 14318 (13.9 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 186 bytes 18928 (18.4 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device memory 0x46000000-46ffffff     Copy this IP address as we'll need it in the next step of the toolbox setup. 5.8. Setup network connection Fill in the Device Address, Username, Password, and Download folder, and then push the Test Connection button. This tests if the device address is valid, and also if the a SSH commands can be run. For the Device Address use the IP address copied from the output of ifconfig pte2. Default username is root, and no password is set. Default download folder is the home folder of the root use, /home/root. 5.9. Setup done Congratulations! You are ready to use the Model-Based Design for HCP toolbox. Note: Press the Finish button to save the toolchain path and network connection settings. 7. GoldVIP setup By default, the GoldVIP deliverable includes Xen hypervisor. Xen is a type 1 hypervisor (bare metal) that makes possible running multiple instances of the same operating system seamlessly on the hardware. Xen allows creation of virtual machines from the command line or automatically at startup. Xen virtualizes CPUs, memory, interrupts and timers, providing virtual machines with virtualized resources. Two types of virtual machines are defined by Xen: Privileged (Dom0 or Domain-0): The first machine that runs natively on the hardware and provides access to the hardware for unprivileged domains. Unprivileged (DomUs): Virtual machines spawned by Dom0. These machines use the hardware resources allocated from the privileged domain (CPU, Memory, Disk, Network). In the GoldVIP, two virtual machines are started by default, before the user logs in: Domain-0, which has access to all the system resources and creates a network bridge for the unprivileged guest. This bridge, namely xenbr0 is the network interface that forwards packets to the DomU; v2xdomu, unprivileged domain, which has access only to a limited number of resources. The HEV demo will run in Domain-0, in the privileged domain. Telemetry data is collected from Domain-0 and passed to v2xdomu through a TCP client-server communication. To switch to v2xdomu type: xl console v2xdomu The username on the v2xdomu is root without a password. To exit from v2xdomu press Ctrl + ] 7. AWS setup 7.1 Prerequisites You will need an AWS account with SSO enabled. Follow the steps in this guide to enable SSO: https://docs.aws.amazon.com/singlesignon/latest/userguide/getting-started.html Enabling SSO will grant you access to the SSO console. SSO is also required to use the SiteWise Dashboard. 7.2 AWS IAM Permissions A policy for an AWS IAM user, it contains the necessary permissions for the deployment and use of the telemetry use case:     { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "cloudformation:*", "cloudwatch:*", "iot:*", "lambda:*", "logs:*", "s3:*", "greengrass:*", "sns:*", "iotsitewise:*", "iam:*", "sso:*", "sso-directory:*" ], "Resource": "*" } ] }     AWS IAM documentation: https://docs.aws.amazon.com/IAM/latest/UserGuide/getting-started_ create-delegated-user.html 7.3 Deployment of the Telemetry Stack in AWS 1. Go to the AWS SAR console: https://console.aws.amazon.com/serverlessrepo/ 2. Go to Available applications tab; then to Public applications and search for goldvip. 3. Check Show apps that create custom IAM roles or resource policies to see the application. 4. Click on nxp-goldvip-telemetry. You can modify the application parameters. 5. Check I acknowledge that this app creates custom IAM roles. 6. Click Deploy. The deployment will take a few minutes. You will be redirected to another page. The name of the stack is on the top of the page, starting with serverlessrepo-, if you changed the application name you will need this name in the next step. You can go to the Deployments tab and see the status of the deployment. Wait for the status to change from Create in progress to Create complete. Note: you may need to refresh the page to see the status change. This CloudFormation stack creates on your account: A Greengrass V2 telemetry component, this is a python function which runs on v2xdomu and sends data to AWS IoT Core. The provisioning script described in chapter 7.4. Connecting the board to AWS creates a Greengrass V2 continuous deployment which will run the telemetry component on your board. A SiteWise Portal with multiple Dashboards; after the board is connected to AWS a live visual representation of the telemetry data received via the Greengrass V2 component is displayed in these. 7.4. Connecting the board to AWS 1. Log into the v2xdomu virtual machine using the command: xl console v2xdomu 2. Configure environment variables for Greengrass provisioning script: From the v2xdomu console, set the AWS credentials as environment variables:     $ export AWS_ACCESS_KEY_ID=<access key id> $ export AWS_SECRET_ACCESS_KEY=<secret access key>     One way of obtaining your AWS credentials is the following: From the AWS SSO console select your account and retrieve the environment variables by clicking on Command line or programmatic access. From section macOS and Linux copy the variables and paste them on your board. Use Option 1: set the AWS credentials as environment variables. Please check the AWS documentation for additional information: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html Note: IAM credentials should never be used on a device in production scenario. These variables are temporary and are erased at reboot. 3. Run the Greengrass provisioning script on your board:     $ python3 ~/cloud-gw/greengrass_provision.py --stack-name <stack-name> --region-name <region-name>     Where <stack-name> is the name of the deployed stack. If you did not change the application name you do not need to specify this parameter. In <region-name> put the region you have selected from the supported ones: us-west-2 or eu-west-1. This will setup the network interface, start the Greengrass V2 Nucleus, and create a Greengrass V2 continuous deployment, which will run the telemetry component created by the Telemetry Stack. Note: the provisioning script will try to setup the internet connection using the eth0 network interface by default. To get more details about the script parameters use:     $ python3 ~/cloud-gw/greengrass_provision.py -h     The board is now connected to your AWS account and it will begin to send telemetry data. 7.6. Accessing the SiteWise dashboard 1. Go to the SiteWise console: https://console.aws.amazon.com/iotsitewise/ 2. Click on Portals from the list on the left. 3. Click on the name of your portal, it starts with SitewisePortal_serverlessrepo. 4. Click on Assign administrators. 5. Add your account and any other you want to have access to the SiteWise Dashboard. 6. Click Assign administrators. 7. Click on the Portal’s Url (or Link). 8. Close the Getting started pop up window. 9. Click on one of the dashboards to visualize the telemetry. You will now see the live telemetry data from your board. For more information check the GoldVIP User Manual. 8. Running HEV demo 1. A Logitech F310 gamepad is needed to control the car. Connect the gamepad before opening the model. 2. We recommend to make a copy of the HEV demo folder from HCP toolbox in another working folder. Run the following command in Matlab to navigate to S32G2xx examples folder.     cd(fullfile(mbd_find_hcp_root(), 'HCP_Examples', 's32g2')     Copy the HEV_P4_Ext_TV to another working folder, e.g. C:\workspace\. 3. Open the HEV_P4_ExternalDriver_v3_TV_v4_fixedStep.slx model. The HEV demo is already configured for PIL simulation mode. 3. Run the PIL simulation by pressing the Start button from . Simulink generates the code for the model, compiles it, downloads it on the board, and then starts the simulation.  
View full article
In this video we show how to build, simulate and test a speed estimator based on Hall Sensors for a BLDC motor. The estimator is first tested under Matlab Simulink environment and then ported into the Open Loop Control Simulink model and tested on the MPC5744P Development Kit with FreeMASTER over CAN interface.   We discuss about: - How to compute the speed; - How to build a speed estimator based on Hall sensors; - Step-by-step model building an enhancements; NOTE: Chinese viewers can watch the video on YOUKU using this link 注意:中国观众可以使用此链接观看YOUKU上的视频
View full article
In this video we implement Simulink models for reading the hall sensors directly via GPIO or based on Hall transitions interrupts via eTimer Capture.   We discuss about: - How to build simple hall reading application using the available MBD Toolbox GPIO blocks  - How to enhance this simple model by adding interrupt service routines capabilities to read the hall sensors only when there is a transitions - How to count the number of hall transitions - How to validate the applications with FreeMASTER NOTE: Chinese viewers can watch the video on YOUKU using this link 注意:中国观众可以使用此链接观看YOUKU上的视频
View full article
In this video we discuss about Open Loop Control strategy and for the first time in this course we will put together all the models we have created so far and build the Simulink model that will allow us to rotate the BLDC motor. We discuss about: - Open Loop Control diagram; - Step-by-step model building an enhancements; - Test the open loop control system on the BLDC motor;   NOTE: Chinese viewers can watch the video on YOUKU using this link 注意:中国观众可以使用此链接观看YOUKU上的视频
View full article
  Product Release Announcement Automotive Processing NXP Model-Based Design Toolbox for S32K3xx – version 1.4.0 RFP   The Automotive Processing, Model-Based Design Tools Team at NXP Semiconductors, is pleased to announce the release of the Model-Based Design Toolbox for S32K3xx version 1.4.0. This release supports automatic code generation for S32K3xx peripherals and applications prototyping from MATLAB/Simulink for NXP S32K3xx Automotive Microprocessors. This new product adds support for S32K310, S32K311, S32K312, S32K314, S32K322, S32K324, S32K328, S32K338, S32K341, S32K342, S32K344, S32K348, S32K358 and S32K396 MCUs and part of their peripherals, based on RTD MCAL components (ADC, PWM, MCL, DIO, CAN, SPI, UART, LIN, GPT). To enable BMS applications development, the toolbox offers support for MC33775A and MC33772C battery cell controllers (& MC33665PHY). In this release, we have also updated RTD, AMMCLib, and MATLAB support for the latest versions. The product comes with over 120 examples, covering everything that is supported, including demos for battery cell controllers (BCC) and motor control.   Target audience: This product is part of the Automotive SW – S32K3 Standard Software Package.   FlexNet Location: https://nxp.flexnetoperations.com/control/frse/download?element=14146527   Technical Support: NXP Model-Based Design Toolbox for S32K3xx issues will be tracked through the NXP Model-Based Design Tools Community space. https://community.nxp.com/community/mbdt   Release Content Automatic C code generation from MATLAB® for NXP S32K3xx derivatives: S32K310 S32K311 S32K312 S32K314 S32K322 S32K324 S32K328 S32K338 S32K341 S32K342 S32K344 S32K348 S32K358 S32K396   Support for the following peripherals (MCAL components): ADC PWM MCL LIN CAN SPI UART GPT DIO   Board initialization: The Model-Based Design Toolbox for S32K3xx generates the component’s peripherals initialization function calls as configured in the Board Initialization window. The toolbox provides a default configuration including function calls for initializing the clocks, followed by pins and a custom order for the rest of the peripherals which have been configured in the project associated to the model. Moreover, the toolbox provides the option to save and export the initialization sequence to a file which can be later used for other models as well – in this way, the customization of the board initialization sequence can be done only once, even if applicable for other models as well. Such a file can be then imported as an external Board Initialization Template.   Custom Linker Files and Startup Code: The toolbox allows the selection of custom linker files and startup code to be used during the build process. By enabling the Use Custom Linker or/and Use Custom Startup Code checkboxes, this feature is activated, allowing the users to Browse for specific files.   Support for Referenced Configurations The Model-Based Design Toolbox for S32K3xx enables the usage of Referenced Configurations, a Simulink feature which allows users to share the configuration of an application with multiple models.   Support for MC33775A and MC33772C battery cell controllers & MC33665PHY The toolbox provides support for the MC33775A, MC33772C, and MC33665. The MC33775A and MC33772C are lithium-ion battery cell controller ICs designed for automotive applications which perform ADC conversions of the differential cell voltages and battery temperatures, while the MC33665 is a transceiver physical layer transformer driver, designed to interface the microcontroller with the battery cell controllers through a high-speed isolated communication network. The ready-to-run examples provided with the MBDT for S32K3 show how to communicate between the S32K344 and the MC33775A and MC33772C via the MC33665 transceiver. For the MC33775A, the examples show how to configure the battery cell controller to perform Primary and Secondary chains conversion, and read the cell voltages conversion results from the MC33775A, while for the MC33772C the examples show how to configure the Battery cell controller to read current. All the converted values are displayed to the user over the FreeMaster application.       Support for AUTOSAR blockset (SW-C deployment) New RTD version supported  (3.0.0) Provides 2 modes of operation: Basic – using pre-configured configurations for peripherals; useful for quick hardware evaluation and testing Advanced – using S32 Configuration Tools or EB Tresos to configure peripherals/pins/clocks Integrates the Automotive Math and Motor Control Library release 1.1.32: All functions in the Automotive Math and Motor Control Functions Library v1.1.32 are supported as blocks for simulation and embedded target code generation.   FreeMASTER Integration We provide several Simulink example models and associated FreeMASTER projects to demonstrate how our toolbox interacts with the real-time data visualization tool and how it can be used for tuning embedded software applications.   Support for MATLAB versions We added support for the following MATLAB versions: R2021a R2021b R2022a R2022b R2023a   S32Design Studio Integration We provide a simple mechanism for the users to export the code generated from Simulink and import it directly into S32Design Studio. This functionality can be useful if the model needs to be integrated into an already existing project or for debugging purposes.   Support for custom default project configuration The toolbox provides support for users to create their custom default project configurations. This could be very useful when having a custom board design – only needing to create the configuration for it once. After it is saved as a custom default project, it can be used for every model that is being developed.   Support for component restore to default settings The toolbox allows users to restore the configuration of a component (for models which use the EB Tresos configuration tool) to the settings corresponding to the Default Configuration Template the model uses. This allows reverting changes (if made) to the default values.   Simulation modes: We provide support for the following simulation modes (each of them being useful for validation and verification): Software-in-Loop (SIL) Processor-in-Loop (PIL) External mode     Examples for every peripheral/function supported: We have added over 120 examples, including: Battery Management Systems examples Motor control applications (including eTPU example on S32K396) Communication (LIN, SPI, CAN, UART) AMMCLib Timer control (GPT) DIO FreeMASTER SIL / PIL / External mode For more details, features, and how to use the new functionalities, please refer to the Release Notes document attached. MATLAB® Integration The NXP Model-Based Design Toolbox extends the MATLAB® and Simulink® experience by allowing customers to evaluate and use NXP’s S32K3xx MCUs and evaluation board solutions out-of-the-box with: NXP Model-Based Design Toolbox for S32K3xx version 1.4.0 is fully integrated with MATLAB® environment in terms of installation:       Target Audience This release (1.4.0) is intended for technology demonstration, evaluation purposes, and prototyping S32K3xx MCUs and Evaluation Boards.   Useful Resources Examples, Trainings, and Support: https://community.nxp.com/community/mbdt          
View full article
In this video we talk about  different motors classification, BLDC motor modelling and how to control the BLDC rotor movement.   We discuss about: - How most common motors operates - Electro-mechanical equations of BLDC motor - How BLDC works - Practical implementation of commutation sequence - BLDC vs PMSM comparison NOTE: Chinese viewers can watch the video on YOUKU using this link 注意:中国观众可以使用此链接观看YOUKU上的视频
View full article
This page summarizes all Model-Based Design Toolbox videos related to HCP Product Family. Deploying Radar Applications to NXP´s S32R41 Processor Using Simulink® Link to the recording here This webinar shows how to use Radar Toolbox, Simulink ®  , and Embedded Coder ®  to generate C code for radar signal processing algorithms for range and speed estimation and deploy them to NXP ® ´s S32R41 high-performance processor for high-resolution radar. Based on MathWorks´ radar example models, we use Embedded Coder to generate optimized C code and run it in Processor-in-the-Loop (PIL) mode on the S32R41 processor. The code generation workflow will feature the use of NXP´s Model-Based Design Toolbox (MBDT), which provides an integrated development environment and toolchain for configuring and generating all the necessary software to execute complex applications on NXP MCUs and processors.
View full article
In this video we discuss about how to use Software-in-the-Loop (SIL) approach to generate the C-code for the first time and validate the algorithm at the concept level.   We discuss about: - What is SIL, When to use it and What is recommended for;  - How to convert any Simulink generic algorithm to run with SIL support using the Model Based Design Toolbox; - SIL Reference models;  NOTE: Chinese viewers can watch the video on YOUKU using this link 注意:中国观众可以使用此链接观看YOUKU上的视频
View full article
In this video we enhance a Simulink model to allow the reading of hall sensors after processor reset to get the initial position of the rotor.   We discuss about: - How to build a special initialization routine to read the halls once in the beginning - How to use StateFlow programming - How to mix the direct read of GPIOs with ISR based on hall transition readings NOTE: Chinese viewers can watch the video on YOUKU using this link 注意:中国观众可以使用此链接观看YOUKU上的视频
View full article
This page summarizes all Model-Based Design Toolbox videos related to i.MX RT Product Family
View full article
This video shows how easy it is to build a motor control application for BLDC with NXP's Model-Based Design Toolbox
View full article