MCX Microcontrollers Knowledge Base

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

MCX Microcontrollers Knowledge Base

Discussions

Sort by:
FRDM Boards Enclosures (3D Print)   Hi NXP FRDM enthusiasts! we want to share some 3D files that you can use to 3D print your own enclosures for the FRDM-MCX family!    FRDM-MCXN947 case step files are here   FRDM-MCXA153 case step files are here   FRDM-MCXW71 case step files are here
View full article
Using external PSRAM on the MCX N FlexSPI port can enable a large degree of application flexibility. In this paper we show how to add 8MB of Octal DDR PSRAM to the MCXN947 and execute baseline performance tests.
View full article
Developing code for MCXN family from Scratch The MCX family is a newly released MCU family, of course, the SDK package includes almost all the examples of the MCXN modules based on the SDK driver, for example led_blinky which shows the method of toggling GPIO, CTimer interrupt, etc. While the program in this article doesn’t use SDK driver. It focuses on understanding the related module from register level which is friendly to beginners to understand MCX working mechanism. The doc introduces how to toggle a GPIO, how to have CTimer generate interrupt, and in the CTimer ISR, toggle a LED, while it also describes how to initialize the NVIC so that CTimer can generate ISR by writing the module registers without calling the SDK driver. Environment: FRDM-MCXN947 board MCUXPresso IDE v11.9.0 IDE on Win10 OS   1. Toggle a LED On the FRDM-MCXN947 board, the PIO0_10(P0_10) of MCXN947 is connected to a LED. With MCUXPresso IDE with v11.9.0, you can add the code to test the LED toggling and CTimer interrupt function.   1.1 Configure the PIO0_10 pin as GPIO0_10 pin SYSCON->AHBCLKCTRLSET[0]=1<<13; PORT0->PCR[10]=0x1000; Before you initialize the PORT0 register to assign the PIO0_10 function, you have to enable the PORT0 gated clock in the SYSCON->AHBCLKCTRL0 reg. Write the PORT0->PCR[10]=0x1000; to configure the PIO0_10 as GPIO0_10 function. 1.2 Configure the GPIO0_10 pin as GPIO output mode and toggle the GPIO pin. SYSCON->AHBCLKCTRLSET[0]=1<<19; GPIO0->PDDR|=1<<10; GPIO0->PTOR=1<<10; Before you initialize the GPIO0 registers, you have to enable the GPIO0 gated clock in the SYSCON->AHBCLKCTRL0 reg. Set the bit 10 of GPIO0->PDDR so that the GPIO0_10 is in GPIO output mode. Toggle GPIO0_10 pin by writing the bit 10 in GPIO0->PTOR reg   Set a break point in the debugger on the GPIO0->PTOR=1<<10; line,and run step by step, you can see that led toggles.   2. Initialize CTimer 2.1 enable Ctimer gated clock and clock source and divider. Before you initialize the CTimer register, you have to enable the CTimer gated clock. For example, enable CTimer4 gated clock with the line: SYSCON->AHBCLKCTRLSET[2]=1<<22; You have to also select the CTimer clock source and Ctimer clock divider. For example, set the CTimer4 clock source and divider. SYSCON->CTIMERCLKSEL[4]=0x04; SYSCON->CTIMERCLKDIV[4]=0x02; //P0_10 is LED red void GPIOInit(void) { SYSCON->AHBCLKCTRLSET[0]=1<<13; PORT0->PCR[10]=0x1000; //enable gated clock of GPIO SYSCON->AHBCLKCTRLSET[0]=1<<19; GPIO0->PDDR|=1<<10; GPIO0->PTOR=1<<10; //set break point here GPIO0->PTOR=1<<10; GPIO0->PTOR=1<<10; GPIO0->PTOR=1<<10; GPIO0->PTOR=1<<10; } 2.2 Initialize the CTimer register. CTIMER4->CTCR=0x00; CTIMER4->PR=0x00; //set the CTimet4 mode and enable interrupt for match0 CTIMER4->MCR=0x03; CTIMER4->PWMC=0x00; //set the CTimer4 cycle time CTIMER4->MR[0]=2000000; CTIMER4->MSR[0]=2000000; //Start up CTimer4 CTIMER4->TCR=0x01; 2.3 Initialize the NVIC The IRQ number of CTimer4 is 56, so you have to set the bit 24 of both NVIC->ISER[1]|=1<<24; NVIC->ICPR[1]|=1<<24; and set the priority of NVIC->IPR[56] with 0x00; NVIC->IPR[56]=0x00;   //CTimer4 IRQ 56, 56-32=24 void cTimer0Init(void) { //CLOCK_SetClkDiv(kCLOCK_DivCtimer4Clk, 1u); //CLOCK_AttachClk(kFRO_HF_to_CTIMER4); //enable Ctimer4 gated clock SYSCON->AHBCLKCTRLSET[2]=1<<22; SYSCON->PRESETCTRLSET[2]=1<<22; SYSCON->PRESETCTRLCLR[2]=1<<22; SYSCON->CTIMERGLOBALSTARTEN|=1<<4; //select CTimer4 clock source SYSCON->CTIMERCLKSEL[4]=0x04; SYSCON->CTIMERCLKDIV[4]=0x02; //init the CTimer0 CTIMER4->CTCR=0x00; CTIMER4->PR=0x00; CTIMER4->MCR=0x03; CTIMER4->PWMC=0x00; CTIMER4->MR[0]=2000000; CTIMER4->MSR[0]=2000000; //CTIMER0->IR=0x01; CTIMER4->TCR=0x01; NVIC->ISER[1]|=1<<24; NVIC->ICPR[1]|=1<<24; NVIC->IPR[56]=0x00; } 2.3 Each interrupt source has unique interrupt service routine in the file startup_mcxn947_cm33_core0.c For the CTimer4 ISR, it is called: CTIMER4_IRQHandler So it is okay to fill the function: void CTIMER4_IRQHandler(void) { //clear flag CTIMER4->IR|=0x01; //toggle LED GPIO0->PTOR=1<<10; } In conclusion, the doc gives a snippet which can toggle a LED by writing the register directly. It also give the code to configure CTimer4 so that it can generate interrupt, in the ISR, toggle a LED. Appendix This is the entire source code:   /* * Copyright 2019 NXP * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #include "pin_mux.h" #include "peripherals.h" #include "board.h" /******************************************************************************* * Definitions ******************************************************************************/ void clockOUTInit(void); void GPIOInit(void); void cTimer0Init(void); void MRTInit(void); /******************************************************************************* * Prototypes ******************************************************************************/ /******************************************************************************* * Variables ******************************************************************************/ /******************************************************************************* * Code ******************************************************************************/ /*! * @brief Main function */ int main(void) { /* Board pin init */ CLOCK_EnableClock(kCLOCK_Gpio0); BOARD_InitPins(); BOARD_BootClockFRO12M(); //FlexPWMPinInit(); GPIOInit(); cTimer0Init(); //MRTInit(); __asm("nop"); while (1) { } } //P0_10 is LED red void GPIOInit(void) { SYSCON->AHBCLKCTRLSET[0]=1<<13; PORT0->PCR[10]=0x1000; //enable gated clock of GPIO SYSCON->AHBCLKCTRLSET[0]=1<<19; GPIO0->PDDR|=1<<10; //set a break point here and run step by step GPIO0->PTOR=1<<10; GPIO0->PTOR=1<<10; GPIO0->PTOR=1<<10; GPIO0->PTOR=1<<10; GPIO0->PTOR=1<<10; GPIO0->PTOR=1<<10; GPIO0->PTOR=1<<10; GPIO0->PTOR=1<<10; GPIO0->PTOR=1<<10; } //CTimer4 IRQ 56, 56-32=24 void cTimer0Init(void) { // CLOCK_SetClkDiv(kCLOCK_DivCtimer4Clk, 1u); // CLOCK_AttachClk(kFRO_HF_to_CTIMER4); //enable Ctimer4 gated clock SYSCON->AHBCLKCTRLSET[2]=1<<22; SYSCON->PRESETCTRLSET[2]=1<<22; SYSCON->PRESETCTRLCLR[2]=1<<22; SYSCON->CTIMERGLOBALSTARTEN|=1<<4; //select CTimer4 clock source SYSCON->CTIMERCLKSEL[4]=0x04; SYSCON->CTIMERCLKDIV[4]=0x02; //init the CTimer0 CTIMER4->CTCR=0x00; CTIMER4->PR=0x00; CTIMER4->MCR=0x03; CTIMER4->PWMC=0x00; CTIMER4->MR[0]=2000000; CTIMER4->MSR[0]=2000000; //CTIMER0->IR=0x01; CTIMER4->TCR=0x01; NVIC->ISER[1]|=1<<24; NVIC->ICPR[1]|=1<<24; NVIC->IPR[56]=0x00; } void CTIMER4_IRQHandler(void) { //clear flag CTIMER4->IR|=0x01; //toggle LED GPIO0->PTOR=1<<10; } //MRT0 interrupt IRQ is 30 void MRTInit(void) { SYSCON->AHBCLKCTRLSET[1]=1<<0; SYSCON->PRESETCTRLSET[1]=1<<0; SYSCON->PRESETCTRLCLR[1]=1<<0; MRT0->CHANNEL[0].INTVAL=6000000; MRT0->CHANNEL[0].INTVAL|=1<<31; MRT0->CHANNEL[0].CTRL=0x01; NVIC->ISER[0]|=1<<30; NVIC->ICPR[0]|=1<<30; NVIC->IPR[30]=0x00; } void MRT0_IRQHandler(void) { if(MRT0->CHANNEL[0].STAT&0x01) { MRT0->CHANNEL[0].STAT|=0x01; } //toggle LED GPIO0->PTOR=1<<10; }
View full article
  This guide helps you to: Get familiar with NPU inside the MCX Know eIQ ML examples included in SDK. Summarize related application notes and demo projects on GitHub Prerequisites: Windows 10 development PC. FRDM-MCXN947 board NXP’s  MCUXpresso IDE is installed on the development PC Generate and download FRDM-MCXN947 SDK package from the web-based MCUXpresso SDK builder. Introduction to NPU The MCXN94x and MCXN54x are based on dual high-performance Arm® Cortex®-M33 cores running at up to 150 MHz, it has 2MB of on-chip Flash with optional full ECC RAM and an integrated proprietary NPU. The integrated NPU delivers up to 40x faster machine learning (ML) throughput compared to a CPU core, enabling it to spend less time awake and reducing overall power consumption. The architecture provides power and performance-optimized NPUs integrated with NXP's very wide portfolio of microcontrollers and applications processors. The eIQ Neutron NPUs offer support for a wide variety of neural network types such as CNN, RNN, TCN, and Transformer networks and more. ML application development with the eIQ Neutron NPU is fully supported by the eIQ machine learning software development environment. The NPU used in MCXN94 is Neutron N1-16, its block diagram is shown in the below figure. The eIQ Neutron N1-16 NPU found inside the MCXN94 has 4 compute pipes and each compute pipe contains 4 INT8 MAC (Multiply Accumulate) blocks for a total of 16 MAC blocks. This means that MCXN94 could execute 4.8G(150MHz * 4 * 4 * 2) INT8 operations per second. The MCUXpresso Software Development Kit (MCUXpresso SDK) provides a comprehensive software package with a pre-integrated TensorFlow Lite for Microcontrollers (TFLM). The Neutron library is integrated into TFLM as well. The following table shows the operators which are supported by the NPU. Operator Operator input type MCXN947/MCXN548 NPU ADD Float No Uint8(PTQ) No Int8(PCQ) Yes AVERAGE_POOL_2D Float No Uint8(PTQ) No Int8(PCQ) Yes CONV_2D Float No Uint8(PTQ) No Int8(PCQ) Yes DEPTHWISE_CONV_2D Float No Uint8(PTQ) No Int8(PCQ) Yes FULLY_CONNECTED Float No Uint8(PTQ) No Int8(PCQ) Yes UNIDIRECTIONAL_SEQUENCE_ LSTM Float No Uint8(PTQ) No Int8(PCQ) No LOGISTIC (Sigmoid) Float No Uint8(PTQ) No Int8(PCQ) Yes MAX_POOL_2D Float No Uint8(PTQ) No Int8(PCQ) Yes MUL Float No Uint8(PTQ) No Int8(PCQ) No SOFTMAX Float No Uint8(PTQ) No Int8(PCQ) No SVDF Float No Uint8(PTQ) No Int8(PCQ) No Note: PTQ — Per-tensor quantized (asymmetric 8-bit quantization). PCQ — Per-channel quantized (symmetric 8-bit quantization). For more information please refer to eIQ TensorFlow Lite User's Guide.pdf in middleware/eiq/doc of SDK. eIQ ML examples included in SDK. Download SDK and select FRDM-MCXN947 in MCUxpresso SDK Builder, Remember to select eIQ middleware. Then open MCUXpresso, it’s convenient to install the SDK by dragging and dropping the file into the SDK installation window of the MCUXpresso IDE. Import SDK examples into the workspace: There are 7 ML examples included in SDK: Here are the descriptions of the eIQ examples: eIQ example Description Hardware requirements tflm_cifar10 CIFAR10 example based on TensorFlow Lite Micro, recognizes a static image FRDM-MCXN947 USB type-c cable tflm_kws Keyword spotting example based on TensorFlow Lite Micro recognizes a static WAV audio FRDM-MCXN947 USB type-c cable tflm_label_image Label 1000 classes of images based on TensorFlow Lite Micro FRDM-MCXN947 USB type-c cable mpp_camera_mobilenet_view_tflm Label camera images based on TensorFlow Lite Micro FRDM-MCXN947 LCD: MikroElektronika TFT Proto 5" OV7670 module USB type-c cable mpp_camera_ultraface_view_tflm Face detection using the camera as the source, based on TensorFlow Lite Micro FRDM-MCXN947 LCD: MikroElektronika TFT Proto 5" OV7670 module USB type-c cable mpp_camera_view A simple camera preview pipeline. FRDM-MCXN947 LCD: MikroElektronika TFT Proto 5" OV7670 module USB type-c cable tflm_modelrunner TFLite Model Benchmark example for Microcontrollers. FRDM-MCXN947 RJ45 Network cable For additional information and guidance, kindly refer to the README file located in the doc folder that accompanies each example. Summary of related application notes There are two application notes available that provide information on advanced usage of NPU. How to Integrate Customer ML Model to NPU on MCXN94x Face Detection demo with NPU accelerated on MCXN947. Please find the notes on the NXP website Summary of demo projects on GitHub There are five demos on nxp-appcodehub from GitHub: Multiple Face detection on FRDM-MCXN947 Multiple person detection on FRDM-MCXN947 Label CIFAR10 images on FRDM-MCXN947 Fashion-MNIST recognition on FRDM-MCXN947 NPU vs TensorFLM benchmark on MCX  
View full article
Supply resilience is now a critical factor in MCU selection. Discover how NXP’s MCX portfolio combines predictable lead times, diversified manufacturing, long-term product longevity, and strategic investments like VSMC’s new Singapore facility to help developers build with confidence and reduce supply chain risk.
View full article
This document introduces how to configure and use the hardware trigger feature of the Analog-to-Digital Converter (ADC) on the FRDM-MCXA156 development board. It presents an event where using an external button initiates a reading and ADC conversion that reads an analog input from a potentiometer; the resulting digital value is then used to dynamically update the duty cycle of a PWM signal connected to an external output represented by a LED. This example demonstrates the usage of external connections and analog measurement by walking through the modifications required to enable hardware triggering via the Input Multiplexing (INPUTMUX) module.
View full article
MCX N series of highly integrated Arm Cortex-M33 microcontrollers are designed for high performance and low power consumption. MCX N includes intelligent peripherals and on-chip accelerators providing multitasking capabilities and performance efficiency. Select MCX N families include NXP's eIQ® Neutron neural processing unit (NPU) for machine learning applications. The low-power cache enhances system performance, while the dual-bank flash and full ECC RAM support system safety and offer an extra layer of protection and advanced security. These secure MCUs include our EdgeLock® Secure Enclave, Core Profile offering a secure-by-design approach, secure boot with an immutable root-of-trust and hardware-accelerated cryptography. Documents: MCX N Series  MCX N Fact Sheet MCX N Series Hardware Design Guide MCX Nx4x TSI QSG UG10101 MCX Nx4x Power Management User Guide Migration Guide Froom LPC55xx to MCX Nx4x MCX N Series Products: MCX N94/N54/N53/N52/N24:  The MCX N94, N54, N53, N52 and N24 include up to two are based on dual high-performance Arm® Cortex®-M33 cores running up to 150 MHz, with 2 MB of Flash with optional full ECC RAM, a DSP co-processor and an integrated eIQ Neutron NPU. The NPU delivers up to 42x faster machine learning throughput compared to a CPU core alone enabling it to spend less time awake and reducing overall power consumption. The multicore design delivers improved system performance and reduces consumption by enabling smart, efficient distribution of workloads to the analog and digital peripherals.  Documents: Data Sheet MCX N947/946/547/546/536/527/526/247 MCXN_1P02G Errata MCXNx4x_0P02G Errata Reference Manual  Secure Reference Manual  AFCI 8HC Demo QSG Omdia Market Radar: AI Processors for the Edge 2024 MCX N94x MCUs: Bringing more intelligence to the Edge  MCX N23: The MCX N23x is based on a high-performance Arm® Cortex®-M33 running up to 150 MHz, with 1 MB of Flash, 352 kB ECC RAM and SmartDMA. The MCX N23x is optimized for cost, memory and system performance and offers a single core option with efficient distribution of workloads to the analog and digital peripherals. The EdgeLock Secure Enclave on the MCX N23x is a self-contained, on-die hardware security subsystem that has its own dedicated security core, internal ROM, secure RAM and it supports state-of-the-art side-channel attack-resilient symmetric and asymmetric crypto accelerators and hashing functions for security services. Documents: MCX N23x Data Sheet MCXN23x_0P21K Errata Reference Manual Security Reference Manual MCX N23 HLQFP100 Hardware Design Guide Boards: FRDM-MCXN947: FRDM-MCXN947 are compact and scalable development boards for rapid prototyping of MCX N94 and N54 MCUs. They offer industry standard headers for easy access to the MCU’s I/Os, integrated open-standard serial interfaces, external flash memory and an on-board MCU-Link debugger. Documents: FRDM-MCXN947 QSG MCUXpresso SDK Field-Oriented Control of 3-Phase PMSM and BLDC Motors -FRDM-MCXN947 FRDM-MCXN947 Getting Started FRDM-MCXN947 Board User Manual  FRDM-MCXN236FRDM-MCXN236 is a compact and scalable development board for rapid prototyping of MCX N23x MCU. It offers industry-standard headers for easy access to the MCU's I/Os, integrated open-standard serial interfaces, external flash memory and an onboard MCU-Link debugger Documents: FRDM-MCXN236 Development Board QSG Getting Started with FRDM-MCXN236 FRDM-MCXN236 Board User Manual  MCX-N9XX-EVK is a full featured evaluation kit for prototyping of MCX N94 / N54 MCUs. They offer industry standard headers for access to the MCU’s I/Os, integrated open-standard serial interfaces and an on-board MCU-Link debugger with power measurement capability. Documents: Getting Started with MCX-N9XX-EVK MCX-N9XX-EVK Board User Manual MCX N to FRDM Board Mapping: Supported MCU(s) Recommended Board Best fit for  Key Differentiators MCX N94 / N54 / N53 / N52 / N24 FRDM-MCXN947 Rapid prototyping across the MCX N portfolio Arduino-compatible headers, MCU-Link debugger, Ethernet PHY, CAN-FD, camera and LCD expansion support. MCX N94x / N54x MCX-N9XX-EVK Full-featured evaluation, performance benchmarking, advanced prototyping Energy monitoring, external memory support, Ethernet, CAN, PMIC, M.2 expansion, MCU-Link debugger. MCXN236 FRDM-MCXN236 Ultra-low-power IoT devices, battery-powered sensors, edge nodes Arm Cortex-M33 MCU, low-power architecture, integrated analog peripherals, optimized for connected sensing applications.   Applications Notes: Software, hardware and Peripherals AN15071 Implementation of Optical module CMIS protocol over I3C on the MCX N94: This application note introduces how to implement the CMIS protocol demo on an MCX N947 microcontroller using the I3C interface. AN15072 Implementation of an I3C Secondary Bootloader on MCX N947: The I3C interface is widely used in many scenarios, such as data center, PCs, and optical modules. As a result, I3C-based secondary bootloader for firmware updates have become a common requirement. AN14407 DICE Attestation for MCX N Series Devices: This application note explains and provides a demo on how to implement DICE on MCX N series devices. In this implementation, DICE uses the UDS of the device, its hardware state, firmware, and RTF to create a unique identity that gets registered on an offline database system. This offline database system is later used to verify the genuineness of the device. AN14320 Ease ISA/IEC 62443-4-2 Compliance with MCX N Series: This document is addressed to OEMs interested in understanding how the MCX N can be used to facilitate the implementation of ISA/IEC 62443-4-2 requirements. AN14166 MCX N Over-The-Air (OTA) Update by Using SB3 file: This document describes a method to secure OTA via SB3 files. For demonstration purposes, this documentation uses the EVK and onboard Ethernet. AN15087 Implementing Three I2C Target Interfaces Using SmartDMA on the MNC N947: This demo implements three virtual I2C target ports on MCX N947 using SmartDMA-assisted GPIO-style signaling, without dedicating three hardware LPI2C target peripherals AN14900 Using eDMA and Ping-Pong Buffer ti deserialize Multi-Channel ADC Result FIFO:  This application note describes how to use eDMA to tackle the Analog-to-Digital Converter (ADC) result First-In First-Out (FIFO) and deserialize each channel data in FIFO to respective buffer for each channel. It is useful for high-speed and multi-channel ADC result process by reducing CPU loading and improving data processing speed. AN14807 Accelerate FFT Computation with PowerQuad: In high-performance signal processing applications, the Fast Fourier Transform (FFT) plays a critical role. To enhance efficiency, the LPC55 Series and MCX N Series microcontrollers integrate a hardware accelerator called PowerQuad. This application note presents an approach to accelerate FFT computation using PowerQuad while addressing its limitation of a maximum FFT length of 512 points AN14175 Using FlexIO to emulate Quad SPI controller: Quad SPI serves as a common interface for flash memory, Wi-Fi modules, and LCD displays. However, some microcontrollers do not support the Quad SPI interface. In such cases, FlexIO offers a versatile alternative. AN14712 Advanced PowerQuad Operation Guide: This application note provides some information, code snippets, and tips to help users accelerate their calculations with MAU. The MCX N Series microcontrollers feature a powerful and efficient coprocessor called PowerQuad. It operates in parallel with the CPUs to offload intensive mathematical computations and enhance overall performance. AN14650 SmartDMA Cookbook: This application note primarily introduces the internal architecture, main functions, and features of EZH or SmartDMA, and finally lists the usage and meanings of the main instructions AN14520 General MCU PWM DAC Application: This application note introduces how to set the low-cost Digital-to-Analog Converter (DAC) using the PWM output. The main application is household electrical and industry appliances, which need a low cost and accurate DAC without a high-bandwidth requirement.  AN14567 How to implement USB microphone on MCX Series MCUs: This documentation describes how to implement a USB microphone on MCX Series MCUs. The data source could be an external digital microphone or generated data. A USB Audio Class 1.0 (UAC 1.0) and USB Audio Class 2.0 (UAC 2.0) microphone is used in this document. AN14553 Building a GPS Speedometer using GUI Guider and FREM-MCXN947: This application note provides examples to build a GPS-based speedometer with FRDM-MCXN947, LVGL, GUI Guider tool, and a GPS module. The document describes how to deploy LVGL on the MCX Nx4x platform with GUI Guider and SDK. AN14470 How to Use FlexIO State Mode to Generate Center-Aligned PWM: This application note describes how to use the FlexIO state mode to generate a center-aligned PWM waveform on the MCXN series MCUs. AN14259 SDK Example to Write CMPA and CFPA with monotonic Counter dor MCXN947: This document provides an example of changing the Customer Field Programmable Area (CFPA) bit field using the ROM APIs.  AN14532 Migration from Kinetis K Series to MCXNx4x Series: This application note is about migrating Kinetis K series to MCXN94x/N54x series and lists the differences between both the series. AN14543 Connect Barcide Scanner with MCX N Series USB Host port: This application note describes how to build a USB host port connected with a USB barcode scanner using the FRDM-MCXN947 board for demonstration. NXP’s MCX N series devices feature a high-speed (HS) USB port capable of reaching transmission speeds up to 480 Mbit/s and compatible with Full-speed mode. AN14509 How to Use SmartMDA to Implement MDIO Slave Interface on MCX MCU:  This application note describes the use of SmartDMA to implement the MDIO slave interface on MCX series MCUs. AN14479 OTA Recovery Boot Image Stored in 1-bit SPI Flash: This application note describes the step-by-step process to load a recovery image to the external 1-bit SPI flash memory using a secure firmware update. In addition, the steps demonstrate how to trigger a recovery boot from the application using the ROM APIs. AN14300 MCX Nx4x Unleashing the Power of eDMA Controller: his application note provides a working knowledge by covering the following topics: introduction and overview of eDMA controllers, features of the MCX Nx4x eDMA module, interaction between the eDMA and DMA multiplexer (DMAMUX), and configuration advice for applications. AN14423 On-Device Training for Fan Anomaly Detection Using FRDM-MCXN947: This document describes how to prepare the software environment and set up the hardware for fan anomaly detection using FRDM-MCXN947. This demo uses an accelerator sensor on the fan to monitor in real-time whether the fan is operating normally. AN14145 Flash Memory Swap feature on MCX N Series: This application note describes how to use the flash remap feature of MCX series. AN14305 Permanent Magnet Synchronous Motor Field Oriented Control Using MCX Microcontrollers: This application note describes the implementation of Field Oriented Control (FOC) application for a 3-phase Permanent Magnet Synchronous Motor (PMSM) on NXP MCX MCUs, including the N and A series. AN14184 Using SmartDMA for Keyscan on MCX N Series MCU: This application note mainly introduces the Keyscan solution for MCX N series MCU. It includes the introduction of the Keyscan solution, its features and API routines, and a demo. AN14191 How to use SmartDMA to implement Camera Interface in MCXN MCU: This application note describes the parallel interface for the camera solution in MCXN947 and MCXN236. It includes the introduction of camera interface, features, API routines, and demo.  AN14172 Using SmartDMA for Graphic on MCX N Series MCU: This application note introduces the application of SmartDMA on the graphic. AN14196 Flex Pulse Width Modulator (FlexPWM) usage on MCXN MCU: This document introduces several operation modes, including the corresponding implementation, to provide reference for different applications.  AN14253 USB to CAN-FD Adapter based on MCXN Microcontroller: This application note provides two demo examples to build a USB to CAN-FD adapter where the USB retransmits data to the CAN-bus and vice versa. It uses MCX_N9XX_EVK and MCX_N9XX_FDRM boards for the demo.  AN14284 Timing Parameter tuning for FlexIO Emulated Interface: This application note describes how to use additional timers to tune the setup time in SPI master. AN14254 Use QDC/ENC/Quad Timer Peripherals to Calculare the Angle and Speed of the Quadrature Encoder: This application note provides an angle measurement method and an enhanced M/T speed measurement method that can take into account both high and low speeds. AN14167 Internal Reference Clock (IRC) Trim Feature on MCX N Series: This application describe how to use auto-trim feature on MCX N series. AN14241 How to integrate Customer ML Model to NPU on MCX N94x: This document describes how to integrate the customer ML model to NPU on the FRDMMCXN947 board. AN14195 USB Remote Wake-up on MCXN947: MCXN947 contains two USB 2.0 interfaces. USB0 is a full-speed interface. It comprises an On The-Go (OTG) dual-role subsystem with OTG protocol support. AN14185 DCDC Usage on MCXNx4x/Nx3x: This application note is designed to provide a better understanding of the on-chip DCDC module. It offers a comprehensive guide on how to control both basic and advanced parameters, as well as how to configure the DCDC module to work efficiently with other peripherals. AN14178 MCXNx4x Flash Command Example: This document explains how to use the flash command controller to perform flash read and write operations, which can be more efficient than using calls to the ROM API. AN14177 Headset with Touch Function on MCX Nx4x: This application note describes how to use the MCX-N5XX-EVK to implement USB audio with touch control. AN14151 MCX Nx4x MICFIL interface: This application note is based on examples how to leverage the MICFIL coupled with eDMA, interrupts to send the audio stream to the SRAM for postprocessing. AN14146 CANopen Bootloader in MCX N Series: This application note discusses how to implement CANopen bootloader AN14132 Face Detection demo with elQ Neutron NPU Accelerated on MCX N947: This application note shows how to implement the face detection example on the FRDM-MCXN947 board. AN14150 MCX Nx4x Inter-Core Communication Application Note: This application note introduces how dual core devices can communicate using the Mailbox interface. Power Management AN15066 Direct Current arc Fault Circuit Interrupters Solution with Time Series Studio: This application note presents a DC AFCI reference solution based on the MCX N547 MCU. It describes the system architecture, hardware design considerations, and software and algorithm concepts to assist system designers in implementing reliable and standards-compliant arc fault detection solutions AN14180 Estimating Device Lifetime for MCX Nx4x: This document describes the estimated product Power-on Hours (PoH) for the MCX N94x and MCX N54x devices, based on the criteria used in the qualification process. AN14190 OPAMP usage on MCXM947: This application note describes the functions of OPAMP module and how to use OPAMP features on MCXN947. AN14139 Design Considerations for Optimizing Performance with MCX N Series: This application note explains the features of MCX N-series devices that can affect system performance Security AN14148 Secure Boot on MCX N Series: This application note describes the steps for secure boot using the Secure Provisioning Tool (SEC) AN14162 MCX N Debug Authentication: This application note describes the secure debug feature on the MCX N series devices. The document walks through the steps used to configure a device to enable secure debug using the Secure Provisioning Tool. The document also shows the debug authentication steps to unlock the debug port. AN14096 Encryption and Decryption Enablement Using NPX Module on SEC tool:   AN14361 Generating Digital Signature Using ELS ECSIGN command with RTF Enabled: This application note focuses mostly on the ECSIGN command and creates a demo to use it with Run Time Fingerprint (RTF) enabled. The MCX N series SDK contains various ELS command example projects including the ECSIGN usage but not with RTF enabled.  AN14154 Secure Provisioning Guidelines for MCX N Series MCUs: This application note assumes that you are already familiar with the security features available on the MCX N series devices. AN14086 Encryption and Decryption Enablement Using IPED Module on SPSDK Tool: IPED is the abbreviation of Inline Prince Encryption Decryption. The MCX N series devices offer support for real-time encryption and decryption for external flash using the IPED algorithm. Compared to AES, IPED is fast because it can decrypt and encrypt without adding extra latency. IPED operates as data is read or written, without the need to first store data in RAM and then encrypt or decrypt to another space. It operates on a block size of 64 bits with a 128-bit key. This functionality is useful for asset protection, such as securing application code that resides in external NOR flash memory. AN14095 Encryption and Decryption Enablement using IPED Module on SEC Tool: The MCX N series supports seven regions for encryption and decryption. Each crypto region resides at a memory address boundary of the external flash from 0x0800_0000 to 0x0FFF_FFFF. There must be no overlap among these seven ranges. Otherwise, the behavior of IP is undefined. AN14087 Encryption and Decryption Enablement Using NPX Module on SPSDK tool: A trend in embedded processor design is an increasing need for hardware to support cryptographic calculations that are required for system security. There are emerging customer requirements to protect application code and data stored in flash memories in an encrypted form. AN15038 EdgeLock 2GO Provisioning MCUs via Product Type using Secure Provisioning (SEC) tool:  This document offers an outline of the EdgeLock 2GO platform and discusses the "Device provisioning via product type" flow. In this case, the MCUXpresso Secure Provisioning Tool (SEC) is the proxy being used to provision an MCU. AN14670 EdgeLock 2GO Provisioning via SPSDK for MCUs: This document offers an outline of the EdgeLock 2GO platform and discusses the “Device provisioning via proxy” flow. In this case, the SPSDK command line tool is the proxy being used to provision an MCU. AN14687 Ease CRA Compliance with MCX N: This document addresses OEMs who want to understand how the MCX N series can facilitate the implementation of CRA requirements. While the MCX N series provides core security capabilities that can be mapped to the cybersecurity requirements of the CRA, the OEM must fill the remaining compliance gap by performing additional actions.  AN14624 EdgeLock 2Go Provisioning via Secure Provisioning (SEC) tool: This document offers an outline of the EdgeLock 2GO platform and discusses the "Device provisioning via proxy" flow. In this case, the MCUXpresso Secure Provisioning Tool (SEC) is the proxy being used to provision an MCU. AN14460 How to program MCX N series internal flash through ISP: This application note describes how to use USB/UART/SPI/I 2 C ISP to program internal flash of MCX N series MCUs via blhost or MCUXpresso Secure Provisioning Tool AN14544 EdgeLock 2GO Service for MPU and MCU: This application note introduces various methods that the EdgeLock 2GO service can be used with MCU and MPU devices and the features available for each method. AN14248 Recovery Boot from IFR0 for MCX Nx4x: This application note describes the step-by-step process of boot recovery of the signed binary image from Flash Bank 1 IFR 0 of the MCX Nx4x device upon failure of the image execution from the program flash. AN14255 Recovery Boot from 1-bit SPI Flash for MCXNx4x: This application note describes the step-by-step process of boot recovery of the signed binary image from 1-bit SPI flash on the MCXNx4x device upon failure of the image. AN14475 Dual Boot Secure Firmware Update using OTA HTTP Server:  This application note describes the step-by-step process to do a secure firmware update with dual image boot enabled. Covers the example provided in the SDK, which runs from internal flash and what changes are necessary to run from external memory. AN14271 CRC Calculation Features and Performance on MCX: This application note has been divided into two main parts. The first part provides information about the cyclic redundant checker (CRC). The second part introduces the features and performance of the CRC module on an MCX MCU. Training: Introduction: Flexible and Rapid Development with MCUXpresso: Getting Started with Your FRDM Development Boards Fe.... Learn more about NXP's FRDM Development Platform featuring our MCX MCUs portfolio. Discover why specific applications benefit from MCX and features to help differentiate your next product. You will also learn more about the MCUXpresso Developer Experience and how to get started with your FRDM development board. MCX Lab NXP initiative designed to foster collaboration with universities, providing students and educators with cutting-edge hardware, software, and educational resources.  ML/AI: eIQ Time Series Studio Training: Build and Run Time Series ML Models on FRDM-MCXN947 Getting Started with eIQ Time Series Studio Graphics Getting Started with Embedded GUI Development Using GUI Guider and LVGL Useful Links: See some demo videos created based on FRDM-MCXN Application Code Examples Expansion Boards and Accesories: accessories list in Expansion Board Hub compatible with FRDM-MCXN boards. Find displays, rotary, joystick, sensors, and more. Explore the different expansion boards which are supported by software to help you extend and evaluate the features in combination with FRDM-MCXN boards. Community Support If you have questions regarding this training, please leave your comments in our MCU Community! here   
View full article
In this lab, we will learn how to program a firmware binary onto the FRDM-MCXC162 development board. The lab will guide you through the complete firmware programming process, starting with the required hardware and software, and continuing with the development environment setup. Hardware requisites: FRDM-MCXC162 Board Type C USB Cable Software requisites: IDE: Visual Studio Code 1.130.0 or later SDK: v26.06.00 Windows OS (It was used Windows 11 for this hands-on) Link Server v25.5.59 Any Recent Phyton 3 Version Windows Command Prompt (CMD) This hands-on describes  Firmware Binary Programming Lab Guide Application Code Hub   Community Support If you have questions regarding this training, please leave your comments in our MCU Community! here 
View full article
In this lab, we will learn how to import and run a low-power SDK demo on the FRDM-MCXC162 development board. We will configure the application, build and debug the project, and use a serial monitor to control the available power modes. Hardware requisites: FRDM-MCXC162 Board Type C USB Cable Software requisites: IDE: Visual Studio Code 1.130.0 or later SDK: v26.06.00 Windows OS (It was used Windows 11 for this hands-on) This hands-on describes Low Power SDK Lab Guide Community Support If you have questions regarding this training, please leave your comments in our MCU Community! here 
View full article
In this lab, we'll learn how to access Application Code Hub directly from Visual Studio Code, download a low-power sensing application, and run it on the FRDM-MCXC162. Hardware requisites: FRDM-MCXC162 Board Type C USB Cable Software requisites: IDE: Visual Studio Code 1.130.0 or later SDK: v26.06.00 Windows OS (It was used Windows 11 for this hands-on) This hands-on describes Low Power Temperature Sensing Lab Guide Application Code Hub   Community Support If you have questions regarding this training, please leave your comments in our MCU Community! here 
View full article
MCUXpresso for Visual Studio Code (VS Code) provides an optimized embedded developer experience for code editing and development. The extension enables NXP developers to use one of the most popular embedded editor tools and provides an easy and fast way to create, build and debug applications based on MCUXpresso SDK or Zephyr projects.   Install it following the next steps: Download Visual Studio Code from Microsoft Store or visual studio code web page Download Visual Studio Code - Mac, Linux, Windows Access to vscode for MCUX wiki and download MCUXpresso Installer  Dependency Installation · nxp-mcuxpresso/vscode-for-mcux Wiki · GitHub Run MCUXpresso Installer: MCUXpresso SDK Developer Arm GNU Toolchain Standalone Toolchain Add ons Linkserver PEmicro   Installing the FRDM-MCX SDK  Each MCU has its own SDK that includes driver, examples, middleware, docs and other components. To get and build the demo, let’s install the SDK into VS Code. Install the NXP’s GitHub SDK: Once MCUXpresso for Visual Studio Code is installed, open VS Code. Go to MCUXpresso for VS Code extension that is on the tools column at the left. Look for INSTALLED REPOSITORIES option and press ‘+’ (Detail steps are described in wiki page. Working with MCUXpresso SDK · nxp-mcuxpresso/vscode-for-mcux Wiki · GitHub).                                               Search for the remote option of the Import Repository window. Select the MCUXpresso SDK in the repository option to download the GitHub SDK, then in the Revision tab you can select either the “main” revision or to select a specific version), optionally you can change the repository name and location. Finally click on the “Import” button.
View full article
eIQ Time Series Studio includes a command line interface (CLI) that allows you to generate time series models via the command line just like you would in the GUI. Full documentation of this feature can be found in the eIQ TSS documentation. A Quick Start with the basic key commands is also available.  Below is an example using the command line interface with eIQ Time Series Studio: #Assumes the following items: #1) tss_cli is in the executable path (C:\Program Files\NXP\eIQ_TimeSeriesStudio-1.5.5) #2) The dataset is in C:\tss\dataset #3) A workspace will be setup in C:\tss\workspace #4) The license key has already been retrieved from the TSS GUI #5) The TSS GUI is not also concurrently running #Install license Key tss_cli.exe license activate --key <your_key> #Start TSS CLI tss_cli engine launch -e "C:\Program Files\NXP\eIQ_TimeSeriesStudio-2.0.5\tss_engine\tss_engine.exe" --port 18000 --workspace "C:\tss\workspace" #Install license key tss_cli license activate --key <your_key> #Create a classification project for a FRDM-MCXN947 tss_cli project create --project_name cli_fan_project --algo_type cls --device FRDM-MCXN947 --channels 3 --label_target_num 4 #List all projects in the workspace and see details for the newly generated cli_fan_project tss_cli project list tss_cli project query --project_name cli_fan_project #Add training data tss_cli signal list --project_name cli_fan_project tss_cli signal import --project_name cli_fan_project --signal_name ON --file_path C:\tss\data\fan_state_monitoring_3channel\train\train_on.csv --label_id 1 --delimiter " " tss_cli signal import --project_name cli_fan_project --signal_name OFF --file_path C:\tss\data\fan_state_monitoring_3channel\train\train_off.csv --label_id 2 --delimiter " " tss_cli signal import --project_name cli_fan_project --signal_name FRICTION --file_path C:\tss\data\fan_state_monitoring_3channel\train\train_friction.csv --label_id 3 --delimiter " " tss_cli signal import --project_name cli_fan_project --signal_name CLOG --file_path C:\tss\data\fan_state_monitoring_3channel\train\train_clog.csv --label_id 4 --delimiter " " #Check training data tss_cli signal query --project_name cli_fan_project --signal_id 1 #Start training the model. It will print out an opt_ID number, which the first time you run it will be "1". tss_cli optimization start --project_name cli_fan_project -qs --opt_name cli_fan_opt --signals 1 2 3 4 #Get opt_id number while training is running tss_cli optimization list --project_name cli_fan_project #Check how far along the training is and get ranking of models to choose a result_ids tss_cli optimization progress --project_name cli_fan_project --opt_id 1   #Can stop the training if feel like have enough results tss_cli optimization stop --project_name cli_fan_project --opt_id 1 #Get the result_ids of the best result. It will also be the top ID when checking the progress above. In this case will use 48 tss_cli optimization results --project_name cli_fan_project --opt_id 1 #Get Execution Time estimate for that model tss_cli library time_estimate --project_name cli_fan_project --opt_id 1 --result_id 48   #Get Label Names tss_cli signal list --project_name cli_fan_project   #Emulate the library on test data tss_cli emulation launch --project_name cli_fan_project --opt_id 1 --result_ids 48 --test_file_info "1" C:\tss\data\fan_state_monitoring_3channel\test\test_on.csv " " --test_file_info "2" C:\tss\data\fan_state_monitoring_3channel\test\test_off.csv " " --test_file_info "3" C:\tss\data\fan_state_monitoring_3channel\test\test_friction.csv " " --test_file_info "4" C:\tss\data\fan_state_monitoring_3channel\test\test_clog.csv " " #Create a TSS library tss_cli library compile --project_name cli_fan_project --opt_id 1 --result_id 48 --save_path "C:\tss\" --arch "cortex-m33" --toolchain "GCC" #Create a TSS example project tss_cli library sample_project --project_name cli_fan_project --opt_id 1 --result_id 48 --save_path "C:\tss" --arch "cortex-m33" --toolchain "GCC" Here's also some tips and common issues to be aware of:  Windows Workspace Permissions On Windows PCs, specify the workspace location when launching the TSS CLI server. The default workspace on Windows may not work properly due to a permissions issue, resulting in the following error: [PYI-12556:ERROR] Failed to execute script 'server' due to unhandled exception!   Workaround: Specify a workspace directory location where TSS has read/write access with the tss_cli engine launch --workspace <directory_location> argument   Do Not Run CLI and GUI Simultaneously The TSS CLI and TSS GUI should not be run at the same time. Also only one user should interact with the TSS CLI at a time to avoid race conditions in the TSS database if it is on a shared server.    Engine Launch Syntax Correction The TSS CLI documentation uses tss_cli engine launch –engine <path to tss_engine>, but the correct syntax is: tss_cli engine –exe_path <path to tss_engine>   Windows Command Prompt Delimiters When using Windows Command Prompt and importing sensor data with the signal import command, use double quotes (" ") to specify the delimiters (ie a space in this case) instead of the single quotes ('  ')    Terminology Clarification "Optimization" in the documentation refers to the process of training the time series model.   Finding the Optimization ID during training The my-opt-id value can be found by viewing the optimization list with tss_cli optimization list --project_name cli_test_project   Finding the Label Name The label-name value used for emulation commands can be found by viewing the name of the signals with tss_cli signal list --project_name cli_test_project   Boolean Arguments Arguments such as quick search during training are Boolean values, which are automatically enabled when included as part of the command line argument. For example, use -qs rather than -qs true.
View full article
The attached lab will describe how to add eIQ Time Series Studio generated libraries to an existing NXP embedded application.   It describes how to add the TSS library files to your application and configure the project settings in VS Code, MCUXpresso IDE, IAR, and Keil. It also covers how to call the TSS API from existing user code so that you can quickly and easily add time series ML analysis to  your embedded application.  For details on how to create a time series model with eIQ Time Series Studio, see the Getting Started with TSS Lab.
View full article
The MCX N microcontroller family includes an eIQ Neutron N1-16 NPU for accelerating neural network models. The FRDM-MCXN947 development board can be combined with a camera and LCD screen to showcase running TinyML vision models on a microcontroller.   MCX N Camera Hardware Setup: The following hardware is used: MCX N FRDM Development Board - FRDM-MCXN947 OV7670 camera (with optional wide-angle lens) NXP LCD-PAR-S035  There are three small modifications needed for the FRDM-MCXN947 board for camera support. Without this modification the camera colors will be incorrect and tinted red.   Change SJ16, SJ26, and SJ27 found on the back of the Rev B board to connect pin 3 (the dashed side) so that it looks like the following:          Then connect the camera and LCD to the FRDM-MCXN947: Plug in the OV7670 camera into J11. It should line up with the orange box.                                Connect the LCD-PAR-S035 LCD into J12. It should be flush with the bottom so that the top 2 rows of pins are left hanging off the edge. Also note that on some LCD-PAR-S035 boards those top two rows of pins are not installed.            It should look like the following when complete             Also as the camera and Ethernet pins are shared, if you need to use the Ethernet+Camera at the same time please see this NXP Community post. MCX N Vision ML Examples: The NXP Application Code Hub contains several vision AI/ML examples: Face Detect Face Detect with Zephyr Multiple Person Detection  CIFAR10 Fashion MNIST There are also Multimedia Processing Pipeline (MPP) examples inside the MCX N MCUXpresso SDK that demonstrate more examples of using vision AI/ML on MCX N. These examples are only available for VSCode/GCC in the Repository-Layout SDK package. Note: It is recommended to use MCUXpresso SDK 25.09 for these examples. The MPP issues in the 25.12 and 26.03 MCUXpresso SDK releases should be fixed in the upcoming MCUXpresso SDK 26.06.    MCX N ML Vision Lab: The attached eIQ Neutron NPU for MCX N Lab Guide - Face Detect.pdf lab document walks through the steps to download an example Face Detect ML project from the NXP Application Code Hub and use the eIQ Neutron Compiler tool to convert a model. It also describes how to update the eIQ and Neutron software libraries in an older MCUXpresso SDK project to work with the latest eIQ Neutron SDK libraries. It is recommended to go through the general MCX N NPU Lab Guide first and then do the attached Face Detect lab second.  The lab is also included below: 1  Lab Overview This document will demonstrate the acceleration provided by the eIQ Neutron NPU using the Multiple Face Detection demo for the FRDM-MCXN947 found on the NXP App Code Hub. The demo will run with the non-NPU optimized model and then the performance can be compared to the NPU optimized version of that same model. It also demonstrates how the NPU optimized version of the face detect model was generated. This lab is written for MCUXPresso IDE but the same basic steps can be used for VSCode or GCC.   This lab will also cover how to update the Neutron NPU libraries in the project, as the original Face Detect example uses an older Neutron library version.   It is highly recommended to complete the eIQ Neutron NPU for MCX N Lab Guide before starting this lab. 2  Software and Hardware Installation This section will cover the hardware and software needed for this lab. 2.1 Hardware The following hardware is required for this lab: MCX N FRDM Development Board - FRDM-MCXN947 OV7670 camera (with optional wide-angle lens) NXP LCD-PAR-S035 2.2 NXP Software Installation          Install MCUXpresso IDE v25.6 or later. Download the latest eIQ Neutron SDK Download and unzip the latest MCUXpresso SDK for FRDM-MCXN947 using MCUXpresso SDK builder Search for the FRDM-MCXN947 board     Then click on Others   On the SDK builder page, make sure to select the “eIQ” middleware and that the MCUXpresso IDE toolchain is selected. Then click on Build SDK.     Then click on the Download button and accept the license agreement to download the zip file.     3   Face Detection Example 3.1 Download Face Detect Demo from App Code Hub The code for this lab can be found on the NXP Application Code Hub hosted on Github, and we can use MCUXpresso IDE to directly import the Face Detection example from App Code Hub.   Drag-and-drop the FRDM-MCXN947 SDK zip file into the Installed SDKs window, located on a tab at the bottom of the screen named “Installed SDKs”. You will get the following pop-up, so hit OK.   Once imported, the Installed SDK tab will look something like this:    In the Quickstart Panel found in the lower left corner, click on Import from Application Code Hub..   In the dialog box that pops up there are many filters available to filter for different devices and types of demos. But since the name of the demo we are interested in is already known, the search box will be faster. Select the AI/ML category and then type in “face detection” and then click on the “Multiple face detection on mcxn947” demo. Make sure you don’t accidently click on the “Multiple Person Detection” demo.   On the popup that comes up, click on GitHub link at the top. At that point the Next button at the bottom will become clickable so click on that.     The next screen displays the possible branches. In this case there is only main so just click on the Next button at the bottom to go with the default.   The next dialog box determines the location on your computer where the code will be downloaded to. You can leave it at the default location if desired or click on Browse to pick your own location. Then click on Next.   The next screen will download the code and ask about importing the project. Click on Next to go with the default Import existing Eclipse projects option.   Then finally on the last screen click on Finish to import the project into your MCUXPresso IDE workspace.   You may get the following warning due to the project being made on an older version of the SDK. Then hit OK to accept the using the newest version.  15. It should look like the following when done:     3.2 Convert Model The demo is already using a model that was converted to take advantage of the eIQ Neutron NPU. This purpose of this section of the lab is to teach new NXP users how that model was converted. Unzip the eIQ Neutron SDK package in a directory of your choosing.   Optionally add <unzip_location>\eIQ_NeutronSDK_<version>\bin to your executable path so that the neutron-compiler utility can be directly called from the command line. Back in MCUXpresso IDE, find the location of the original non-converted model used for this demo by right clicking on the face_detect.tflite file in source/model/ and going to Utilities->Open directory browser here.   Copy the directory location as it will be used in the next step   Open a Windows Command prompt and navigate to the directory where the model was at from the previous step               Use the Neutron Compiler to convert the Face Detection model: neutron-compiler --input face_detect.tflite --output face_npu.tflite --target mcxn94x     3.3 Update eIQ Neutron Libraries The Face Detect ACH example uses an older version of the eIQ Neutron libraries, and so it needs to be updated to match the Neutron libraries in newest eIQ Neutron SDK since the model was converted with that version of the Neutron Compiler tool.   In the frdmmcxn947_multi_face_detection project, right click on the eiq folder and go to Utilities->Open directory browser here   Overwrite the Neutron files from the eIQ Neutron SDK folder into your project to update the Neutron libraries to the latest version: File Name Source Directory in eIQ Neutron SDK Target Directory in MCUXpresso SDK libNeutronDriver.a target\mcxn94x\board\ eiq\neutron\mcxn\cm33 libNeutronFirmware.a target\mcxn94x\board\ eiq\neutron\mcxn\cm33 NeutronDriver.h target\mcxn94x\driver\include\ eiq\neutron\driver\include NeutronErrors.h target\mcxn94x\common\include\ eiq\neutron\common\include After the new Neutron libraries are copied over, clean the project to ensure the new libraries will be used     3.4 Board modifcations There are some hardware modifications to the MCX FRDM board required for this demo since the camera pins are muxed with the Ethernet pins and the Ethernet functionality is the default.   The board version can be determined by scanning the QR code on the back of the MCX FRDM board with your phone. Most people will have Rev B boards.   Rev A: Remove the R157, R158, and R159 resistors from the back of the Rev A board so that it looks like the following:   Rev B: Change SJ16, SJ26, and SJ27 found on the back of the Rev B board to connect pin 3 (the dashed side) so that it looks like the following:       3.5 Connect the camera and LCD Plug in the OV7670 camera into J11. It should line up with the orange box.   Connect the LCD-PAR-S035 LCD into J12. Note that some older LCD-PAR-S035 LCDs may have an extra set of pins soldered on, and in that case the extra 2 rows of pins should be hanging off the edge like in the photo below.               It should look like the following when complete     3.6 Run Models Now open up model_data.s by double clicking on it, and then modify line 43 to point to the original (non NPU converted) model file named face_detect.tflite. This particular project uses the .tflite file directly.   Build the project by clicking on the Build icon in the Quickstart Panel   Then download and run the project by clicking on the Debug icon in the Quickstart Panel     You should see the demo working with an inference time of 817ms printed on the LCD display. Note: The default camera on the OV7670 is not very wide angle so you have to hold it fairly far back. There are wide-angle lenses that can be purchased to make it easier to demonstrate. Note: After POR there may be some glitching on the camera due to the fact the camera is expecting 2.8V but the board is at 3.3V and the initial HSYNC signal was missed. Press the reset button (SW1) and it should fix any camera issue.  Now let’s use the Neutron optimized model by opening model_data.s again and this time selecting the NPU converted model face_npu.tflite   Recompile and reprogram the board. You’ll see it is significantly faster with a 22ms inference time, a 37x improvement!   4  Conclusion This lab demonstrated how the eIQ Neutron NPU on MCX N devices can significantly decrease inference time on quantized models and the steps to generate a NPU optimized model using the command line tools. Also explore the other App Code Hub ML examples available online.
View full article
Clone an Example Project from MCUXpresso IDE The following steps will guide you through the manipulation of the general-purpose outputs. The example sets up a CTimer to generate a PWM signal and change between two LEDs. Find the Quickstart Panel in the lower left-hand corner and click on Import SDK example(s) Click on the FRDM-MCXN947 board to select that you want to import an example that can run on that board, and then click on Next Use the arrow button to expand the  driver_examples  category, then expand the ctimer examples, click on the check box next to  ctimer_match_interrupt_example  to select it. To use the UART for printing (instead of the default semihosting), Select UART as the SDK Debug Console checkbox under the project options. Then, click on Finish Click on the  “frdmmcxn947_ctimer_match_interrupt_example”  project in the Project Explorer View and build, compile, and run the demo as described in the previous section You should see the BLUE and RED LED changing back and forth Terminate the debug session Use MCUXpresso IDE Pins Tools to Modify Example   Note: Previously, you had to clone an SDK project like in the previous step. Open the pins tool by selecting “ConfigTools” on the top right hand of the file explorer window and then select “ Open Pins”     The pins tool should now display the pin configuration for the ctimer project     In the Pins view deselect “Show dedicated pins” and “Show no routed pins” checkboxes to see only the routed pins. Routed pins have a check in a green box next to the pin name. The functions selected for each routed pin are highlighted in green   In the current configuration, PIO3_2 and PIO3_3 are routed as the outputs of the CTimer. Let’s add a third Ctimer Match output and enable the Green LED Select “Show no routed pins” to see the other options. To enable the third Ctimer Match Output, browse the column for Ctimer and select and output. In this example, we will select, Ctimer4 Match 2 on PIO3_6. Select the item in the Ctimer column to enable   Now, let’s route the Green LED. In the search box type “green” so that the routed pin for this LED is shown. Finally, click the box under the GPIO column. The box will highlight in green, and a check will appear next to the pin   Next configure the GPIO pin as an output in the “Routing Details” window   Now it’s time to implement these changes into the project by exporting the new updated pin_mux.c and pin_mux.h files that are generated by the Pins tool. Click on Update Project in the menu bar   The screen that pops up will show the files that are changing and you can click on “diff” to see the difference between the current file and the new file generated by the Pins tool. Click on “OK” to overwrite the new files into your project   Let’s add some additional code to the example. Open  simple_match_interrupt.c  file and add the following macros for the third ctimer output.   Add the Green LED functions as well.   Some additional code to be implemented will be the third ctimer’s callback, this can be copied from  ctimer_match1_callback  and modify the content to match2. To be able to visually identify the new ctimer, we will remove one of the previous ctimers as shown     The main function will need to include the initialization of both the Green LED and the Ctimer   Build and download the project as done in the previous section Run the application. You should now see the Green and Blue LED blinking back and forth Terminate the debug session
View full article
Clone an Example Project Using MCUXpresso Config Tool    The following steps will guide you through the manipulation of the general-purpose outputs. The example sets up a SCTimer to generate a PWM signal and change a LED brightness. Open the MCUXpresso Config Tool In the wizard that comes up, select the “Create a new configuration based on an SDK example or hello word project” radio button and click on Next On the next screen, select the location of the MCUXpresso SDK . The SDK package must be unzipped beforehand. Then select the IDE that is being used. Note that only IDEs that were selected in the online SDK builder when the SDK was built will be available and click on clone select example. Then select the project to clone. For this example, we want to use the gpio led output project. You can filter for this by typing “ctimer” in the filter box and then selecting the  “ctimer_match_interrupt_example”  example project. You can then also specify where to clone the project and the name. Then click on Finish After cloning go to the directory you selected and open the project for your IDE. Import, compile, and run the project as done in previous sections You should see the BLUE and RED LED changing back and forth Terminate the debug session Use MCUXpresso IDE Pins Tools to Modify Example   Note: Previously, you had to clone an SDK project like in the previous step. Open the pins tool by selecting “ConfigTools” on the top right hand of the file explorer window and then select “ Open Pins”   The pins tool should now display the pin configuration for the ctimer project   In the Pins view deselect “Show dedicated pins” and “Show no routed pins” checkboxes to see only the routed pins. Routed pins have a check in a green box next to the pin name. The functions selected for each routed pin are highlighted in green In the current configuration, PIO3_2 and PIO3_3 are routed as the outputs of the CTimer. Let’s add a third Ctimer Match output and enable the Green LED Select “Show no routed pins” to see the other options. To enable the third Ctimer Match Output, browse the column for Ctimer and select and output. In this example, we will select, Ctimer4 Match 2 on PIO3_6. Select the item in the Ctimer column to enable Now, let’s route the Green LED. In the search box type “green” so that the routed pin for this LED is shown. Finally, click the box under the GPIO column. The box will highlight in green, and a check will appear next to the pin Next configure the GPIO pin as an output in the “Routing Details” window Now it’s time to implement these changes into the project by exporting the new updated pin_mux.c and pin_mux.h files that are generated by the Pins tool. Click on Update Project in the menu bar The screen that pops up will show the files that are changing and you can click on “diff” to see the difference between the current file and the new file generated by the Pins tool. Click on “OK” to overwrite the new files into your project Let’s add some additional code to the example. Open  simple_match_interrupt.c  file and add the following macros for the third ctimer output. Add the Green LED functions as well. Some additional code to be implemented will be the third ctimer’s callback, this can be copied from  ctimer_match1_callback  and modify the content to match2. To be able to visually identify the new ctimer, we will remove one of the previous ctimers as shown   The main function will need to include the initialization of both the Green LED and the Ctimer Build and download the project as done in the previous section Run the application. You should now see the Green and Blue LED blinking back and forth Terminate the debug session  
View full article
The following steps will guide you through the hello_world demo application using MCUXpresso IDE for the Cortex-M33 application. The MCUXpresso IDE installation and the SDK for the MCXN-Series can be found at the section Get Software of this Getting Started guide. Find the Quickstart Panel in the lower left-hand corner.   Then click on Import SDK example(s). Click on the board you are using to select an example that can run on that board, and then click on Next.   Use the arrow button to expand the demo_apps category, and then click the checkbox next to hello_world to select that project. To use the UART for printing (instead of the default semihosting), select UART as the SDK Debug Console checkbox under the project options. Then, click on Finish Select the project and build it by either clicking on the “build icon” in the shortcuts provided above or by clicking “Build” in the Quickstart Panel   The project should build without presenting any errors or warnings in the console   Connect the board to your computer with the type-C USB cable to ‘MCU-LINK’ port. Check your board's user manual for instructions.   Download the application to your board by either clicking on the “debug” icon above or clicking on “Debug” in the Quickstart Panel   Select the MCU-Link CMSIS-DAP debug probe  Open up a serial terminal to be able to see the application’s output. Select the “Terminal” window and press the “new terminal” icon   Choose a “Serial Terminal” and then set the UART settings to 115200 baudrate, 8 bit data size, no parity and 1 stop bit. Press OK   Run the application by pressing the “run” icon. See the output printed on the terminal  
View full article
Install CMSIS Device Pack After the MDK tools are installed, Cortex® Microcontroller Software Interface Standard (CMSIS) device packs must be installed to fully support the device from a debug perspective. These packs include things such as memory map information, register definitions and flash programming algorithms. Follow these steps to install the appropriate CMSIS pack. Please use MDK-Arm Microcontroller Development Kit (Keil)® version 5.38.1 or above. Open the MDK IDE, which is called µVision. Inside the IDE, select the "Pack Installer" icon In the Pack Installer window, search for "MCXW" to bring up the MCXW71 family. Click on the MCXW7XX name, and then in the right-hand side you'll see the NXP:  MCXW71_DFP  pack. Click on the "Install" button next to the pack. This process requires an internet connection to successfully complete After the installation finishes, close the Pack Installer window and return to the µVision IDE Build the Example Application The following steps will guide you through opening the  hello_world  application. These steps may change slightly for other example applications as some of these applications may have additional layers of folders in their path. If not already done, open the desired demo application workspace in: <install_dir>/boards/<sdk_board_name>/<example_type>/<application_name>/mdk Select Debug configuration Do right-click on the project and select the project options: Now, go to the Debug option and select CMSIS-DAP ARMv8-M Debugger. Click on the OK button To build the demo project, select the "Rebuild" button, highlighted in red The build will complete without errors
View full article
The following steps will guide you through opening the  hello_world  application. The instructions for compiling and debugging the Cortex M33 core are covered in the instructions below. Build an Example Application Please use IAR Embedded Workbench for Arm version 9.50.1 or above. First, unzip the previously downloaded FRDM-MCXW71 SDK package Open the desired example application workspace. Most example application workspace files can be located using the following path: <install_dir>/boards/<sdk_board_name>/<example_type>/<application_name>/iar Select the desired build target from the drop-down. For this example, select the "hello_world - debug" target Open the project properties by doing a right-click on the project and selecting "Options" Now, go to the "Debugger" section and change the debugger driver to CMSIS DAP. Press the OK button To build the application, click the "Make" button, highlighted in red below The build will complete without errors   Note: In case of building errors, make sure that the correct board is selected, right-click in Project → Options → General Options → Target → Device. Select the NXP MCU you are using and is supported by the IAR version you have installed.   Run an Example Application Connect the development platform to your PC via USB cable to 'MCU-Link' port Click the "Download and Debug" button to download the application to the target The application is then downloaded to the target and automatically runs to the main() function Run the code by clicking the "Go" button to start the application The  hello_world  application is now running on the MCU.
View full article
The most recent versions of MCUXpresso IDE count with a terminal emulation application. This tool can be used to display information sent from your NXP development platform's virtual serial port 1. Open the MCUXpresso IDE   2. Launch the MCUXpresso IDE terminal by clicking on the "Open a Terminal" button on the top of the IDE or press "Ctrl + Alt + Shift + T" 3. Select Serial Terminal   4. Configure the serial port settings (using the LPC-Link2 COM port number) to 115200 baud rate, 8 data bits, no parity and 1 stop bit, then press the "OK" button     5. Verify that the connection is open. If connected, MCUXpresso IDE will look like the figure below at the Terminal view     6. You're ready to go  
View full article