Run a demo using MCUXpresso IDE
Note: Ensure that the MCUXpresso IDE toolchain is included when generating the MCUXpresso SDK package.
This section describes the steps required to configure MCUXpresso IDE to build, run, and debug example applications. The hello_world
demo application targeted for the hardware platform is used as an example, though these steps can be applied to any example application in the MCUXpresso SDK.
Select the workspace location
Every time MCUXpresso IDE launches, it prompts the user to select a workspace location. MCUXpresso IDE is built on top of Eclipse which uses workspace to store information about its current configuration, and in some use cases, source files for the projects are in the workspace. The location of the workspace can be anywhere, but it is recommended that the workspace be located outside the MCUXpresso SDK tree.
Build an example application
To build an example application, follow these steps.
Drag and drop the SDK zip file into the Installed SDKs view to install an SDK. In the window that appears, click OK and wait until the import has finished.
On the Quickstart Panel, click Import SDK example(s)….
Expand the
demo_apps
folder and selecthello_world
.Click Next.
Ensure Redlib: Use floating-point version of printf is selected if the example prints floating-point numbers on the terminalfor demo applications such as
adc_basic
,adc_burst
,adc_dma
, andadc_interrupt
. Otherwise, it is not necessary to select this option. Then, click Finish.
Run an example application
For more information on debug probe support in the MCUXpresso IDE, see community.nxp.com.
To download and run the application, perform the following steps:
Ensure the host driver for the debugger firmware has been installed. See On-board debugger.
Connect the development platform to your PC via a USB cable.
Open the terminal application on the PC, such as PuTTY or TeraTerm, and connect to the debug serial port number (to determine the COM port number, see How to determine COM port. Configure the terminal with these settings:
115200 or 9600 baud rate, depending on your board (reference
BOARD_DEBUG_UART_BAUDRATE
variable inboard.h
file)No parity
8 data bits
1 stop bit
On the Quickstart Panel, click Debug to launch the debug session.
The first time you debug a project, the Debug Emulator Selection dialog is displayed, showing all supported probes that are attached to your computer. Select the probe through which you want to debug and click OK. (For any future debug sessions, the stored probe selection is automatically used, unless the probe cannot be found.)
The application is downloaded to the target and automatically runs to
main()
.Start the application by clicking Resume.
The hello_world
application is now running and a banner is displayed on the terminal. If not, check your terminal settings and connections.
Build a multicore example application
This section describes the steps required to configure MCUXpresso IDE to build, run, and debug multicore example applications. The following steps can be applied to any multicore example application in the MCUXpresso SDK. Here, the dual-core version of hello_world example application targeted for the LPCXpresso54114 hardware platform is used as an example.
Multicore examples are imported into the workspace in a similar way as single core applications, explained in Build an example application. When the SDK zip package for LPCXpresso54114 is installed and available in the Installed SDKs view, click Import SDK example(s)… on the Quickstart Panel. In the window that appears, expand the LPCxx folder and select LPC54114J256. Then, select lpcxpresso54114 and click Next.
Expand the
multicore_examples/hello_world
folder and select cm4. Thecm0plus
counterpart project is automatically imported with thecm4
project, because the multicore examples are linked together and there is no need to select it explicitly. Click Finish.Now, two projects should be imported into the workspace. To start building the multicore application, highlight the
lpcxpresso54114_multicore_examples_hello_world_cm4
project (multicore master project) in the Project Explorer. Then choose the appropriate build target, Debug or Release, by clicking the downward facing arrow next to the hammer icon, as shown in the figure. For this example, select Debug.
The project starts building after the build target is selected. Because of the project reference settings in multicore projects, triggering the build of the primary core application (cm4
) also causes the referenced auxiliary core application (cm0plus
) to build.
Note: When the Release build is requested, it is necessary to change the build configuration of both the primary and auxiliary core application projects first. To do this, select both projects in the Project Explorer view and then right click which displays the context-sensitive menu. Select Build Configurations -> Set Active -> Release. This alternate navigation using the menu item is Project -> Build Configuration -> Set Active -> Release. After switching to the Release build configuration, the build of the multicore example can be started by triggering the primary core application (cm4
) build.
Run a multicore example application
The primary core debugger handles flashing of both the primary and the auxiliary core applications into the SoC flash memory. To download and run the multicore application, switch to the primary core application project and perform all steps as described in Run an example application. These steps are common for both single-core applications and the primary side of dual-core applications, ensuring both sides of the multicore application are properly loaded and started. However, there is one additional dialogue that is specific to multicore examples which requires selecting the target core. See the following figures as reference.
After clicking the “Resume All Debug sessions” button, the hello_world multicore application runs and a banner is displayed on the terminal. If this is not the case, check your terminal settings and connections.
An LED controlled by the auxiliary core starts flashing, indicating that the auxiliary core has been released from the reset and running correctly. It is also possible to debug both sides of the multicore application in parallel. After creating the debug session for the primary core, perform same steps also for the auxiliary core application. Highlight the lpcxpresso54114_multicore_examples_hello_world_cm0plus project (multicore slave project) in the Project Explorer. On the Quickstart Panel, click “Debug ‘lpcxpresso54114_multicore_examples_hello_world_cm0plus’ [Debug]” to launch the second debug session.
Now, the two debug sessions should be opened, and the debug controls can be used for both debug sessions depending on the debug session selection. Keep the primary core debug session selected by clicking the “Resume” button. The hello_world multicore application then starts running. The primary core application starts the auxiliary core application during runtime, and the auxiliary core application stops at the beginning of the main() function. The debug session of the auxiliary core application is highlighted. After clicking the “Resume” button, it is applied to the auxiliary core debug session. Therefore, the auxiliary core application continues its execution.
At this point, it is possible to suspend and resume individual cores independently. It is also possible to make synchronous suspension and resumption of both the cores. This is done either by selecting both opened debug sessions (multiple selections) and clicking the “Suspend” / “Resume” control button, or just using the “Suspend All Debug sessions” and the “Resume All Debug sessions” buttons.
Build a TrustZone example application
This section describes the steps required to configure MCUXpresso IDE to build, run, and debug TrustZone example applications. The TrustZone version of the hello_world
example application targeted for the MIMXRT595-EVK hardware platform is used as an example, though these steps can be applied to any TrustZone example application in the MCUXpresso SDK.
TrustZone examples are imported into the workspace in a similar way as single core applications. When the SDK zip package for MIMXRT595-EVK is installed and available in the Installed SDKs view, click Import SDK example(s)… on the Quickstart Panel. In the window that appears, expand the MIMXRT500 folder and select MIMXRT595S. Then, select evkmimxrt595 and click Next.
Expand the
trustzone_examples/
folder and selecthello_world_s
. Because TrustZone examples are linked together, the non-secure project is automatically imported with the secure project, and there is no need to select it explicitly. Then, click Finish.Now, two projects should be imported into the workspace. To start building the TrustZone application, highlight the
evkmimxrt595_hello_world_s
project (TrustZone master project) in the Project Explorer. Then, choose the appropriate build target, Debug or Release, by clicking the downward facing arrow next to the hammer icon, as shown in following figure. For this example, select the Debug target.The project starts building after the build target is selected. It is requested to build the application for the secure project first, because the non-secure project must know the secure project since CMSE library when running the linker. It is not possible to finish the non-secure project linker when the secure project since CMSE library is not ready.
Note: When the Release build is requested, it is necessary to change the build configuration of both the secure and non-secure application projects first. To do this, select both projects in the Project Explorer view by clicking to select the first project, then using shift-click or control-click to select the second project. Right click in the Project Explorer view to display the context-sensitive menu and select Build Configurations > Set Active >Release. This is also possible by using the menu item of Project > Build Configuration >Set Active >Release. After switching to the Release build configuration. Build the application for the secure project first.
Run a TrustZone example application
To download and run the application, perform all steps as described in Run an example application. These steps are common for single core, and TrustZone applications, ensuring <board_name>_hello_world_s
is selected for debugging.
In the Quickstart Panel, click Debug to launch the second debug session.
Now, the TrustZone sessions should be opened. Click Resume. The hello_world
TrustZone application then starts running, and the secure application starts the non-secure application during runtime.