Skip to content

About

NXP Platform Accelerator for MCXN947 Freedom Board

Resources

Stars

9 stars

Watchers

2 watching

Forks

Repository files navigation

NXP Application Code Hub

NXP Platform Accelerator for MCXN947 FRDM

NXP Platform Accelerator is a VEE (Virtual Execution Environment) that provides a hardware abstraction to develop applications in high-level programming languages such as Java.

NXP Platform Accelerator is built upon MicroEJ technology.

Boards: FRDM-MCXN947

Categories: RTOS

Peripherals: DISPLAY

Table of Contents

Software

  • Linux (Ubuntu 22.04/Debian 11) or Windows 10
  • Java Development Kit (Oracle JDK 11 or OpenJDK 11)
  • MICROEJ SDK 6
  • MCUXpresso SDK Developer (installs CMake, Ninja, West, LinkServer and ARM GNU Toolchain)

Hardware

This project uses the following:

Setup

Board Technical Specifications

MCU part number MCXN947
MCU architecture Arm Cortex-M33
MCU max clock frequency 150 MHz
Internal RAM size 512kB
Internal flash size 1MB - 2MB
eMMC/SD support yes
Display 480x320 LCD
Ethernet interface yes

VEE Port Specifications

The architecture version is 8.3.0.

This VEE Port provides the following Foundation Libraries:

Foundation Library Version
AI 1.0
BON 1.4
DEVICE 1.2
DRAWING 1.0
EDC 1.3
FS 2.1
GPIO 1.0
KF 1.7
MICROUI 3.1
NET 1.1
SECURITY 1.4
SNI 1.4
SSL 2.2
TRACE 1.1

This VEE Port is compatible with MicroEJ SDK6 or higher.

Requirements

  • A PC with Windows 10 or higher or Linux (tested on Debian 11, Ubuntu 20.04).
    • Note for Mac users: this documentation does not cover MacOS use; however, it is supported by the MicroEJ tools. If you are interested in Mac support, please contact MicroEJ.
  • An internet connection to use the MicroEJ Central Repository,
  • An MCXN947 FRDM board (can be ordered here) and LCD_PAR_S035 display panel (can be ordered here)
  • Optionally: a J-Link Debugger probe to flash the software.
  • Optionally: a MicroSD card to use the file system

Steps

Get MicroEJ SDK

The MICROEJ SDK allows to build the VEE Port and the high-level applications. It can be used to run the MCXN947 FRDM simulator.

  • Install a Java Development Kit (JDK). The MICROEJ SDK requires a JDK (Java Development Kit) 11 or higher. You can download a JDK at Java SE 11.
  • Install MICROEJ SDK 6 by following the SDK 6 Installation Documentation. You can use your preferred IDE to work with the MICROEJ SDK.

Get the Necessary Tools for MCUXpresso SDK

You can choose to install MCUXpresso SDK tools manually or with the installer tool.

With the MCUXpresso Installer Tool

Install the MCUXpresso Installer tool with the following documentation: link.

Open it and install the following tools that are used during compilation/debugging:

  • MCUXpresso SDK Developer (installs CMake, Ninja, West, and ARM GNU Toolchain)
  • LinkServer
  • SEGGER J-Link (if optional J-Link is used)

Also, install the following tools manually:

  • Make, in version 3.81 or higher.
  • On Ubuntu 22.04 or lower, CMake must be installed manually to get the latest version (3.27 or higher needed).

Manual Installation

The MCUXpresso installer tool provides a convenient way to install these tools, but they can also be installed independently. In the case of a standalone installation, the following versions need to be installed:

Environment Variables

Whatever procedure is used for the installation, the following environment variables must be configured:

  • ARMGCC_DIR: the installation directory of ARM GNU Toolchain, for example C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\13.2 Rel1
  • If you use LinkServer to flash your device, add to PATH the installation directory of LinkServer, for example C:\NXP\LinkServer_24.12.21.

Note: On Windows, editing the User variables may not work —Preferably edit System variables.

Fetch the Source Code

Clone the repository with the following commands:

mkdir nxp-vee-mcxn947-frdm
cd nxp-vee-mcxn947-frdm
west init -m https://github.com/nxp-mcuxpresso/nxp-vee-mcxn947-frdm.git .
west update

The following folders will be created:

nxp-vee-mcxn947-frdm
 .west

Note: On Windows, your path to the repository folder should be as short as possible

Note: Your path should not contain a whitespace or special character

Open the Project

Launch your IDE chosen during MicroEJ installation step and open the project folder (nxp-vee-mcxn947-frdm). The following screenshots show Visual Studio Code, but similar results can be obtained with another IDE.

Then wait for your IDE to finish loading the project, as indicated in the message in the status bar:

Once loaded, you should see the following files and folders:

And the Gradle view should look like this:

Build and Run an Application in Simulation Mode

Choose your Demo Application

Following MicroEJ applications are included in this release.

  • The SimpleGFX application displays three moving rectangles using the MicroUI API. The coordinates of the rectangles are calculated in C native functions. More details in this README.
  • The AiSample Application runs an inference of sample images on a CifarNet quantized TensorFlow Lite model. You can find the AI library API in the MicroEJ Developer Repository. To run this demo, AI must be enabled (see AI paragraph). More details in this README.

Execute runOnSimulator Task

To run an application in simulation mode, go to the Gradle view, expand the tasks of the chosen demo project, then double-click on the microej > runOnSimulator task:

The runOnSimulator task also builds the VEE Port declared as dependency if required.

Build and Run Applications on your Board

Board Setup

Plug the USB port "JTAG" of your board to your computer with a USB-C cable.

The USB connection is used as a serial console for the SoC, as a CMSIS-DAP debugger, and as a power input for the board.

The MicroEJ VEE Port uses the virtual UART from the MCXN947 FRDM USB port. A COM port is automatically mounted when the board is plugged into a computer using a USB cable. All board logs are available through this COM port.

The COM port uses the following parameters:

Baudrate Data bits bits Parity bits Stop bits Flow control
115200 8 None 1 None

Here is a picture of MCXN947 board connected with:

  • The USB wire plugged on J17,
  • The optional J-Link Debugger probe on J23.

Build and Deploy

There are two different ways to build and deploy an executable on target:

  • Using MicroEJ SDK 6: this method allows to build and deploy an executable in one click using gradle tasks.
  • Using MCUXpresso for VSCode: this method allows to debug on target in addition to build and deploy.

Build and Deploy using MicroEJ SDK 6

Configure debug or release mode

To configure the debug or release mode, change the CHOSEN_MODE variable in set_project_env.bat or set_project_env.sh:

  • Set it to 0 for debug mode
  • Set it to 1 for release mode
Configure the debug probe

To configure the debug probe, change the CHOSEN_PROBE variable in set_project_env.bat or set_project_env.sh:

  • Set it to flash for a J-Link probe
  • Set it to flash_cmsisdap for board internal probe
Configure the BSP Features

Compilation flags are located in CMakePresets.json. To enable any desired features, please edit the file.

For changes in this file to take effect, the script clean.bat or clean.sh must be called.

Launch runOnDevice gradle task

To build and deploy your executable on your board, go to the Gradle view, expand the tasks of the chosen demo project, then double-click on the microej > runOnDevice task:

If you don't have a MicroEJ license, you will get an error message telling you to get one. Please follow the instructions from MicroEJ to get an evaluation license. To switch to a production license, please get in touch with your NXP representative.

This task calls:

Build and Deploy using MCUXpresso for VSCode

MCUXpresso for VSCode is a plugin on VSCode IDE that builds and deploys firmware on NXP targets. It also provides the configuration to launch a debug session.

Generate MicroEJ Object Files

You need to produce the object files of the MicroEJ Application and deploy them into the BSP, but you will delegate the build of the Executable to MCUXpresso. To do so, follow these steps:

  • Open the file configuration/common.properties located in your application folder and change the property deploy.bsp.microejscript to false
  • Open the Gradle view, expand the tasks of your application, and double-click on the microej > buildExecutable task.

The following MicroEJ object files will be deployed in the BSP:

  • The MicroEJ application (microejapp.o) will be deployed in bsp/vee/lib.
  • The MicroEJ library (microejruntime.a) will be deployed in bsp/vee/lib.
  • The MicroEJ header files (*.h) will be deployed in bsp/vee/inc.
Load the Project into VS Code

Open the project with VSCode (from where the .vscode is located). Install MCUXpresso for VSCode plugin.

Select a Preset

Open the Command Palette (CTRL + SHIFT + p) and run CMake: Select Configure Preset to select the build mode you wish to use.

By default, you can select the debug variant.

You can also select a preset by using the Projects section from the "MCUXpresso for VS code" view and setting the appropriate build as default.

Configure the Project

Open the Command Palette (CTRL + SHIFT + p) and run CMake: Configure.

Configure the BSP Features

Compilation flags are located in CMakePresets.json. To enable any desired features, please edit the file (and reload preset & re-configure if needed).

After a change in this file, a Pristine build must be made (see Build the Project step).

Build the Project

Open the Command Palette (CTRL + SHIFT + p) and run CMake: Build.

You can connect VS Code to the board using the Serial Link USB or a SEGGER J-Link probe. Follow the Board Setup step for more information on how to connect the different debuggers.

Debug sessions can be started by pressing the F5 key.

It is also possible to build and debug the project via the MCUXpresso plugin:

Right-click on the project, then:

  • Build Selected or Pristine Build/Rebuild Selected to compile.
  • Debug to debug (it can take some time before launching). In this case, the name of the selected preset must contain debug and not release.

Once the firmware is flashed, you should see the application running on the target.

Note: In case of connection issues to the target, reset the debug probe selection via the MCUXpresso plugin:

  • Select the MCUXpresso plugin in the activity bar.
  • Right-click on the project name and select Reset Probe Selection.
  • Start the debug again.

Optional Features

Multi-Sandbox

For information on multi-sandbox, please visit MicroEJ website.

By default, the VEE Port is built in mono-sandbox. Multi-sandbox can be enabled by editing com.microej.runtime.capability property of configuration.properties file and change its value to multi.

AI

AI can be enabled or disabled by changing ENABLE_AI value in CMakePresets.json. Set it to 1 to enable it and 0 to disable it. Call clean.bat or clean.sh after changing this value.

System View

For information about System View, please visit SEGGER website or MicroEJ documentation.

Follow these steps to run a System View live analysis:

  • Set ENABLE_SYSTEM_VIEW CMake variable to 1 in CMakePresets.json.
  • Call clean.bat or clean.sh.
  • Set FLASH_CMD to flash in set_project_env.bat or set_project_env.sh.
  • Execute runOnDevice gradle task. Use a J-Link probe to flash your target.
  • Open System View PC application
  • Go to Target > Start Recording
  • Select the following Recorder Configuration:
    • J-Link Connection = USB
    • Target Connection = MCXN947_M33_0
    • Target Interface = SWD
    • Interface Speed (kHz) = 4000
    • RTT Control Block Detection = Auto
  • Click Ok

If you have an issue, please have a look at the Troubleshooting section in MicroEJ documentation.

Troubleshooting

Setup Error

West Update and "Filename too long" Issue

On Windows, fetching the source code may trigger the following fatal error: error: unable to create file [...]: Filename too long.

To avoid this, git configuration needs to be updated to handle long file names:

Start Git Bash as Administrator.

Run the following command: git config --system core.longpaths true

West Update and "PermissionError: [WinError 5] Access is denied" Issue

If you get the error PermissionError: [WinError 5] Access is denied, please consider the following procedure :

rm .west
cd nxp-vee-mcxn947-frdm
west init -l
cd ..
west update

Ninja errors during BSP build

Ninja: error: loading 'build.ninja': The system cannot find the file specified

If you get the following error during the BSP build, please remove the cmake cache by running the script clean.bat or clean.sh.

"Failed to build the firmware"
ninja: error: loading 'build.ninja': The system cannot find the file specified.
make: *** [remake] Error 1

Flash issue

Flash may not work out of the box. If this is the case, please:

  • Check if correct probe is chosen based on effective flash method
  • Update firmware of the on-board debugger (that may not be up-to-date)

See this community post on how to update the firmware for MCXN947 FRDM.

MicroSD card could be missing

MCXN947 FRDM boards do not come with a MicroSD card socket populated on J12.

If File System is needed, a MicroSD memory card connector can be soldered like MEM2075-00-140-01-A from GLOBAL CONNECTOR TECHNOLOGY INC), (see https://community.nxp.com/t5/MCX-Microcontrollers/FRDM-MCXN947-SD-Card-Slot-Part-Number/m-p/2024781)

Results

The AiSample Application running, following the execution of the gradle tasks: runOnSimulator and runOnDevice.

The SimpleGFX application displays three moving rectangles, also running on the simulator and on the device.

Support

BSP (Board Support Package)

The BSP is based on the following versions:

Project Metadata

Board badge

Category badge

Peripheral badge

Questions regarding the content/correctness of this example can be entered as Issues within this GitHub repository.

Warning: For more general technical questions regarding NXP Microcontrollers and the difference in expected functionality, enter your questions on the NXP Community Forum

Follow us on Youtube Follow us on LinkedIn Follow us on Facebook Follow us on Twitter

Release Notes

Version Description / Update Date
2.0.0 This is NXP Platform Accelerator for MCXN947 Freedom board with an LCD-PAR-S035 display panel. May 28th 2025

About

NXP Platform Accelerator for MCXN947 Freedom Board

Resources

Stars

9 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages