恩智浦基于模型的设计工具知识库

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

NXP Model-Based Design Tools Knowledge Base

讨论

排序依据:
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
查看全文
General Installer and Setup  How to install the license of MBDT for S32K3?  How to setup the S32K344 toolbox and EVB?  How to export the generated code to S32DS3.4? Export generated projects in MBDT for s32k3XX  Programming methods MBDT for S32k3 using P&E Multilink Custom code usage SENT Protocol Support in S32K3 MBDT Custom project usage How to use custom project configuration Sequential reset S32K344-Q172 sequential reset SIL / PIL / External Mode External mode External mode example wouldn't compile after update  S32K3X4EVB-Q257 with MBDT PIL Example: Not able to run Simple PIL S32CT example Peripherals ADC How to add a new ADC channel using the external configuration tool  SPI How to send 32 bit frames  DIO S32K3x4-Q172P_with_MBDT_Blink_Project DIO and PWM configuration issues ICU PWM Duty cycle measurement PWM PWM raising edge and falling edge detection Interrupt based PWM generation CAN FreeMASTER over CAN connection issue  Apps Motor Control SPI configuration MODEL based design tool box- 32 bit instruction (SIMULINK) 
查看全文
This page summarizes all Model-Based Design Toolbox topics related to the S32K3 Product Family. How to: Standby mode on S32K3 using NXP MBDT How to: MSDI MC33CD1030 on S32K396BMS-EVB using NXP MBDT 
查看全文
This page summarizes all Model-Based Design Toolbox videos related to i.MX RT Product Family
查看全文
Having fun with MBDT for MPC57xx 3.1.0 and MPC5744P for Xmas tree by controlling the lights and sounds
查看全文
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上的视频
查看全文
  1. Introduction 1.1 A New Control Option For NXP Cup Race Car    NXP Cup car development kit is usually based on NXP's Freedom KL25Z board for motors control and image evaluation. However the control of the race car can be done with multiple NXP solutions.    In this article, a solution based on S32K144EVB board will be presented along with a programming approach based on MATLAB/Simulink Model-Based Design Toolbox for S32K. Additionally another tool provided by NXP - FreeMASTER - will be used to debug in real time the application.     As S32K144 pinout is not compatible with the default Landzo board pinout, an additional board to route the pins to the desired destination has been built. Complete details on the mapping of the pins are provided in the tutorial.   This article is structured as a tutorial detailing all the steps and providing all the source code to enable one to use this solution. However the control application is done very simple - on purpose - and uses just 10% of the speed to prove the concept.  Table 1. Freedom KL25Z vs. S32K144 features Freedom KL25Z Board Features S32K144 Board Features 32-bit ARM Cortex-M0+ core, up to 48 MHz operation 32-bit ARM Cortex-M4F core,  up to 112 MHz operation Voltage range: 1.71 to 3.6 V Voltage range: 2.7 V to 5.5 V • Up to 128 KB program flash memory • Up to 16 KB SRAM • Up to 512KB program flash memory • Up to 64 KB SRAM • Clock generation module with FLL and PLL for system and CPU clock generation • 4 MHz and 32 kHz internal reference clock • System oscillator supporting external crystal or resonator • Low-power 1kHz RC oscillator for RTC and COP watchdog •  4 - 40 MHz fast external oscillator (SOSC) with up to 50 MHz DC external square input clock in external clock mode •  48 MHz Fast Internal RC oscillator (FIRC) •  8 MHz Slow Internal RC oscillator (SIRC) •  128 kHz Low Power Oscillator (LPO) • 16-bit SAR ADC • 12-bit DAC • Analog comparator (CMP) containing a 6-bit DAC and programmable reference input  • Up to two 12-bit Analog-to-Digital Converter (ADC) with up to 32 channel analog inputs per module • One Analog Comparator (CMP) with internal 8-bit Digital to Analog Converter (DAC) •  Low-power hardware touch sensor interface (TSI) •  Up to 66 general-purpose input/output (GPIO) •   Non-Maskable Interrupt (NMI) •   Up to 156 GPIO pins with interrupt functionality • Two 8-bit Serial Peripheral Interfaces (SPI) • USB dual-role controller with built-in FS/LS transceiver • USB voltage regulator • Two I2C modules • One low-power UART and two standard UART modules   • Up to three Low Power Universal Asynchronous Receiver/Transmitter (LPUART/LIN) modules with DMA support and low power availability • Up to three Low Power Serial Peripheral Interface (LPSPI) modules • Up to two Low Power Inter-Integrated Circuit (LPI2C) modules • Up to three FlexCAN modules • FlexIO module for emulation of communication protocols and peripherals (UART, I2C, SPI, I2S, LIN, PWM, etc) • Six channel Timer/PWM (TPM) • Two 2-channel Timer/PWM modules • 2 – channel Periodic interrupt timers • 16-bit low-power timer (LPTMR) • Real time clock • Up to eight independent 16-bit FlexTimers (FTM) modules • One 16-bit Low Power Timer (LPTMR) with flexible wake up control • Two Programmable Delay Blocks (PDB) with flexible trigger system • One 32-bit Low Power Interrupt Timer (LPIT) with 4 channels • 32-bit Real Time Counter (RTC) • 4-channel DMA controller, supporting up to 63 request sources • 16 channel DMA with up to 63 request sources 1.2 Resources Model-Based Design Toolbox – Tool used to create complex applications and program the S32K144 MCU directly from the MATLAB/Simulink environment. This tool allows automatic code generation for S32K144 peripherals based on configuration of the Simulink model done by the user. S32K144-Q100 Evaluation Board – Evaluation board from the S32K14x family used for quick application prototyping and demonstration. NXP Cup Development Kit – Information about the hardware components of the development kit and instructions regarding the car assembling. Software which is helpful for the project design is also presented. FreeMaster Debugging Tool – Real-time data monitor tool which shows in both graphical mode (as a scope for example) and text mode the evolution of variables in time. It is suitable to monitor application behavior in real time during execution of the code.  TSL1401 Datasheet – Information regarding the camera configuration. Excel Spreadsheet (attached at the end of the document) with routing information to map pins from Landzo to S32K144 board. 2. Hardware Setup    After assembling all the hardware modules as indicated in the development kit the car will look like in the next image. It should be mentioned that for the S32K144 EVB to system board connection an S32K adapter board was created. Fig 1. Hardware setup 2.1  Hardware Modules    The hardware modules of this application and the way the peripherals of the S32K144 MCU are communicating with those is summarized in the Fig. 2. To understand more about the control of the motors, please check chapters 3.4.4 and 3.4.5. For learning how to debug the application using the Freemaster software, take a look at the chapter 4 where a detailed description is presented. A similar indication is given also for the camera information collecting. Chapter 3.4.1 and 3.4.2 provide a close-up image of the operations that need to be done in order to make the car “see”. Fig 2. System block diagram 2.2  Hardware Validation Steps    After connecting all the hardware modules, connect a USB cable to the PC. Connect other end of USB cable to mini-B port on FRDM-KEA at J7. When powered through USB, LEDs D2 and D3 should light green like in the picture below. Also, once the S32K144 board is recognized, it should appear as a mass storage device in your PC with the name EVB-S32K144.        Fig 3. LEDs to validate the correct setup 3. Model-Based Design Application 3.1  Application Description    The Model-Based Design approach consists of a visual way of programming, which is based on blocks. A block implements a certain functionality, such as adding two numbers. In case of the NXP's Model-Based Design Toolbox which is specifically developed for the S32K14x family, a block implements a functionality of a MCU peripheral, such as turning on the green led on the board. Each block has a different functionality and for a complex application, multiple components should be used together so they can provide the best solution for the problem proposed. For example, if you want to toggle the green led at every 10 seconds, you are going to add a new block to your design, one that can count those 10 seconds and then trigger an action when the count is over, which is toggling the led. Connection between the blocks should be made accordingly to your application system model. When building the model, the code that stands behind the blocks and implements the connection logic between them is automatically generated and downloaded on the embedded target. Doing so, code errors are certainly eliminated, and a faster design process is accomplished.    For using the Model-Based Design Toolbox for S32K, the MATLAB programming platform should be installed on the PC you are working on. Make sure that you respect all the System Requirements that you can find on the following link (Model Based Design Toolbox). Follow the installation steps from the Install and Configuration Steps and now you are ready to develop your own model-based design application.           3.2  Application Scheme    The generated code from the Simulink model is downloaded on the S32K144 MCU. A mapping between hardware and software for this application is illustrated in the figure below: Fig 4. Hardware to software mapping    The hardware components are controlled by the application through the peripheral functions of the S32K144 MCU. This board is connected to the other hardware modules by using an adapter board. In the link NXP Cup Development Kit there are information regarding how to connect the camera, servo and motors modules on the System and Driver Boards. Thus, the software generated signals are transmitted to the modules that need to be configured and controlled (camera, servo, motors). Fig 5. Application Scheme    When you open the Simulink model, this structure shown in Fig. 6 will be displayed. The functionalities are grouped in areas, which area containing a small description of what it is computed inside it. There are blocks and connections between them like mentioned before. Based on the image given by the camera, the steering and the speed of the car should be controlled. More details about how each of the subsystems works are provided in the following chapters. Fig 6. Simulink top level system 3.3 Application Logic    The application logic is described by the following block diagram. The signal from the camera is converted and the data is stored in an array. Based on the elements of the array (description of the image in front of the car), an algorithm will compute how much does the car have to steer its front wheels. This is expressed in a duty cycle value of a signal, signal which will be directly transmitted to the servo module. A constant speed, 10% of the maximum reachable of the car, it is also given as a duty cycle of the signal which will control the two rear motors. Fig 7. Application logic diagram   3.4 Simulink Model Components 3.4.1 Camera Configuration                 The camera module has a major importance in the project, because it is used to scan and process the track in front of the car. Firstly, for the main purpose of the application: control the car and maintain its position on the desired direction, the camera module should be configured so it can receive the analog signal properly. After the camera receives the analog signal, the application converts it into 128 digital values on the basis of which control decisions will be taken. There are 128 digital values for a conversion because the line scan camera module consists of a linear sensor array of 128 pixels and an adjustable lens. As specified in the datasheet, for the camera module configuration, two signals must be generated, a clock and a serial input (CLK and SI). Fig 8. Waveforms for camera configuration    To validate the functionality of this module, you should open the FreeMaster and check that the camera is working properly. Open the .pmp file and watch the conv variable evolving on the recorder. Put a white paper in front of your camera and then move an object in front of it. Every time the camera spots a dark color, its graphical evolution presents easy observable dips like in the picture below (blue graphic).                                                                                      Fig 9. Dips caused by dark objects CLK Signal    For the CLK signal generation, a FTM (FlexTimer) block is used. This block generates a PWM signal with a duty cycle given as an input (DTC – Dutcy Cycle Camera). The duty cycle has to be 0.5 (50%) as specified in the datasheet. The PWM signal is then passed to the corresponding pin of the camera module through the S32K144 board.    Check the Landzo_car pins to S32K144EVB file for the mapping and connections.     The frequency of the clock signal was chosen considering the imposed value range in the datasheet. (fclock between 5 and 2000 kHz).       Fig 10. Generating the CLK signal      When configuring the FTM block, the following block parameters will be available:                    Fig 11. FTM block parameters    The FTM functionality has 4 different modules, each of them with 8 channels grouped in pairs (for each channel an output pin can be selected). After checking the Landzo_car pins to S32K144EVB file for the corresponding pin of the camera CLK, the choice of the FTM module and the pair should be done (FTM0_CH1 means that the pin is connected to the FTM0 module, pair 0-1). It should also be mentioned that the camera module is connected on the CCD1 interface of the System Board in the hardware setup of this application. Another linear interface CCD2 is available for user usage, as specified in the description of the development kit. The frequency of the signal can also be set from the editbox in the Frequency Settings groupbox. An initial duty cycle value equal to 0.5 was set according to the datasheet.    There are two operation modes for each pair of channels and they can be chosen from the popup box next to the pair selection. These modes are called independent and complementary. Let’s give them a short description.    By setting channel n in the Complementary mode, the output for the channel n+1 will be the inverse of the channel n output and the block will have only one input. In the Independent mode, the channels have independent outputs, each one depending on the duty cycle given as an input on that channel (2 inputs for the block in this case). The CLK signal of the camera is transmitted to a single pin of the hardware module, so there is no need for two channels to be configured. Only one is enough to output the desired waveform (in complementary mode, only the first channel of a pair will be set; ex: channel 0, channel 2, channel 4, channel 6). That is why the Complementary option is chosen in this case. The input will be the 50% duty cycle on the basis of which the CLK signal will be generated. The channel 7 will now be the inverse of the channel 6 but in the next picture it can be observed that the channel 7 does not have a pin to output the signal to, because the inverted CLK signal is not needed in the current application.                   Fig 12. FTM output signals SI Signal      The SI signal’s period must provide enough time for 129 CLK cycles, as the timing requires (datasheet). 129 CLK cycles are needed with the purpose of acquiring 128 samples of the analog signal received by the camera. In order to meet all the specified conditions for a normal operation mode, the algorithm to create the CLK and SI waveforms as required uses two Periodic Interrupt Timers (PIT) blocks. Fig 13. PIT blocks    An interrupt represents a signal transmitted to the processor by hardware or software indicating an important event that needs immediate attention. The processor responds to this signal by suspending its current activities, saving its state and executing a function called an interrupt handler to deal with the event. The interruption is temporary, and, after the interrupt handler finishes, the processor resumes its normal activities.    A PIT block is used to trigger an interrupt handler to execute at every timeout of a counter. The Function-Call Subsystems linked to the PIT blocks represent the actions inside the interrupt handler. The interrupt handler will be triggered every Period(us). For the first PIT, it will be triggered every 20000us and for the second one every 100us. This means that every time the counter reaches the value specified in the block configuration parameters, the Function-Call Subsystem is triggered, the actions inside of it executed and the counter reinitialized. Fig 14. PIT block parameters    The PIT functionality has 4 channels, and they are implemented based on independent counters. The channel 0 is not available for user usage because it is configured to trigger the execution of the entire model at every period of time specified in the model configuration parameters.    The last checkbox from the block parameters is used to start the counter immediately after the application initialization, without waiting for other events.    Considering all the information mentioned above, the timing of creating the waveforms as required involves the following actions:      at every 100µs (CLK signal’s period) the next things happen: Fig 15. Actions in the 100us interrupt           C variable, which counts the clock cycles, is incremented; If C >=2, the SI signal is turned from high to low. (value 2 was chosen to keep the SI signal high for the convenient amount of time as specified by the tw, tsu, th and ts parameters. Their values can be found in the datasheet)                    Fig 16. Timing for camera configuration    A GPIO (General Purpose Input/Output) block is used for this and its role is to send the value given as an input to the selected pin which can be selected from the dropdown menu available in the block configuration parameters). Fig 17. Setting SI signal LOW Fig 18. GPIO block parameters A conversion is started and if C < 128, the converted values (analog-digital conversion of the received signal from the camera) are stored in an array of 128 elements (Store the converted values into an array subsystem is triggered) and into the conv array. Conv variable is used for the debugging process which will be later detailed.          at every 20ms (SI signal’s period) the next things happen:        SI signal is turned from low to high using the same GPIO functionality;       The clock cycles counter C is reinitialized;             Based on the values of the array (high values for white, low values for dark) and on their indexes, the duty cycle (DTS – Duty Cycle Servo) which controls the              Servo is computed (it controls the car to turn left or right with a certain angle); Fig 19. Actions in the 20ms interrupt 3.4.2 Camera Reading    After the camera module is configured (SI and CLK signals generated as specified), the data acquisition can be started. The signal given by the camera is converted into digital values which are stored in an array. The conversion implies the usage of the ADC (Analog to Digital Converter) functionality. Taking this into consideration, a configuration block for the ADC should be added to the Simulink model.         Fig 20. ADC configuration block    The ADC of the S32K144 has two modules (ADC0, ADC1) each of them with up to 16 external analog input channels and up to 12-bit conversion resolution. The camera module is connected to the CCD 1 linear interface of the System Board. The Landzo_car pins to S32K144EVB file specifies that the pin of the camera module which receives the analog signal is ADC1_CH10, so the ADC 1 module should be configured. A 12-bit conversion resolution was chosen for improving the accuracy of the sampled data.     An analog to digital conversion should happen every 100us as specified in the Timing section, because 128 samples of the input signal need to be acquired (every time the C variable is incremented, a value should be stored in the conversion array). Fig 21. Start of conversion    Considering the facts mentioned in the previous paragraph, every time the subsystem of the PIT block is triggered, the conversion is started (an ADC Start block is used) and if C < 128 the sampled data is stored into the array that will consist the information on which basis the servo control decision will be taken. Variable C is the index of the array elements and each result of the conversion represents the value of an element. Following this algorithm, the Y array is created and it is going to be used in the next chapter where the algorithm which computes how much the car should steer, based on the image of the track in front of it, is described. For putting the values into the array an assignment block is used. Fig 22. Storing conversion values to Y array     3.4.3 Camera To Steering Algorithm    The algorithm presents a basic approach and uses an if-else logic. Before giving it a short description, a couple of things should be mentioned.   Considering the reference voltage of the ADC module of the microcontroller which is 5V and the 12 bit resolution of the conversion, the resolution on a quantum is 5 / 4095. But the camera is powered by a voltage approximately equal to 3.4V, thus resulting a value which varies around 3.4 / ( 5/4095) = 2785. This value is the maximum that the ADC can provide when the camera spots white in front of it. The light conditions in the room represent a major factor that contributes to variations of this value.   The Servo of this kit needs a 20ms period PWM signal with the pulses duration equal to 600µs for a neutral position of the wheels, 400µs for the wheels turned maximum left, and 800µs maximum right. This results in the following values for the duty cycle (0.03 - the car goes forward, 0.02 – the car turns maximum right, 0.04 – the car turns maximum left). The 0.02 value should be replaced by 0.023 in order to obtain a proper operation mode due to the servo’s construction particularities.      The array with the converted values (Y) is iterated. If a dark value is found (the difference between ‘maximum white’ and the value of the current element is bigger than a threshold), the duty cycle is computed to determine how much right or how much left the front wheels should turn. If a dark value is spotted in the first half of the array, the car should turn right, or left if found in the other. But the camera gives the image from right to left so the turning ways are opposite (left if a dark value is spotted in the first half of the array, right for the second one).    After determining the way of the steering, left or right, the DTS is computed proportionally with the index of the array where a dark value is found. If a value representing a dark color is spotted at the beginning or at the ending of the array, it means that the what needs to be avoided is not exactly in front of the car, but more to one side of it, so a steering with a small angle should be effective in order to keep the car on the runway. On the other hand, if a small value is found more to the middle of the array, a wider angle of steering should be computed in order to ensure the avoidance of the dark color and the car moving off the track.     Fig 23. Matlab function for computing the DTS 3.4.4 Set The Servo    The DTS is then passed to another FTM_PWM_Config block to generate the signal needed to control the Servo.       Fig 24. FTM block for controlling the servo      In order to do so, the block should be configured with the following parameters, which have the same signification as mentioned in chapter 3.4.1:                 Fig 25. FTM block parameters    According to the hardware connections from the S32K adapter board and the current setup, only one Servomotor is used, and this is the STEERINGPWM1 mentioned in the file with the mapping between the Landzo car pins and the S32K144 board. The allocated peripheral for this module is the FTM0_CH1, which means that the module 0 should be chosen from the configuration parameters together with the 0-1 pair of channels. To control the servo, only one signal is needed, so there is no need to use 2 channels. The complementary mode could have been used here, like in the camera CLK signal configuration, but doing so, only the configuration of channel 0 would have been possible and channel 1 is requested for the application. By choosing the independent mode, a duty cycle input will be available for the both channels of the pair, and because only channel 1 is needed for the control of this module, an input equal to 0 will be given to the other one. The frequency is set to 50Hz considering the motor construction particularities and a duty cycle equal to 0.03 (wheels not steered) is set as an initial value.     Fig 26. FTM output signals 3.4.5 Set The Motors    For the two rear motors, the same principle applies. The duty cycle (DT) is configured by default at the 0.1 value which will cause the car to move along the track with 10% of its maximum speed.     The frequency of the PWM signal that controls the motors is 5000Hz. This value is in the range specified in the datasheet of the motor drivers mentioned in the schematics.                 Fig 27. FTM block for controlling the traction motors     For the control of a single motor, two signals are needed. The schematics of the Motor Driver board indicate that for the control of each motor two integrated circuits are used (BTN7960). They form an H bridge which looks as in the picture below.                 Fig 28. H bridge    To make the motor spin, the potential difference of the points the motor is connected between must be different from 0. It can be observed that each integrated circuit needs an input signal. The pins that give the input signals to the circuits are corresponding to the output channels of the FTM block. Let’s take for example the 1st rear motor. It is controlled by a FTM Config block which outputs on the following channels.                     Fig 29. FTM output signals    By setting and keeping channel 3 of the FTM Config block channels to 0, an input equal to 0 will be transmitted to one of the BTN modules as an input on the IN pin (for example, to the right one). This will trigger the right lower transistor to act like a closed switch. The transistor above it will remain opened, so the voltage of the OUT point will be 0V. The channel 2 corresponds to the other integrated circuit, and a positive input will be received by this one on the IN pin (left side of the picture). Now, the left upper transistor will act like a closed switch, and the one below will remain open, making the OUT point’s potential to represent a positive value (depending on the duty cycle given as an input to the FTM block). Thus, a potential difference is created and the motor will start spinning. 3.4.6 Configuration Block    In addition to all these, the model needs also a configuration block which is used to configure the target MCU, the compiler, the system clock frequency, etc. A configuration block is needed in all the models because it ensures the communication with the target. Fig 30. Model configuration block    The operation frequency can be chosen from the MCU tab of the block parameters window. For this model, it was set at 80Hz. The board model, the SRAM and the clock frequency can also be set from the MCU tab. Fig 31. Configuration block MCU tab    If you want to change the compiler and also the optimization levels, click the Build Toolchain tab and take a look at the available options presented in the picture below. From this tab you can also choose the target memory for the model which can be FLASH or SRAM.                   Fig 32. Configuration block Build Toolchain tab    The application is downloaded on the target through OpenSDA. OpenSDA is an open standard serial and debug adapter. It bridges serial and debug communications between a USB host and an embedded target processor. Make sure that the Download Code after Build option is checked in order to see your application running on the target.                   Fig 33. Configuration block Target Connection tab    For additional information about the blocks used in this model, right-click on them and choose the ‘Help’ option available in the menu. 4. How To Debug The Application Using FreeMaster    In order to use FreeMaster for debugging and managing the information from your application, a FreeMaster configuration block must be used in the Simulink model. Fig 34. FreeMaster configuration block    The block parameters should be configured as in the following picture: Fig 35. FreeMaster configuration block parameters    The interface field specifies the communication interface between the application and the FreeMaster. LPUART1 is chosen in this example because it is directly connected to the OpenSDA. OpenSDA is an open standard serial and debug adapter. It bridges serial and debug communications between a USB host and an embedded target processor.    The BaudRate represents the speed of data transmission between the application and the FreeMaster and it is expressed in kbps. The receive data pin and the transmit data pin should be always configured to PTC6, respectively PTC7 (for the LPUART1 interface) because these pins are connected to the OpenSDA Receive and Transmit pins, as specified in the HMI Mapping.       Fig 36. OpenSDA to LPUART1 connection    By clicking the Show Advanced Options checkbox, multiple settings are available and their functionalities are all specified in the Help file which will open after clicking the Help button in the Block Parameters tab.    The variables that need to be observed changing over time must be declared Volatile. The variables already added to the FreeMaster project are declared using the Data Store Memory block.                 Fig 37. Global Variables    The Volatile option can be chosen from the Block Parameters Tab. After double clicking the Data Store Memory block, click the Signal Attributes tab and in the Code Generation groupbox, set the Storage Class option to Volatile (Custom), as in the picture below.  Fig 38. Data store memory block parameters    For calling the FreeMaster data acquisition each time a subsystem is triggered, a FreeMaster Recorder Call block should be added in the subsystem where the variables that you want to record are computed. Thus, a recorder block is placed in the subsystem which is triggered at 100us for recording the evolution of C and conv variables. Fig 39. FreeMaster recorder call    To check the functionality of the FreeMASTER, open the .pmp file with the same name as the Simulink model and click on the red STOP button in order to initialize the communication with the S32K144 evaluation board. Fig 40. Start/Stop FreeMaster communication    If errors appear, click on the Project menu and open the Options window. Make sure that the port value is the same as the one on which your S32K144 is connected (you can check the COM number of the evaluation board in the Device Manager window). Make sure also that the Speed is the same as the baud rate of the FreeMaster Config block.       Fig 41. FreeMaster communication setup    Click on the MAP Files tab and ensure that the default symbol file is the .elf file from the folder that is created when you build your Simulink model. It should be called (your_model_name.elf).           Fig 42. FreeMaster .elf file    Once the connection is set and the app working, you will observe how the values of the variables in the Variable Watch are changing.    Click on the Recorder option from the left side of the window in order to see the graphical evolution of the variables.    You can add or remove variables from the watch by right-clicking inside the Variable Watch area and choosing the Watch Properties options.    Right clicking on the Recorder will provide a Properties option as well. Use that for selecting the variables that you want to display and for many other options.           Fig 43. FreeMaster recorder properties 5. Autonomous Intelligent Car Demonstration And Hints For Improvement 5.1 Demo    If you want to make sure that everything works as it is supposed to before actually putting the car on the track, you can use the FreeMaster tool to visualize the evolution of the variables of your project. Considering every setup was made as specified, here is what you should expect to see. Fig 44. Variable Watch    The two rear motors duty cycle and also the one for the camera CLK signal should have constant values all the time (0.1 respectively 0.5). The DTS should vary its values between 0.023 and 0.04 as mentioned in the Camera to Steer algorithm chapter. C variable must be incremented every 100us and reset every 20ms, this meaning that when it reaches 200, it should be set back at 0. This evolution can also be graphically observed by using the recorder option. Conv variable and Y array represent the conversion result and all the bottoms of the conv graphical evolution represent the existence of a dark color in the visual field of the car.    A demonstration video with the car following the track for a lap is attached to the current content.   5.2 Improvement Areas    The application proposed uses a basic if-else algorithm in order to compute the steering of the front wheels based on the track in front of the car. A proof of the concept that the vehicle can be controlled and kept on the path using a S32K144 board and a Model Based Design approach is realized in the presented solution. Major improvements regarding the lap time could be achieved by developing a way to control also the car speed which now is at a constant value. Many other hardware and software solutions can be designed and implemented with the purpose of obtaining the fastest autonomous self driving car for the NXP Cup. NXP CUP - LINE FOLLOWER WITH MODEL-BASED DESIGN TOOLBOX FOR S32K MICROPROCESSOR
查看全文
    1 Table of Contents • Overview • Executive Summary - What is .MLTBX • Context - Where to obtain the .mltbx file • Method 1 - Manual Installation (.mltbx) • Method 2 - Install via NXP Support Package • Method 3 - Automotive Software Package Manager • Conclusion     2 Overview NXP provides a range of MATLAB ® Toolboxes distributed as .mltbx packages to support modeling, simulation, configuration, and code generation for NXP microcontrollers and processors. These toolboxes integrate directly with the MathWorks environment and enable faster development workflows by extending MATLAB/Simulink with NXP-specific blocks, drivers, and examples. The scope of this article is to guide users through the process of installing an NXP .mltbx toolbox obtained from the official NXP website. It explains the prerequisites, where to download the toolbox, and how to install and verify it within MATLAB. The instructions are intended for engineers and developers who have basic familiarity with MATLAB but may be new to installing third-party toolboxes distributed outside of MathWorks Add-Ons. By following this guide, readers will be able to correctly install the NXP toolbox, ensure it is recognized by MATLAB, and prepare their environment for subsequent development and evaluation tasks.     3 Executive Summary - What is .MLTBX An .mltbx file is a MATLAB Toolbox package used to distribute and install MATLAB or Simulink extensions. It is a self-contained archive created by MathWorks that can include functions, Simulink blocks, documentation, examples, and setup scripts. When opened in MATLAB, an .mltbx file is installed using the Add-On Manager, which automatically places the toolbox in the default add-ons folder, and registers the toolbox within the environment. This format allows third-party vendors - such as NXP - to safely deliver toolboxes outside of the MathWorks Add-On Explorer while preserving a standard installation experience. In short, a .mltbx file is the official and recommended way to package, install, update, and uninstall MATLAB toolboxes.     4 Context - Where to obtain the .mltbx file There are multiple ways to get the .mltbx file, as shown below: Manual download and install - from NXP site (.mltbx file) Installation via MATLAB - Add-Ons / toolbox flow (NXP Support Package) Installation via Automotive Software Package Manager - bundle installer All methods are valid and can be used depending on your setup and preferences. The Automotive Software Package Manager approach installs bundles and generates an installer that walks through the steps automatically. Prerequisites Before installing the toolbox, ensure the following: MATLAB is installed on your machine You have access to the toolbox download source Note: The .mltbx file cannot be used without MATLAB. The toolbox is only available for Windows and may require additional prerequisites such as: Embedded Coder MATLAB Coder Simulink Coder     5 Method 1 - Manual Installation (.mltbx) The manual installation flow is simple, once prerequisites are met. Manually download the .mltbx file from the NXP site and install it. Typical install behavior: Open MATLAB → run or double-click the .mltbx file → install → toolbox is added automatically. Installed toolboxes are placed under MATLAB Add-Ons directories and appear in the Add-On Explorer. Step 1 - Select the toolbox family As a first step, on the NXP site, select "Automotive SW - Model-Based Design Toolbox".     Step 2 - Select the target software In our example, we are selecting "Automotive SW - S32K3 Software".   Step 3 - Select the S32K3 Model-Based Design Toolbox Select "Automotive SW - S32K3 - Model-Based Design Toolbox".   Step 4 - Choose Product Information Select the Product Information: "Model-Based Design Toolbox S32K3 1.8.0".   Step 5 - Accept Software Terms and Conditions The Software Terms and Conditions will appear - select "I Agree".   Step 6 - Download the .mltbx file After the terms and conditions agreement, you can download the .mltbx file.   When downloading, save the file under the .zip extension, as shown below.   Step 7 - Reveal file extensions in Windows To see and change the file extension, follow the next steps: Press the three dots visible below:   Select "Options". Deselect "Hide extensions for known file types".   Press Apply and OK. After this update, the file will be visible with its extension.   Step 8 - Change the file extension to .mltbx Change the file extension from .zip to .mltbx :   A pop-up will appear - press "Yes":   View after changing the file from .zip to .mltbx:   Step 9 - Install the toolbox in MATLAB Double-click the .mltbx file and accept the License Agreement.   The installation process will start and it will take a few moments to be finalized.  Installation Finalized     Toolbox registered in MATLAB Add-On Manager        6 Method 2 - Install via NXP Support Package The NXP Support Package add-on is a guided installer that: Checks and validates all installation prerequisites Directs users to the page where the required .mltbx package can be downloaded Allows users to select the .mltbx package to install Provides the option to open relevant documentation resources Step 1 - Open MATLAB Launch MATLAB.   Step 2 - Navigate to Add-Ons Go to: Add-Ons → Get Add-Ons.     Step 3 - Install the toolbox Load the toolbox file or follow your internal download process. Note: Direct download via Add-On Explorer may not always be available, depending on licensing and setup.     7 Method 3 - Automotive Software Package Manager This method uses the Automotive Software Package Manager, which installs bundles and generates an installer that walks through the steps automatically. Step 1 - Access Package Manager Use the Automotive Software Package Manager.   Step 2 - Select required components Choose: Target platform - e.g. S32K3 Required tools - e.g. FreeMASTER, Model-Based Design Toolbox   Step 3 - Generate installer The tool generates a bundle installer.   Step 4 - Run installer Run the generated installer. Follow the step-by-step instructions.     8 Conclusion Installing an NXP .mltbx toolbox is straightforward once the MATLAB prerequisites are in place. Depending on your workflow, you can choose the manual .mltbx installation, the guided NXP Support Package, or the Automotive Software Package Manager bundle installer - all three methods produce a properly registered toolbox inside MATLAB. With the toolbox installed and verified, your environment is ready to start developing, simulating, and generating code for NXP microcontrollers and processors. Stay tuned for the next article, where we will dive into using the newly installed toolbox to build your first Model-Based Design project.
查看全文
      1 Table of Contents • Introduction • Overview • Context • References • Conclusion     2 Introduction This article series explains the role and behavior of a zonal controller communication component in a modern automotive electrical/electronic (E/E) architecture. This first article provides a short, high-level introduction to the zonal node and establishes a common understanding of its main responsibilities. The series gradually explains how this component enables message exchange between in-vehicle communication networks, with a particular focus on routed and broadcast communication over CAN and LIN. Later articles move from these concepts into more detailed design and implementation topics. As the entry point to the Zonal Communication and Control series, this article focuses on the zonal node from an architectural perspective. It does not cover system-level use cases or application-specific configurations, which are addressed in later articles.     3 Overview This article introduces an S32K3-based zonal node and explains how it connects to several in-vehicle networks. In practice, the zonal node sits between central vehicle controllers and local devices such as sensors, actuators, or small control modules, helping messages move between them. The zonal node receives messages from the central controller and forwards them to local nodes, while also sending status information and responses back to the central side. Depending on the system design, it can distribute the same message to multiple nodes or route specific messages only to the intended recipients. In addition to message forwarding, the zonal node may perform limited local processing, such as message filtering, signal aggregation, data validation, or basic decision-making related to communication handling. However, higher-level functional decisions are typically managed by central controllers, with the zonal node focusing primarily on efficient and reliable data exchange. This role becomes clearer in the context of evolving automotive E/E architectures. Traditional designs relied on many purpose-specific electronic control units (ECUs) connected through dedicated wiring. As system complexity increased, that approach added wiring weight, raised cost, and limited scalability. Figure 1. Zonal controller highlighted within the EV architecture Zonal architectures address these limitations by grouping nearby functions within the same physical area of the vehicle and moving more processing into central computing units. In this model, the zonal controller manages local communication and forwards relevant information to the central system. In this context, the S32K3 MCU family supports the required functionality by providing automotive communication interfaces such as CAN FD and LIN. On devices that include the necessary interfaces, the zonal node can connect different network types and handle message traffic between them. Within the scope of this project, the S32K3 platform is suitable for implementing the zonal node due to its available communication peripherals, processing capability, and automotive safety features, which are sufficient for the number of connected nodes and the complexity of the communication tasks considered. This article is intended for: System architects evaluating zonal or domain-based vehicle designs Embedded software engineers implementing communication routing logic Engineers evaluating MCU platforms for multi-network automotive applications By reading this series, you will understand why zonal communication components matter, how they fit into modern vehicle architectures, and how the S32K3 platform can support this role.     4 Context In a complete vehicle system, the zonal node sits between the central control system and local hardware. Its main job is to pass, route, or translate messages, not to make application-level decisions. Keeping these roles separate helps the system remain predictable, reliable, and easier to scale. The zonal node may receive messages from central controllers that manage vehicle-wide functions or from local devices such as sensors, actuators, and smaller control modules. It then exchanges this information across different networks in a controlled and time-aware way. Note: CAN and LIN remain important because they are widely used in automotive systems and are well suited to many control tasks. The S32K3 family supports these needs with integrated CAN FD and LIN interfaces and Arm® Cortex®-M7 CPU cores for routing and control tasks. It also includes automotive safety features aligned with ISO 26262 and low-power modes that are useful in some system designs. Together, these features allow the zonal node to handle several communication channels at the same time while keeping the network interfaces clearly separated. High-Level Architecture Diagram Figure 2. Diagram concept for S32K3 Zonal Node Figure 2 shows where the zonal node sits in the system: between the central control side and the local edge nodes, acting as the bridge between networks. Later articles will expand this context in a structured way. The series will first present the overall system, then describe the software and hardware environment that supports the zonal node. It will also cover internal control logic and key communication topics such as CAN-to-CAN routing, LIN-to-CAN routing, and Ethernet-to-CAN communication. Finally, it will discuss common challenges in multi-network routing and zonal integration.     5 References NXP Body Domain and Zonal Controller S32K3 for Zonal Aggregator     6 Conclusion This article provided a high-level introduction to the S32K3-based zonal node as a communication component in modern automotive architectures. It explained what the node does and where it fits in the system, creating a basis for the more detailed topics covered later in the series. Instead of focusing on implementation details, this introductory article explained why zonal nodes are needed and which problems they help address. The next articles in the series will build on this foundation by exploring system structure, configuration, communication routing strategies, and design challenges in greater detail.
查看全文
    Table of Contents Why embedded development needs a better workflow What Model-Based Design is A simple mental model: from idea to executable model to hardware Why engineers use it: the core advantages Verification along the way: MIL, SIL, PIL, HIL How NXP enables this with Model-Based Design Toolbox (MBDT) What comes next in this article series     1 Why embedded development needs a better workflow Modern embedded systems are no longer isolated functions running on a single controller. In today's vehicles and intelligent machines, applications span sensing, communication, control, safety logic, diagnostics, and multiple processing nodes that must work together as one system. As this complexity grows, traditional workflows based mainly on handwritten code and late-stage hardware testing become difficult to scale, hard to validate early in the development cycle, and slow to iterate. Issues are often discovered late, when integration becomes more costly and harder to manage. Model-Based Design offers an alternative approach designed to address these challenges. It enables earlier validation and a more structured development flow, where verification is not an afterthought, but part of every stage of development.     2 What Model-Based Design is   Model-Based Design is a visual way of programming, where you build your functionality by drawing an engineering diagram, and that diagram can be executed—either as a simulation on your computer or as code running on real hardware. In this approach, models become the central engineering artifact used to design, simulate, verify, and deploy embedded systems. Instead of starting from low-level implementation details, engineers create an executable model of the application behavior, simulate, verify, refine it, and then generate code for the target system. This model-centric workflow makes designs easier to understand, easier to reuse, and less prone to errors. It also enables model-based testing, where test cases can be derived directly from system models and used to verify behavior early in development.     3 A simple mental model: from idea to executable model to hardware A simple way to think about Model-Based Design is this: you describe what the system should do in an executable model, validate that behavior in simulation, and then carry the same design through to the final implementation. In this approach, the model is not just documentation—it becomes an active engineering asset used for design, simulation, verification, and code generation. This creates a direct path from idea to application, where requirements, design, prototyping, testing, and deployment are connected in one continuous workflow.     4 Why engineers use it: the core advantages One of the biggest advantages of Model-Based Design is that it changes where engineering effort is spent. Instead of focusing primarily on how to implement functionality at a low level, engineers can focus on what the system should do—its behavior, control strategy, and response to real-world scenarios. This approach also enables early validation. System behavior can be simulated on a PC before the final hardware is available, allowing issues to be detected earlier and reducing costly rework late in the development cycle. In addition, Model-Based Design enables hardware-independent simulation, where algorithms can be developed and validated before being tied to a specific target platform. This allows teams to explore designs faster and reuse validated functionality across different hardware solutions. As a result, teams benefit from: faster iteration during development improved traceability between design and implementation reduced integration risk more consistent validation across development stages Ultimately, this contributes directly to faster time-to-market, as development cycles are shortened and fewer late-stage issues need to be addressed. Some concrete examples can be found in the following articles: From Virtual Vehicle to All-Electric Off-Road UTV in Less Than a Year Dyson Accelerates New Product Development with System-Level Simulation     5 Verification along the way: MIL, SIL, PIL, HIL A key strength of Model-Based Design is that validation happens continuously throughout development. This is typically organized into several stages: Model-in-the-Loop (MIL): the model is tested against a simulated environment Software-in-the-Loop (SIL): generated code is executed on the host PC and compared to model behavior Processor-in-the-Loop (PIL): code runs on the target MCU to verify functional correctness and performance Hardware-in-the-Loop (HIL): the controller is tested against a real-time or emulated system before final deployment These stages provide a structured validation path, ensuring that issues are detected early and confidence is built progressively before running on final hardware. Model-Based Design also supports reuse and scalability. A validated model can be adapted, parameterized, or reused across multiple systems, reducing development effort and improving consistency.     6 How NXP enables this with Model-Based Design Toolbox (MBDT) To make this workflow practical on real embedded hardware, NXP provides the Model-Based Design Toolbox (or MBDT). This acts as a bridge between the MathWorks' and NXP's software ecosystems, and allows the entire workflow to be done from one environment, as depicted in the diagram above. Concretely, this allows engineers to use MATLAB and Simulink to design, simulate, verify, and automatically generate code that can run directly on NXP microcontrollers and processors. MBDT provides: block libraries for hardware access integration with configuration tools for pins, clocks, and peripherals support for PIL workflows code generation and deployment capabilities profiling and runtime monitoring through tools like FreeMASTER This creates a complete end-to-end flow—from model to validated application running on target hardware. Engineers can explore functionality at a high level, validate behavior through simulation, and deploy with confidence onto real systems.     7 What comes next in this article series In the articles that follow, we will move from this general introduction to concrete, real application examples. We will show how Model-Based Design and NXP tools can be applied across a modern system architecture, covering applications such as battery management, motor control, radar, steering, lighting, and parking sensors. Each example will illustrate how functions can be designed, validated in simulation, and deployed onto the appropriate hardware nodes. The key idea is simple: Model-Based Design helps engineers focus on system behavior while reducing the gap between concept, implementation, and validation. With NXP's Model-Based Design Toolbox, this approach can be carried from the modeling environment all the way to a running application on hardware. MBDT  https://www.nxp.com/mbdt https://mathworks.com/nxp 
查看全文
  1 Table of Contents • Introduction • Overview • Context • References • Conclusion     2 Introduction This article presents an automotive system built around a central computer that processes high volumes of data to manage interactions and decisions across the vehicle. Implemented on an NXP S32N55 board, a main node orchestrates peripheral nodes — Lighting, Motor Control, Steering, Radar, and Parking Sensors — over CAN, demonstrated through real-time interactions and Driver-in-the-Loop (DiL) simulations. The same architecture also enables stimuli and scenarios to be injected directly from Simulink/MATLAB via the Model-Based Design Toolbox (MBDT), turning the setup into both a functional prototype and a flexible test bench that shortens the loop between design, validation, and refinement.     3 Overview The communication hub acts as a comprehensive aggregator and decision-maker, serving as the central intelligence of the entire automotive control network. This architectural choice follows industry's best practices by consolidating critical decision-making processes into a single, robust processing unit capable of efficiently managing multiple concurrent data streams and executing time-sensitive commands. Centralizing this logic also simplifies maintenance and traceability, since the rules governing vehicle behavior live in one well-defined place rather than being scattered across multiple ECUs. For a project of this nature, the NXP Model-Based Design Toolbox (MBDT) offers a practical development path: control logic and application behavior can be designed in Simulink/MATLAB and deployed directly onto the S32N55, without a separate hand-coding step. The graphical, model-based workflow makes the system's structure easier to follow and adjust, while built-in support for CAN communication and integration with tools like FreeMASTER for live telemetry simplify both stimulus injection and runtime observation. The result is a smoother path from initial concept to a working prototype that can be iterated on and validated in a controlled, repeatable way. In this specific implementation, the main node hosts an application that fulfills two complementary roles: data aggregator and decision-maker. As an aggregator, it collects, synchronizes, and interprets incoming signals from the sensing nodes; as a decision-maker, it translates that fused view of the environment into concrete commands for the actuators. Practically, our system receives data over CAN from the peripheral sensing nodes (Radar, Parking Sensors) and dispatches commands to the actuator nodes (Motor Control, Lights, Steering). The main node is also designed to make safety-critical decisions based on the incoming inputs — for example, triggering Automated Emergency Braking (AEB) when the Parking Node or the Radar Node detects a hazardous situation. Because these decisions are made centrally, the response logic can take the full context into account (vehicle speed, proximity of obstacles, current steering input) rather than reacting to a single sensor in isolation.     4 Context At its core, the main node receives a continuous stream of data over the CAN bus from peripheral nodes distributed throughout the vehicle. These peripheral nodes include: Radar sensors — provide long-range object detection and relative velocity measurements, making them ideal for highway-speed scenarios and forward collision awareness. Parking sensors — monitor the immediate vicinity of the vehicle for obstacles and potential collision risks, typically at very short range and at low speeds. Fault sensors — for actuator nodes, like the motor control, steering and lighting systems. The CAN bus protocol guarantees the reliable, deterministic communication required to meet the stringent timing demands of automotive safety systems. Its built-in arbitration, error detection, and message prioritization make it a natural fit for a distributed architecture in which safety-relevant signals must always reach the main node within a bounded time window. To streamline communication across components, a CAN Database ( DBC ) file has been created that contains all the signals and messages used throughout the system. The DBC file acts as a single source of truth for the entire network: every node — whether sensing or actuating — references the same definitions for message IDs, signal layouts, scaling factors, and value ranges. This drastically reduces the risk of integration mismatches when multiple boards are developed in parallel. Beyond its data aggregation role, the main node also serves as the command center for the vehicle's actuator systems. After receiving data from the simulation, it is being processed and then it transmits precisely timed control signals to critical subsystems, including the motor control unit, lighting system, and steering mechanism. This bidirectional architecture enables closed-loop control strategies, in which sensor feedback continuously informs actuator commands to achieve the desired vehicle behavior. Each actuator node remains responsible for the low-level handling of its hardware, while the main node provides the high-level command to the actuators. Since the main node is responsible for receiving, analyzing, processing and sending data, it also becomes the one responsible for sharing the telemetry information upstream, either to the cloud, or to real time monitoring tools like FreeMASTER. A particularly valuable aspect of this system is its seamless integration with the Simulink/MATLAB environment, which unlocks extensive possibilities for system validation and scenario testing. Engineers can inject stimuli into the simulation and analyze a wide range of driving conditions and edge cases without requiring a full-scale prototype. This is especially useful for reproducing rare or dangerous situations — such as sudden obstacles or sensor faults — in a fully controlled and repeatable environment. To achieve two-way communication between the main node and the simulation, the CAN bus itself is used to communicate with the Simulink model. This way, the physical prototype can feed stimuli into the simulation — and vice versa — on the same CAN bus that devices are using to communicate, significantly expanding the boundaries of the testing environment. The same DBC file that defines the on-vehicle communication is reused on the simulation side, ensuring that the messages exchanged between the real and virtual worlds remain perfectly consistent.   Note: Perhaps one of the most noteworthy features of the main node's active functions is its ability to make safety-critical decisions in real time based on aggregated sensor inputs. The system continuously monitors data from both the parking sensors and the radar node, detecting potentially dangerous situations that require immediate intervention: At low speeds — hazard detection is typically driven by the parking sensors mounted on the front and/or rear of the vehicle, where short-range, high-resolution distance measurements are most relevant. At driving speeds — the radar module takes over, collecting and analyzing data that is then forwarded to the main node for higher-level interpretation. In both scenarios, the main node remains the ultimate decision-maker, fusing all available data to determine the appropriate response. This clear separation between sensing, decision-making, and actuation keeps each component focused on a single responsibility and makes the overall system easier to reason about, extend, and validate.     5 References NXP Model-Based Design Toolbox (MBDT) Community Interacting with Digital Inputs/Outputs on MR-CANHUBK344 Communicating over the CAN Bus S32N Vehicle Super-Integration Processors     6 Conclusion This article has provided an overview of the communication hub's core functionality, offering a high-level perspective on how key systems interact within the overall architecture. The main node was presented both as a data aggregator and as a decision-maker, with a particular emphasis on its role in safety-critical scenarios and its integration with the Simulink/MATLAB environment. Future installments in this series will take a deeper dive into the communication hub — covering the specific board in use, detailed hardware and software requirements, and other technical considerations and implementation nuances. Subsequent articles will also explore individual peripheral nodes in more detail, building up a complete picture of the system one subsystem at a time.
查看全文
Introduction The following article shows a basic configuration and model for S32K396BMS-EVB that configures the SPI to communicate with the MC33CD1030 MSDI IC mounted on the evaluation board.   Prerequisite software The following software tools were used to develop and deploy the application onto the S32K396BMS-EVB board. MATLAB® R2024b or later Simulink ® MATLAB ® Coder™ Simulink ® Coder™ Embedded Coder ® Support Package for ARM ® Cortex ® -M Processors S32K3 MBDT Toolbox Version 1.4.0 BMS MBDT Toolbox Version 1.2.0 FreeMASTER Run-Time Debugging Tool   Prerequisite hardware The application is developed for the following hardware*: S32K396BMS-EVB Debug probe (used to deploy the example and to connect the FreeMASTER application to the board) 12V power supply   Configuration project In this chapter, I show most important settings that must be to allow the MCU to enter standby mode and to be able to wake up and switch to RUN mode again. For more details, please download the files attached and consult the configuration project.   Pins configuration   For the CD1030, only the SPI pins must be configured; LPSPI3 PCS1: PTF18 (OUTPUT) LPSPI3 CLOCK: PTF13 (OUTPUT) LPSPI3 SIN: PTF12 (INPUT) LPSPI3 SOUT: PTF15 (OUTPUT)   Figure 1. Configuration Pins tab - LPSPI pins   Peripherals configuration Platform component The interrupt must be configured for the LPSPi3. To configure it, please go to PLATFORM -> Interrupt Controller and add a new entry into the table, as below. Figure 2. Configuration Platform Component - Enable LPSPI3 interrupt   MCU Component The peripheral clock must be enabled and it can be done from the MCU component -> McuModuleConfiguration -> McuModeSettingsConf. Figure 3. Configuration MCU Component - Enable LPSPI3 peripheral clock   SPI Component The MCU communicates with MC33CD1030 over the LPSPI3. First step is to configure the Spi -> SpiGeneral -> SpiPhyUnit Figure 4. Configuration SPI Component - SpiPhyUnit (LPSPI3)   Then, the Spi->SpiDriver must be configured. Important! The frame size of the SPI messages: It must be 32-bit wide and MSB. Figure 5. Configuration SPI Component - SpiChannel   Figure 6. Configuration SPI Component - SpiExternalDevice   Figure 7. Configuration SPI Component - SpiJob   Figure 8. Configuration SPI Component - SpiSequence   Model configuraiton The Simulink model used to communicate with the MC33CD1030 can be seend in the picture below. It can also be found in the achieve attached to this article. The initialization of the model sets the AsyncMode to interrupt. Figure 9. Simulink Model - Initialization subsystem   The application executes the following tasks at each step: Set up the External Buffer for the LPSPI3 SpiChannel_CD1030. The input for the block must be an array of 4 uint8 elements (in total 4 bytes - 32bit). The control word is the last element, while the first 3 elements are the configure words. The Dest Data output is a data story memory configured as uint8 with the size equal to 4.  Send the command to the MC33CD1030 IC and receive the previous result in CD1030_RecvData_SG data store Increment a variable to check that the application is running   Figure 10. Simulink Model - Full Overview   Validation To validate the application, the FreeMASTER tool is used to connect to the board and initiate the sequence to enter standby mode. To connect the board, you can use the LPUART1 (J6 connector), baud rate 115200. If everything is properly configured, in the FreeMASTER you should see the following in the Variable Watch: The SPI_SetAsyncMode_Status, CD1030_SetupEB_Status and SPI_Transmit_Status should all be 0. The CD1030_RecvData_SG (BIN) and CD1030_RecvData_SG (HEX) should display the content of the CD1030's register 0x3E Read switch status registers SG. The step_counter should increment at each step execution. Figure 11. FreeMASTER Project - Variable Watch   To test that the CD1030 is working, I connect the J10_6 (SG0 - KEY_ON_DIN) to either GND or VCC and we can see that the last bit of the register changes.  Figure 12. FreeMASTER Project - J10_6 connected to GND  Figure 13. FreeMASTER Project - J10_6 connected to VCC   Conclusion   In this article, I presented a basic implementation that allows the S32K396 communicate with the MC33CD1030 IC over the SPI. For further details, please consult the MC33CD1030 reference manual.
查看全文
  Product Release Announcement Analog & Automotive Embedded Systems NXP Model-Based Design Toolbox for S32K3 – version 1.7.1     The Automotive Embedded Systems, Model-Based Design Tools Team at NXP Semiconductors, is pleased to announce the release of the Model-Based Design Toolbox for S32K3 version 1.7.1. This release supports automatic code generation for S32K3 peripherals and applications prototyping from MATLAB/Simulink for NXP S32K3 Automotive Microprocessors. This new product adds support for S32K310, S32K311, S32K312, S32K314, S32K322, S32K324, S32K328, S32K338, S32K341, S32K342, S32K344, S32K348, S32K358, S32K364, S32K366, S32K374, S32K376, S32K388, S32K394 and S32K396 MCUs, and part of their peripherals, based on RTD MCAL components (ADC, CAN, DIO, FEE, GPT, I2C, ICU, LIN, MEM, MCL, PWM, SPI, UART), and support for the GD3162 Gate Driver based on the S32K396 GD3162 Software. In this release, we have also updated the RTD, S32 Configuration Tools, AMMCLib, FreeMASTER, and MATLAB support for the latest versions. The product comes with over 180 examples, covering all the features and functionalities of the toolbox, including new demos for GD3162 Gate Driver applications.   Target audience: This product is part of the Automotive SW – Model-Based Design Toolbox.   FlexNet Location: https://nxp.flexnetoperations.com/control/frse/download?element=7846241   Technical Support: NXP Model-Based Design Toolbox for S32K3 issues will be tracked through the NXP Model-Based Design Tools Community space.   Release Content: Automatic C code generation from MATLAB® for NXP S32K3 derivatives: S32K310 S32K311 S32K312 S32K314 S32K322 S32K324 S32K328 S32K338 S32K341 S32K342 S32K344 S32K348 S32K358 S32K364 S32K366 S32K374    S32K376    S32K388    S32K394  S32K396   Support for the following peripheral components and functions: ADC CAN DIO eTPU FEE GD3162 GPT I2C ICU LIN MCL (including DMA support) MEM Memory read/write PWM Profiler Registers read/write SPI UART   New RTD version supported (6.0.0)   Integrates S32K396 GD3162 v2.0.2 The toolbox enables access to the GD3162 gate driver for S32K396 derivatives from Simulink models, by delivering a library block (Gd3162) that generates code on top of GD3162 components API.   New S32 Configuration Tools version supported (2024.R1.8)😎   Integration with EB tresos v29.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   Default Configuration Project Templates targeting all the supported S32K3 derivatives The toolbox delivers default configuration projects, available in both S32 Configuration Tools and EB tresos, covering an initial enablement of the on-board peripherals, pins, and clocks, for all the supported S32K3 derivatives. The desired template, which represents the starting point for enabling the hardware configuration of the application, can be selected via a dropdown widget.   Support for creating and using Custom Project Templates The toolbox provides support to use and create custom project templates. This could be very useful when having a custom board design – offering the possibility to create the configuration for it only once. After it is saved as a custom project template, it can be used for every model that is being developed.   Such custom projects, addressing specific hardware designs are offered inside the current version of the toolbox to integrate the following EVBs: MCTPTX1AK324 S32K344-WB S32K396-BGA-DC1 MR-CANHUBK344, alongside a set of examples specifically created to target this hardware design and a series of articles (available on NXP Community) demonstrating how to use the toolbox features and functionalities for creating applications for custom boards.   The toolbox has been tested and validated on the official NXP Evaluation Boards     S32K31XEVB-Q100     S32K312EVB-Q172     XS32K3X2CVB-Q172     XS32K3X4EVB-Q257     XS32K3XXEVB-Q172     MR-CANHUBK344             S32K3X4EVB-T172      S32K344-WB        XS32K3X8CVB-Q172     S32K388EVB-Q289             XS32K396-BGA-DC     XS32K396-BGA-DC1   Integrates the Automotive Math and Motor Control Library release 1.1.42 All functions in the Automotive Math and Motor Control Functions Library v1.1.42 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. S32 Design Studio integration We provide the feature of importing the code generated from a Simulink model inside the S32 Design Studio IDE. This functionality can be useful if the model needs to be integrated into an already existing project or for debug 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) including AUTOSAR SW-C deployment External mode   GD3162 Applications The toolbox provides examples for configuring and accessing the external GD3162 gate driver device via SPI communication to demonstrate Dynamic Gate Strength and DC Link Discharge features, supporting both S32 Configuration Tools and EB tresos. Each of them has a detailed description of the hardware setup and an associated FreeMASTER project which can be used for control and data visualization. The examples provided in this release include the following topics: - GD3162 Dynamic Gate Strength - GD3162 DC Link Discharge   Motor Control Applications The toolbox provides examples for 1-shunt and 2-shunt PMSM and BLDC motor control applications, supporting both S32 Configuration Tools and EB  tresos. Each of the examples provides a detailed description of the hardware setup and an associated FreeMASTER project which can be used for control and data visualization. The toolbox also demonstrates the integration of the Motor Control Blockset in developing such applications.   For demonstrating the S32K3 eTPU Software integration, we have included a PMSM application where the FOC algorithm runs on the main CPU of the S32K396 MCU, while the analog sensing, software resolver, and PWM signals generation are offloaded to the eTPU co-processor.   The motor control applications were developed and validated on the MCSPTE1AK344 and MCSPTR2AK396 Motor Control kits.   Support for MATLAB versions We added support for the following MATLAB versions: R2021a R2021b R2022a R2022b R2023a R2023b R2024a R2024b R2025a R2025b   Examples for every peripheral/function supported More than 180 examples showcasing: I/O Control Timers and scheduling Communication (CAN, I2C, LIN, SPI, UART) Memory handling GD3162 Gate Driver applications (DC Link Discharge and Dynamic Gate Strength) Motor Control applications (BLDC and PMSM) AMMCLib FreeMASTER SIL / PIL / External mode For more details, features, and how to use the new functionalities, please refer to the Release Notes and Quick Start Guides documents attached.   MATLAB® Integration: The NXP Model-Based Design Toolbox extends the MATLAB® and Simulink® experience by allowing customers to evaluate and use NXP’s S32K3 MCUs and evaluation board solutions out-of-the-box. NXP Model-Based Design Toolbox for S32K3 version 1.7.1 is fully integrated with MATLAB® environment.   Target Audience: This release (1.7.1) is intended for technology demonstration, evaluation purposes, and prototyping S32K3 MCUs and Evaluation Boards.   Useful Resources: Examples, Trainings, and Support: https://community.nxp.com/community/mbdt      
查看全文
Introduction   The following article shows a basic configuration for S32K3 that allows the MCU to transition from RUN mode to a Standby mode.   Prerequisite software   The following software tools were used to develop and deploy the application onto the S32K3 board. MATLAB® R2023b or later Simulink ® MATLAB ® Coder™ Simulink ® Coder™ Embedded Coder ® Support Package for ARM ® Cortex ® -M Processors S32K3 MBDT Toolbox Version 1.8.0 FreeMASTER Run-Time Debugging Tool   Prerequisite hardware   The application is developed for the following hardware*: X-RD-K344BMU (MCU: S32K344-Q257) Debug probe (used to deploy the example and to connect the FreeMASTER application to the board) 12V power supply Jumper Wire   Configuration project   In this chapter, I show most important settings that must be to allow the MCU to enter standby mode and to be able to wake up and switch to RUN mode again. For more details, please download the files attached and consult the configuration project. Pins configuration Two pins must be configured for this application: Signal wkpu,14  (of WKPU peripheral) to the PTB17. Direction: Input Pull Select: Pullup Pullup Enable: Enabled Signal gpio, 65 (of SIUL2 peripheral) to the PTC1. Direction: Output     Figure 1. Configuration Pins tab - Dio_Pins_MBDT Functional Group   Clocks configuration A new Functional Group must be created for the Standby Mode. This can be done from the Clocks tab (as shown in the image below).   Figure 2. Configuration Clock tab - Create new Functional Group   Peripherals configuration Dio component   Figure 3. Configuration Dio Component - DioGeneral     Figure 4.  Configuration Dio Component - DioChannel Wkpu_DioChannel     Figure 5.  Configuration Dio Component - DioChannel Green_Led_DioChannel   Port configuration The Port configuration must match the settings configured in the Pins tab (check Pins Configuration chapter).   Figure 6. Configuration Port component - PortPin Wkpu_PortPin     Figure 7. Configuration Port component - PortPin Green_Led_PortPin   Mcu configuration A new McuModeSettingConf must be created. It is going to be used to switch to STANDBY mode.   Figure 8. Configuration Mcu component - McuModuleConfiguration -> McuModeSettingConf   A new McuClockSettingConfig must be created. The MCU will use to this clock tree when it is in standby. All the settings in this newly created McuClockSettingConfig must match the settings made in Clocks tab.     Figure 9. Configuration Mcu component - McuModuleConfiguration -> McuClockSettingsConfig   Make sure that for the new McuClockSettingsConfig, in the configuration tab, the Functional Group created in Figure 2 is selected.     Figure 10. Configuration Mcu component - McuModuleConfiguration -> McuClockSettingsConfig -> Configuration     ICU configuration     Figure 11. Configuration Icu component - IcuConfigSet -> IcuChannels   Note! The first 4 Hardware Channel are internally routed. For the evaluation board that I used, the PTB17 corresponds to the WAKE_14. In the configuration project, the hardware channel must be set to CH18 (to offset the first 4 internally routed hardware channel).     Figure 12. Offset internally routed hardware channels     Figure 13. Configuration Icu component - IcuConfigSet -> IcuWkpu -> IcuWkpuChannels     Figure 14. Configuration Icu component - IcuConfigSet -> IcuHwInterruptConfigList   Model configuration   The Simulink model used to switch from RUN mode to STANDBY mode can be seen in the picture below. It can also be found in the achieve attached to this article. The application executes the following tasks at each steps: Toggle the LED to visually tell if the board is running or in standby mode Increment a variable Check if the enter_standby variable is set to 1. If true, the sequence to enter standby mode is executed.   Figure 15. Simulink Model S32K3_Standby_GPIO_Wkpu     Figure 16. Enter Standby mode routine     Figure 17. Custom code to enter standby mode   Validation   To validate the application, the FreeMASTER tool is used to connect to the board and initiate the sequence to enter standby mode. To connect the board, I used the debug probe.   Figure 18. Connect FreeMASTER tool to the board using debug probe   If everything is properly configured, the FreeMASTER should now be connected to the board. In the Variable Watch, the value of the counter variable is increased each second.  To enter standby mode, the value of the enter_standby variable must be set to 1. If the sequence to enter standby mode is correctly executed, the value of the counter shouldn't be updated anymore and the LED should stop blinking. Also, the board is disconnected from the FreeMASTER board. To exit standby mode, use the jumper wire to connect the PTB17 to a GND pin. The LED should start blinking.   Conclusion   In this article, I presented a basic implementation that allows the S32K344 to enter standby mode. The configuration presented here doesn't maximize the power savings, as the user should take care of putting the pins in a floating state, disable all unnecessary clocks and many more. For further details, please consult the S32K3 reference manual.   This application was based on the examples found in this article: S32K3 Low Power Management AN and demos. Kudos @Shuang!
查看全文
Table of Contents 1. Introduction 2. Requirements 2.1 Software Required 2.2 Hardware Required 3. NXP Account Login 4. Installation 4.1 PEmicro Driver Installation 4.2 FreeMASTER Installation 4.3 MATLAB® Installation 4.4 MATLAB® Add-Ons Installation 4.5 MBDT for S32K3 v1.8.0 Installation 5. Running a Demo from the MBDT Examples for S32K3 6. Running a Motor Control Demo using MBDT 7. Conclusion 1. Introduction This article aims to help new users prepare and install the necessary software and hardware to use the FRDM Automotive S32K312 with the latest  Model-Based Design Toolbox for S32K3 version 1.8.0. Note: These steps can also be followed with any NXP Evaluation Board from the supported list referenced in the toolbox documentation. S32K312MINI‑EVB Renamed to FRDM‑A‑S32K312: Now part of the FRDM Automotive Ecosystem under its new name, the board keeps the same hardware and adds full ecosystem compatibility for flexible, scalable development.     2. Requirements   2.1 Software Required MATLAB® R2023b or later, with the following Add-ons: AUTOSAR Blockset Embedded Coder Support Package for ARM Cortex-M Processors Motor Control Blockset NXP_Support_Package_S32K3 Stateflow NXP Model-Based Design Toolbox for S32K3 version 1.8.0 FreeMASTER Run-Time Debugging Tool PEmicro Hardware Interface Drivers   2.2 Hardware Required FRDM-A-S32K312 Development Board MCSPTE1AK344 Motor Control Kit, which includes: Sunrise motor  DEVKIT-MOTORGD  12V power supply USB Type-C cable   3. NXP Account Login Open Software Licensing: Support, make sure you are logged into your NXP Account, and select: Click on My NXP Account. Select Software Licensing and Support. Then click on View accounts: These steps will ensure that you are properly authenticated with your NXP Account before proceeding with step 4.5 MBDT for S32K3 v1.8.0 Installation. Keep the page open for the login to persist.   4. Installation Note: Before proceeding, make sure you have full access to your PC or Laptop. Some installers require local admin rights. Contact your IT department to assist you with installation.   4.1 PEmicro Driver Installation After downloading the PEmicro Hardware Interface Drivers: Open the installer package and select the default Destination Folder: Click on Install and then wait for it to finish successfully. Connect the USB cable to your PC and the FRDM Automotive S32K312 board: Open Device Manager to check OpenSDA and the COM port number. OpenSDA - CDC Serial Port → note this COM port number: Note: The COM port number may differ on your system.   4.2 FreeMASTER Installation Download the  FreeMASTER Run-Time Debugging Tool:   Open the installer FMASTERSW32.exe Click Next, then select all available products: Use the default installation path: C:\NXP\FreeMASTER 3.2 Wait for the installation to complete.   4.3 MATLAB® Installation First, check whether MATLAB® R2023b or later is already installed. If so, you can skip this section. For this tutorial, MATLAB® R2025b is downloaded from MathWorks®: Download the matlab_R2025b_Windows.exe (246 MB) file. A MathWorks® Account login is required. After signing in, select the installation directory; the default is C:\Program Files\MATLAB\R2025b For minimum requirements, install the following products: MATLAB® Simulink® AUTOSAR Blockset Embedded Coder MATLAB® Coder Motor Control Blockset Simulink® Coder Stateflow By default, Select All is enabled during install: Wait for the installation to finish. After installation, open MATLAB® and change the default Add-ons path to a shorter path such as C:\MathWorks .   4.4 MATLAB® Add-Ons Installation Open Add-On Explorer and install: Embedded Coder Support Package for ARM Cortex-M Processors NXP Support Package for S32K3 (NXP_Support_Package_S32K3)   4.5 MBDT for S32K3 v1.8.0 Installation After installing the support package, run the following command in MATLAB®: sp_s32k3.nxp.setup(); Select version 1.8.0; the installer will check prerequisites: If any toolboxes are missing, install them before continuing. Click Download to proceed. The Download button opens the Software Terms and Conditions dialog; if the page is not loading properly, follow the steps in 3. NXP Account Login. After reading, click I Agree. Download the SW32_MBDT_S32K3_1.8.0_D2512.mltbx file (approx. 1.6 GB): Once the download completes, browse to the location of the SW32_MBDT_S32K3_1.8.0_D2512.zip file: Click Install to proceed and accept the license agreement. After a few minutes, the dialog will display: Installation successfully completed! Click Next. Select an option such as Open S32K3 Root Folder. MATLAB®'s current folder will change to the root of the toolbox. Click Finish to close the installer. The current folder in MATLAB® is now C:\MathWorks\Toolboxes\NXP_MBDToolbox_S32K3 :     5. Running a Demo from the MBDT Examples for S32K3 Navigate to C:\MathWorks\Toolboxes\NXP_MBDToolbox_S32K3\S32K3_Examples\demos\s32k3xx_uart_leds_s32ct Open the model s32k3xx_uart_leds_s32ct.mdl . Click on Hardware Settings: Go to Hardware Board Settings → Hardware → Select Configuration Project Template: For the FRDM-A-S32K312 select Custom: S32K312MINI-EVB S32 Config Tool. A Warning Dialog will appear; click OK. Wait for the configuration update to complete. Click on Apply and close the Configuration Parameters window. Press Build, Deploy & Start (CTRL+B) to generate the code: After the build completes successfully, the executable is downloaded to the board. Open a terminal application and connect to the board's COM port at 115200 baud: Pressing r, g, or b on the keyboard toggles the corresponding RGB LED on the board.   6. Running a Motor Control Demo using MBDT Navigate to C:\MathWorks\Toolboxes\NXP_MBDToolbox_S32K3\S32K3_Examples\mc\PMSM Open the folder s32k312_mc_pmsm_2sh_s32ct : Open the model s32k312_mc_pmsm_2sh_s32ct.mdl : Press Build, Deploy & Start (CTRL+B) to generate the code. After the executable file is downloaded to the board: Disconnect the FRDM-A-S32K312 board from the PC. Insert the DEVKIT-MOTORGD on top of the FRDM-A-S32K312, ensuring proper pin alignment. Plug in the 12V power supply to the DEVKIT-MOTORGD. Reconnect the USB Type-C cable to the FRDM-A-S32K312.  The RGB LED and User Buttons are on the top side, the Reset Button is on the left side, while the 12V power, Motor Phases, and USB Type-C are on the right side.    Open FreeMASTER s32k312_mc_pmsm_2sh_s32ct.pmpx : Press GO to connect at 115200 baud. In the App Control tab, press On and set Speed Required to 1000 RPM: Apply a small mechanical load to the motor (friction force to the motor shaft) and observe the iABC currents. Here is a short video with the steps above explained:   7. Conclusion These steps conclude the Getting Started with FRDM Automotive S32K312 using the Model-Based Design Toolbox guide. For more details, refer to: s32k312_mc_pmsm_2sh_s32ct_example_readme.html The corresponding example_readme.html for the selected model. Thank you for your time, Stefan V.
查看全文
  Product Release Announcement Analog & Automotive Embedded Systems NXP Model-Based Design Toolbox for S32K3 – version 1.8.0     The Analog & Automotive Embedded Systems, Model-Based Design Tools Team at NXP Semiconductors, is pleased to announce the release of the Model-Based Design Toolbox for S32K3 version 1.8.0. This release supports automatic code generation for S32K3 peripherals and applications prototyping from MATLAB/Simulink for NXP S32K3 Automotive Microprocessors. This new product adds support for S32K310, S32K311, S32K312, S32K314, S32K322, S32K324, S32K328, S32K338, S32K341, S32K342, S32K344, S32K348, S32K356, S32K358, S32K364, S32K366, S32K374, S32K376, S32K388, S32K389, S32K394 and S32K396 MCUs, and part of their peripherals, based on RTD MCAL components (ADC, CAN, DIO, FEE, GPT, I2C, ICU, LIN, MEM, MCL, PWM, SPI, UART). In this release, we have also updated the RTD, S32 Configuration Tools, AMMCLib, FreeMASTER, and MATLAB support for the latest versions. The product comes with over 130 examples, covering all the features and functionalities of the toolbox, including new demos for motor control applications.   Target audience: This product is part of the Automotive SW – Model-Based Design Toolbox.   FlexNet Location: https://nxp.flexnetoperations.com/control/frse/download?element=7690521   Technical Support: NXP Model-Based Design Toolbox for S32K3 issues will be tracked through the NXP Model-Based Design Tools Community space.   Release Content: Automatic C code generation from MATLAB® for NXP S32K3 derivatives: S32K310 S32K311 S32K312 S32K314 S32K322 S32K324 S32K328 S32K338 S32K341 S32K342 S32K344 S32K348 S32K356 S32K358 S32K364 S32K366 S32K374    S32K376    S32K388 S32K389 S32K394  S32K396   Support for the following peripheral components and functions: ADC CAN DIO eTPU FEE GPT I2C ICU LIN MCL (including DMA support) MEM Memory read/write PWM Profiler Registers read/write SPI UART   New RTD version supported (7.0.0)   New S32 Configuration Tools version supported (2025.R1.8)😎   Integration with EB tresos v32.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   Default Configuration Project Templates targeting all the supported S32K3 derivatives The toolbox delivers default configuration projects, available in both S32 Configuration Tools and EB tresos, covering an initial enablement of the on-board peripherals, pins, and clocks, for all the supported S32K3 derivatives. The desired template, which represents the starting point for enabling the hardware configuration of the application, can be selected via a dropdown widget.   Support for creating and using Custom Project Templates The toolbox provides support to use and create custom project templates. This could be very useful when having a custom board design – offering the possibility to create the configuration for it only once. After it is saved as a custom project template, it can be used for every model that is being developed.   Such custom projects, addressing specific hardware designs are offered inside the current version of the toolbox to integrate the following EVBs: S32K312MINI-EVB MCTPTX1AK324 S32K344-WB S32K3-T-BOX S32K396-BGA-DC1 MR-CANHUBK344, alongside a set of examples specifically created to target this hardware design and a series of articles (available on NXP Community) demonstrating how to use the toolbox features and functionalities for creating applications for custom boards.   The toolbox has been tested and validated on the official NXP Evaluation Boards     S32K31XEVB-Q100     S32K312EVB-Q172     S32K312MINI-EVB     MCTPTX1AK324     XS32K3X2CVB-Q172     S32K3-T-BOX     MR-CANHUBK344       XS32K3X4EVB-Q257     XS32K3X4EVB-Q172           S32K3X4EVB-T172      S32K344-WB        XS32K3X8CVB-Q172     S32K388EVB-Q289      S32K389EVB-Q437            XS32K396-BGA-DC     XS32K396-BGA-DC1   Integrates the Automotive Math and Motor Control Library release 1.1.42 All functions in the Automotive Math and Motor Control Functions Library v1.1.42 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.   S32 Design Studio integration We provide the feature of importing the code generated from a Simulink model inside the S32 Design Studio IDE. This functionality can be useful if the model needs to be integrated into an already existing project or for debug 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) including AUTOSAR SW-C deployment External mode   Motor Control Applications The toolbox provides examples for 1-shunt and 2-shunt PMSM and BLDC motor control applications, supporting both S32 Configuration Tools and EB  tresos. Each of the examples provides a detailed description of the hardware setup and an associated FreeMASTER project which can be used for control and data visualization. The toolbox also demonstrates the integration of the Motor Control Blockset in developing such applications.   For demonstrating the S32K3 eTPU Software integration, we have included a PMSM application where the FOC algorithm runs on the main CPU of the S32K396 MCU, while the analog sensing, software resolver, and PWM signals generation are offloaded to the eTPU co-processor.   The motor control applications were developed and validated on the MCSPTE1AK344 and MCSPTR2AK396 Motor Control kits.   Support for MATLAB versions We added support for the following MATLAB versions: R2023b R2024a R2024b R2025a R2025b   Examples for every peripheral/function supported More than 130 examples showcasing: I/O Control Timers and scheduling Communication (CAN, I2C, LIN, SPI, UART) Memory handling Motor Control applications (BLDC and PMSM) AMMCLib FreeMASTER SIL / PIL / External mode For more details, features, and how to use the new functionalities, please refer to the Release Notes and User Manual documents attached.   MATLAB® Integration: The NXP Model-Based Design Toolbox extends the MATLAB® and Simulink® experience by allowing customers to evaluate and use NXP’s S32K3 MCUs and evaluation board solutions out-of-the-box. NXP Model-Based Design Toolbox for S32K3 version 1.8.0 is fully integrated with MATLAB® environment.   Target Audience: This release (1.8.0) is intended for technology demonstration, evaluation purposes, and prototyping S32K3 MCUs and Evaluation Boards.   Useful Resources: Examples, Trainings, and Support: https://community.nxp.com/community/mbdt      
查看全文
  Product Release Announcement Analog & Automotive Embedded Systems NXP Model-Based Design Toolbox for S32ZE – version 1.4.0     The Analog & Automotive Embedded Systems, Model-Based Design Tools Team at NXP Semiconductors, is pleased to announce the release of the Model-Based Design Toolbox for S32Z/E version 1.4.0. This release supports automatic code generation from MATLAB and Simulink for NXP S32Z/E Automotive Real-Time Processors. This new release supports S32Z2/E2 families and its cores (Real-Time ARM Cortex-R52 cores and DSP/ML processor). It also supports Multicore, 41 Mathematical Operators highly optimized for DSP/ML processor, Processor-in-Loop Simulation mode, RTD components (ADC, PWM, DIO, CAN, UART, GPT, SPI, Application Extension), FreeMASTER, AMMCLib, and execution profiling. The product comes with 40 examples, covering DSP/ML Operators and demonstrating the usage of the peripherals (e.g.: I/O control, timers and scheduling, communication) and multicore concurrent execution.   Target audience: This product is part of the Automotive SW – Model-Based Design Toolbox.   FlexNet Location: https://nxp.flexnetoperations.com/control/frse/download?element=7702701   Technical Support: NXP Model-Based Design Toolbox for S32ZE issues will be tracked through the NXP Model-Based Design Tools Community space.   Release Content: The newly added features are highlighted with bold. Automatic C code generation from MATLAB® for NXP S32Z2/E2 packages: S32E2xx-bga975 S32Z2xx-bga594 S32Z2xx-bga400 GreenBox 3 The toolbox has been tested and validated on the official NXP Evaluation Boards S32E27X-DC S32Z27X-DC GreenBox 3 Rev. B Only S32Z2/E2 chips with DSP/ML option B can use the SPF2 core and associated software Support for the following peripheral components and functions: Application Extension (AE) for S32E: FlexPWM, eTimer, SAR ADC, CTU SPI ADC PWM DIO CAN UART GPT  Multicore support using Concurrent Execution from Simulink Multicore support using Simulink Reference Configurations New Hybrid-Electrical Vehicle (HEV) Example with Virtual Vehicle Composer (VVC) Tool from MathWorks New RTD version supported (2.0.1) New SPF2CE version supported (1.0.0) New AMMCLib version supported (1.1.41) New SPF2 Libraries (MATLAB) version supported (20.4.8) New FreeMASTER Driver version supported (1.4.2) Integration with EB tresos v29.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 Default Configuration Project Templates targeting all the supported derivatives     Support for creating and using Custom Project Templates The toolbox provides support to use and create custom project templates. This could be very useful when having a custom board design – offering the possibility to create the configuration for it only once. After it is saved as a custom project template, it can be used for every model that is being developed. Integrates the Automotive Math and Motor Control Library release 1.1.41 All functions in the Automotive Math and Motor Control Functions Library v1.1.41 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.   S32 Design Studio integration We provide the feature of importing the code generated from a Simulink model inside the S32 Design Studio IDE. This functionality can be useful if the model needs to be integrated into an already existing project or for debug 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)   Multicore support using Concurrent Execution from Simulink     HEV Example using Virtual Vehicle Composer   Support for MATLAB versions We added support for the following MATLAB versions: R2023a R2023b R2024a R2024b R2025a R2025b   More than 40 examples , covering all the peripheral/function supported I/O Control Application Extension (AE) for motor control applications Timers and scheduling Communication (CAN, SPI, UART) Memory handling DSP/ML processor AMMCLib FreeMASTER SIL / PIL Multicore For more details, features, and how to use the new functionalities, please refer to the Release Notes and User Manual documents attached.   MATLAB® Integration:  The NXP Model-Based Design Toolbox extends the MATLAB® and Simulink® experience by allowing customers to evaluate and use NXP’s S32Z/E Real-Time Processors and evaluation board solutions out-of-the-box. NXP Model-Based Design Toolbox for S32ZE version 1.4.0 is fully integrated with MATLAB® environment.       Target Audience: This release (1.4.0) is intended for technology demonstration, evaluation purposes, and prototyping S32Z/E Real-Time Processors and Evaluation Boards.   Useful Resources: Examples, Trainings, and Support: https://community.nxp.com/community/mbdt      
查看全文
  Product Release Announcement Analog & Automotive Embedded Systems NXP Model-Based Design Toolbox for S32K3 – version 1.7.0     The Automotive Embedded Systems, Model-Based Design Tools Team at NXP Semiconductors, is pleased to announce the release of the Model-Based Design Toolbox for S32K3 version 1.7.0. This release supports automatic code generation for S32K3 peripherals and applications prototyping from MATLAB/Simulink for NXP S32K3 Automotive Microprocessors. This new product adds support for S32K310, S32K311, S32K312, S32K314, S32K322, S32K324, S32K328, S32K338, S32K341, S32K342, S32K344, S32K348, S32K358, S32K364, S32K366, S32K374, S32K376, S32K388, S32K394 and S32K396 MCUs, and part of their peripherals, based on RTD MCAL components (ADC, CAN, DIO, FEE, GPT, I2C, ICU, LIN, MEM, MCL, PWM, SPI, UART), and support for the GD3162 Gate Driver based on the S32K396 GD3162 Software. In this release, we have also updated the RTD, S32 Configuration Tools, AMMCLib, FreeMASTER, and MATLAB support for the latest versions. The product comes with over 180 examples, covering all the features and functionalities of the toolbox, including new demos for motor control applications.   Target audience: This product is part of the Automotive SW – Model-Based Design Toolbox.   FlexNet Location: https://nxp.flexnetoperations.com/control/frse/download?element=7608021   Technical Support: NXP Model-Based Design Toolbox for S32K3 issues will be tracked through the NXP Model-Based Design Tools Community space.   Release Content: Automatic C code generation from MATLAB® for NXP S32K3 derivatives: S32K310 S32K311 S32K312 S32K314 S32K322 S32K324 S32K328 S32K338 S32K341 S32K342 S32K344 S32K348 S32K358 S32K364 S32K366 S32K374    S32K376    S32K388    S32K394  S32K396   Support for the following peripheral components and functions: ADC CAN DIO eTPU FEE GD3162 GPT I2C ICU LIN MCL (including DMA support) MEM Memory read/write PWM Profiler Registers read/write SPI UART   New RTD version supported (6.0.0)   Integrates S32K396 GD3162 v2.0.2 The toolbox enables access to the GD3162 gate driver for S32K396 derivatives from Simulink models, by delivering a library block (Gd3162) that generates code on top of GD3162 components API.   New S32 Configuration Tools version supported (2024.R1.8)😎   Integration with EB tresos v29.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   Default Configuration Project Templates targeting all the supported S32K3 derivatives The toolbox delivers default configuration projects, available in both S32 Configuration Tools and EB tresos, covering an initial enablement of the on-board peripherals, pins, and clocks, for all the supported S32K3 derivatives. The desired template, which represents the starting point for enabling the hardware configuration of the application, can be selected via a dropdown widget.   Support for creating and using Custom Project Templates The toolbox provides support to use and create custom project templates. This could be very useful when having a custom board design – offering the possibility to create the configuration for it only once. After it is saved as a custom project template, it can be used for every model that is being developed.   Such custom projects, addressing specific hardware designs are offered inside the current version of the toolbox to integrate the following EVBs: MCTPTX1AK324 S32K344-WB S32K396-BGA-DC1 MR-CANHUBK344, alongside a set of examples specifically created to target this hardware design and a series of articles (available on NXP Community) demonstrating how to use the toolbox features and functionalities for creating applications for custom boards.   The toolbox has been tested and validated on the official NXP Evaluation Boards     S32K31XEVB-Q100     S32K312EVB-Q172     XS32K3X2CVB-Q172     XS32K3X4EVB-Q257     XS32K3XXEVB-Q172     MR-CANHUBK344             S32K3X4EVB-T172      S32K344-WB        XS32K3X8CVB-Q172     S32K388EVB-Q289             XS32K396-BGA-DC     XS32K396-BGA-DC1   Integrates the Automotive Math and Motor Control Library release 1.1.41 All functions in the Automotive Math and Motor Control Functions Library v1.1.41 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.   S32 Design Studio integration We provide the feature of importing the code generated from a Simulink model inside the S32 Design Studio IDE. This functionality can be useful if the model needs to be integrated into an already existing project or for debug 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) including AUTOSAR SW-C deployment External mode   GD3162 Applications To demonstrate the integration and support of the GD3162 gate driver IC, we have included a reference Simulink application that configures six GD3162 devices in   a daisy-chain topology using SPI communication. The setup enables sequential initialization, configuration, and status monitoring of each GD3162 device using the S32K396 as a controller MCU.   Motor Control Applications The toolbox provides examples for 1-shunt and 2-shunt PMSM and BLDC motor control applications, supporting both S32 Configuration Tools and EB  tresos. Each of the examples provides a detailed description of the hardware setup and an associated FreeMASTER project which can be used for control and data visualization. The toolbox also demonstrates the integration of the Motor Control Blockset in developing such applications.   For demonstrating the S32K3 eTPU Software integration, we have included a PMSM application where the FOC algorithm runs on the main CPU of the S32K396 MCU, while the analog sensing, software resolver, and PWM signals generation are offloaded to the eTPU co-processor.   The motor control applications were developed and validated on the MCSPTE1AK344 and MCSPTR2AK396 Motor Control kits.   Support for MATLAB versions We added support for the following MATLAB versions: R2021a R2021b R2022a R2022b R2023a R2023b R2024a R2024b R2025a   Examples for every peripheral/function supported More than 180 examples showcasing: I/O Control Timers and scheduling Communication (CAN, I2C, LIN, SPI, UART) Memory handling Motor Control applications (BLDC and PMSM) AMMCLib FreeMASTER SIL / PIL / External mode For more details, features, and how to use the new functionalities, please refer to the Release Notes and Quick Start Guides documents attached.   MATLAB® Integration: The NXP Model-Based Design Toolbox extends the MATLAB® and Simulink® experience by allowing customers to evaluate and use NXP’s S32K3 MCUs and evaluation board solutions out-of-the-box. NXP Model-Based Design Toolbox for S32K3 version 1.7.0 is fully integrated with MATLAB® environment.   Target Audience: This release (1.7.0) is intended for technology demonstration, evaluation purposes, and prototyping S32K3 MCUs and Evaluation Boards.   Useful Resources: Examples, Trainings, and Support: https://community.nxp.com/community/mbdt      
查看全文
  Product Release Announcement Automotive Embedded Systems NXP Model-Based Design Toolbox for S32K3 – version 1.6.0     The Automotive Embedded Systems, Model-Based Design Tools Team at NXP Semiconductors, is pleased to announce the release of the Model-Based Design Toolbox for S32K3 version 1.6.0. This release supports automatic code generation for S32K3 peripherals and applications prototyping from MATLAB/Simulink for NXP S32K3 Automotive Microprocessors. This new product adds support for S32K310, S32K311, S32K312, S32K314, S32K322, S32K324, S32K328, S32K338, S32K341, S32K342, S32K344, S32K348, S32K358, S32K364, S32K366, S32K374, S32K376, S32K388, S32K394 and S32K396 MCUs, and part of their peripherals, based on RTD MCAL components (ADC, CAN, DIO, FEE, GPT, I2C, ICU, LIN, MEM, MCL, PWM, SPI, UART), and support for the eTPU co-processor based on the S32K3 eTPU Software. In this release, we have also updated the RTD, S32 Configuration Tools, AMMCLib, FreeMASTER, and MATLAB support for the latest versions. The product comes with over 180 examples, covering all the features and functionalities of the toolbox, including new demos for motor control applications.   Target audience: This product is part of the Automotive SW – Model-Based Design Toolbox.   FlexNet Location: https://nxp.flexnetoperations.com/control/frse/download?element=6626551   Technical Support: NXP Model-Based Design Toolbox for S32K3 issues will be tracked through the NXP Model-Based Design Tools Community space.   Release Content: Automatic C code generation from MATLAB® for NXP S32K3 derivatives: S32K310 S32K311 S32K312 S32K314 S32K322 S32K324 S32K328 S32K338 S32K341 S32K342 S32K344 S32K348 S32K358 S32K364 S32K366 S32K374    S32K376    S32K388    S32K394  S32K396   Support for the following peripheral components and functions: ADC CAN eTPU DIO FEE GPT I2C ICU LIN MEM MCL (including DMA support) PWM SPI UART Memory read/write Registers read/write Profiler   New RTD version supported (5.0.0)   Integrates S32K3 eTPU Software v2.0.0 CD01 The toolbox enables access to the eTPU co-processor of the S32K36x/S32K39x derivatives from Simulink models, by delivering a library of blocks that generate code on top of eTPU components APIs: Etpu MotorControl Rdc_Checker   New S32 Configuration Tools version supported (2024.R1.7 Update 😎😎   Integration with EB tresos v29.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   Default Configuration Project Templates targeting all the supported S32K3 derivatives The toolbox delivers default configuration projects, available in both S32 Configuration Tools and EB tresos, covering an initial enablement of the on-board peripherals, pins, and clocks, for all the supported S32K3 derivatives. The desired template, which represents the starting point for enabling the hardware configuration of the application, can be selected via a dropdown widget.   Support for creating and using Custom Project Templates The toolbox provides support to use and create custom project templates. This could be very useful when having a custom board design – offering the possibility to create the configuration for it only once. After it is saved as a custom project template, it can be used for every model that is being developed.   Such custom projects, addressing specific hardware designs are offered inside the current version of the toolbox to integrate the following EVBs: S32K344-WB S32K396-BGA-DC1 MR-CANHUBK344, alongside a set of examples specifically created to target this hardware design and a series of articles (available on NXP Community) demonstrating how to use the toolbox features and functionalities for creating applications for custom boards.   The toolbox has been tested and validated on the official NXP Evaluation Boards     S32K31XEVB-Q100     S32K312EVB-Q172     XS32K3X2CVB-Q172     XS32K3X4EVB-Q257     XS32K3XXEVB-Q172     MR-CANHUBK344             S32K3X4EVB-T172      S32K344-WB        XS32K3X8CVB-Q172     S32K388EVB-Q289             XS32K396-BGA-DC     XS32K396-BGA-DC1   Integrates the Automotive Math and Motor Control Library release 1.1.39 All functions in the Automotive Math and Motor Control Functions Library v1.1.39 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.   S32 Design Studio integration We provide the feature of importing the code generated from a Simulink model inside the S32 Design Studio IDE. This functionality can be useful if the model needs to be integrated into an already existing project or for debug 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) including AUTOSAR SW-C deployment External mode   Motor Control Applications The toolbox provides examples for 1-shunt and 2-shunt PMSM and BLDC motor control applications, supporting both S32 Configuration Tools and EB  tresos. Each of the examples provides a detailed description of the hardware setup and an associated FreeMASTER project which can be used for control and data visualization. The toolbox also demonstrates the integration of the Motor Control Blockset in developing such applications.   For demonstrating the S32K3 eTPU Software integration, we have included in this release a PMSM application where the FOC algorithm runs on the main CPU of the S32K396 MCU, while the analog sensing, software resolver, and PWM signals generation are offloaded to the eTPU co-processor.   The motor control applications were developed and validated on the MCSPTE1AK344 and MCSPTR2AK396 Motor Control kits.   Support for MATLAB versions We added support for the following MATLAB versions: R2021a R2021b R2022a R2022b R2023a R2023b R2024a R2024b   Examples for every peripheral/function supported More than 180 examples showcasing: I/O Control Timers and scheduling Communication (CAN, I2C, LIN, SPI, UART) Memory handling Motor Control applications (BLDC and PMSM) AMMCLib FreeMASTER SIL / PIL / External mode For more details, features, and how to use the new functionalities, please refer to the Release Notes and Quick Start Guides documents attached.   MATLAB® Integration: The NXP Model-Based Design Toolbox extends the MATLAB® and Simulink® experience by allowing customers to evaluate and use NXP’s S32K3 MCUs and evaluation board solutions out-of-the-box. NXP Model-Based Design Toolbox for S32K3 version 1.6.0  is fully integrated with MATLAB® environment.   Target Audience: This release (1.6.0) is intended for technology demonstration, evaluation purposes, and prototyping S32K3 MCUs and Evaluation Boards.   Useful Resources: Examples, Trainings, and Support: https://community.nxp.com/community/mbdt      
查看全文
    Product Release Announcement Automotive Embedded Systems NXP Model-Based Design Toolbox for S32Z/E – version 1.3.0   The Automotive Processing, Model-Based Design Tools Team at NXP Semiconductors, is pleased to announce the release of the Model-Based Design Toolbox for S32Z/E version 1.3.0. This release supports automatic code generation for ARM Cortex-R52 and DSP/ML processor cores from MATLAB and Simulink for NXP S32Z/E Automotive Real-Time Processors. This new release supports S32Z/E2 families and its cores (Real-Time ARM Cortex-R52 cores and DSP/ML processor). It also supports Multicore, 41 Operators highly optimized for DSP/ML processor, Processor-in-Loop Simulation mode, RTD components (ADC, PWM, DIO, CAN, UART, GPT), FreeMASTER, AMMCLib, and execution profiling. The product comes with 120 examples, covering all DSP/ML processor Operators and demonstrating the usage of the peripherals (e.g.: I/O control, timers and scheduling, communication) and multicore concurrent execution.   Target audience: This product is part of the Automotive SW – Model-Based Design Toolbox.   FlexNet Location: https://nxp.flexnetoperations.com/control/frse/download?element=6450481   Technical Support: NXP Model-Based Design Toolbox for RADAR 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 S32Z2/E2 packages, including rev. B0 S32E2xx-bga975 S32Z2xx-bga594 S32Z2xx-bga400 Automatic C code generation from MATLAB® for NXP S32Z2/E2 cores ARM Cortex-R52 Cluster 0 and Cluster 1 cores DSP/ML processor Multicore support using Concurrent Execution from Simulink Homogeneous multicore execution between ARM Cortex-R52 Cluster 0 and Cluster 1 cores using IPCF Heterogenous multicore execution between ARM Cortex-R52 Cluster 0 Core 0 and SPF2 core using OpenAMP MCAL components supported (based on RTD version 2.0.0) ADC PWM DIO CAN UART GPT Software-in-the-Loop and Processor-in-the-Loop (SIL/PIL) simulation modes MATLAB scripts   Simulink models Includes MATLAB API and Simulink Library blocks for the 41 Operators highly optimized for DSP/ML processor Includes AMMCLib (v1.1.38) blocks and examples FreeMASTER support and examples Support for MATLAB versions: R2022a R2022b R2023a R2023b R2024a 120 examples: 41 Operators for DSP/ML processor Multicore I/O control Timers and scheduling Communication (CAN) SiL, PiL FreeMASTER   For more details, features, and how to use the new functionalities, please refer to the Release Notes and Quick Start Guides documents attached.   MATLAB® Integration: The NXP Model-Based Design Toolbox extends the MATLAB® experience by allowing customers to evaluate and use ARM Cortex-R52 cores and DSP/ML processor from NXP’s S32Z/E Realt-Time Processors and evaluation board solutions out-of-the-box. NXP Model-Based Design Toolbox for S32Z/E version 1.3.0 is fully integrated within MATLAB® environment.   Target Audience: This release (1.3.0) is intended for technology demonstration, evaluation purposes, and prototyping on NXP S32Z/E Real-Time Processors and Evaluation Boards.   Useful Resources: Examples, Trainings, and Support: https://community.nxp.com/community/mbdt      
查看全文