Run a demo using Keil® MDK/μVision

This section describes the steps required to build, run, and debug example applications provided in the MCUXpresso SDK.

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 MIMXRT116x CMSIS pack.

  1. Download the MIMXRT1165 and MIMXRT1166 packs.

  2. After downloading the DFP, double click to install it. Be patient when the DFP is installed. It will take approximate 15 minutes for the installation to complete.

Parent topic:Run a demo using Keil® MDK/μVision

Build an example application

  1. Open the desired example application workspace in:

    <install_dir>/boards/<board_name>/<example_type>/<application_name>/mdk

    The workspace file is named as <demo_name>.uvmpw. For this specific example, the actual path is:

    <install_dir>/boards/evkmimxrt1160/demo_apps/hello_world/cm7/mdk/hello_world_demo_cm7.uvmpw

  2. To build the demo project, select Rebuild, highlighted in red.

  3. The build completes without errors.

Parent topic:Run a demo using Keil® MDK/μVision

Run an example application

To download and run the application, perform these steps:

  1. This board supports the CMSIS-DAP/mbed/DAPLink debug probe by default. Visit MBED serial-configuration and follow the instructions to install the Windows® operating system serial driver. If running on Linux OS, this step is not required.

  2. Connect the development platform to your PC via USB cable.

  3. 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:

    1. 115200 or 9600 baud rate, depending on your board (reference BOARD_DEBUG_UART_BAUDRATEvariable in the board.hfile)

    2. No parity

    3. 8 data bits

    4. 1 stop bit

  4. To debug the application, click load or press the F8 key for flexspi target which need to download the program to flash memory. Then, click the Start/Stop Debug Sessionbutton, highlighted in red in Figure 2. If using J-Linkas the debugger, click Project option>Debug>Settings>Debug >Port, and select SW.

    Note: If debugging with JLINK, device selection window will be popped when you click the Settings button under the Debug tab. Users need to choose MIMXRT1165/MIMXRT1166 device manually.

    Note:

    When using jlink in MDK for cm4 projects, it expects one jlinkscript file named JLinkSettings.JLinkScript in the folder where the uVision project files are located. Please refer to Segger Wiki for more information.

    For the contents in this JlinkSettings.JLinkScript, use contents in evkmimxrt1160_connect_cm4_cm4side.jlinkscript (non-sdram targets) and evkmimxrt1160_connect_cm4_cm4side_sdram.jlinkscript (sdram targets).

  5. Run the code by clicking Run to start the application, as shown in Figure 3.

    The hello_world application is now running and a banner is displayed on the terminal, as shown in Figure 4. If this is not true, check your terminal settings and connections.

Parent topic:Run a demo using Keil® MDK/μVision

Build a multicore example application

This section describes the particular steps that need to be done in order to build and run a dual-core application. The demo applications workspace files are located in this folder:

<install_dir>/boards/evkmimxrt1160/multicore_examples/<application_name>/<core_type>/mdk

Begin with a simple dual-core version of the Hello World application. The multicore Hello World MDK workspaces are located in this folder:

<install_dir>/boards/evkmimxrt1160/multicore_examples/hello_world/cm4/mdk/hello_world_cm4.uvmpw

<install_dir>/boards//evkmimxrt1160/multicore_examples/hello_world/cm7/mdk/hello_world_cm7.uvmpw

Build both applications separately by clicking the Rebuild button. Build the application for the auxiliary core (cm4) first, because the primary core application project (cm7) needs to know the auxiliary core application binary when running the linker. It is not possible to finish the primary core linker when the auxiliary core application binary is not ready.

Because the auxiliary core runs always from RAM, debug and release RAM targets are present in the project only. When building the primary core project, it is possible to select flexspi_nor_debug/flexspi_nor_release Flash targets. When choosing Flash targets the auxiliary core binary is linked with the primary core image and stored in the external SPI Flash memory. During the primary core execution the auxiliary core image is copied from flash into the CM4 RAM and executed.

Parent topic:Run a demo using Keil® MDK/μVision

Run a multicore example application

The primary core debugger flashes 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 steps 1 – 5 as described in Run an example application. These steps are common for both single-core and dual-core applications in μVision.

Both the primary and the auxiliary image is loaded into the flash memory. After clicking Run, the primary core application is executed. During the primary core code execution, the auxiliary core code is re-allocated from the SPI flash memory to the RAM, and the auxiliary core is released from the reset. The hello_world multicore application is now running and a banner is displayed on the terminal. If this is not true, 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 is running correctly.

Attach the running application of the auxiliary core by opening the auxiliary core project in the second μVision instance and clicking the Start/Stop Debug Session button. After this, the second debug session is opened and the auxiliary core application can be debugged.

Parent topic:Run a demo using Keil® MDK/μVision