MCUXpresso SDK Documentation

multicore_manager#

Overview#

The Multicore Manager example application demonstrates advanced features of the MCMgr component.

In this demo, the primary core prints the “Hello World from the Primary Core!” string to the terminal and then releases the secondary core from the reset. The secondary core toggles an on-board LED indicating that the secondary core is running. It is also possible to stop/start the secondary core during the runtime by pressing on-board buttons. The on-board LED then indicates the change, it stops/starts toggling accordingly.

This application also shows how to use the Multicore Manager for remote core monitoring and handling of events such as application, CoreUp, CoreDown and exception events.

Application-specific callback functions for events are registered by the MCMGR_RegisterEvent() API on the primary core. Triggering these events is done using the MCMGR_TriggerEvent() API on the secondary core. While CoreUp, CoreDown events are triggered from startup and MCMGR code, the application event is triggered from the application.

The exception event is triggered in the secondary application after 100 LED toggles by trying to write to flash. This raises the exception on the secondary core and triggers the RemoteExceptionEvent on the primary core.

Building the application#

This shows example how to build application for evkmimxrt1180 board with cm33 core_id. Change the -b <board> parameter based on board you want to build. Change the -Dcore_id=<core_id> parameter based on board core you want to build. For these parameters please see attribute boards: in primary/example.yml.

west build --sysbuild examples/multicore_manager/hello_world/primary --toolchain armgcc --config debug -b evkmimxrt1180 -Dcore_id=cm33

Supported Boards#

MIMXRT1180-EVK
Hardware requirements
  • Mini/micro USB cable

  • MIMXRT1180-EVK board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the hello world multicore demo in the terminal window:

Hello World from the Primary Core!

Copy Secondary core image to address: 0x303C0000, size: 3280
Starting Secondary core.
The secondary core application has been started.

Press the SW8 button to toggle Secondary core Start/Stop.
When no action is taken the secondary core application crashes intentionally after 100 LED toggles (simulated exception), generating the RemoteExceptionEvent to this core.
Use the Stop and then the Start button to get it running again.

.
.
.

Secondary core cannot be stopped!

NOTE: #1: The MIMXRT1180-EVK board does not support stopping of secondary code. After pressing the button prints that secondary core cannot be stopped. Only way to start the secondary core again is POR.

NOTE: #2: The “Copy Secondary core image to address…” log message is not displayed on the terminal window when MCUXpresso IDE is used. In case of MCUXpresso IDE the secondary core image is copied to the target memory during startup automatically.

NOTE: #3: MIMXRT1180-EVK GPIO_AON_04 pin is shared between SW8 button and headphone HP_DET_B pin. Once a headphone is inserted into J101 Audio Jack connector the SW8 button functionality is affected. Please remove the headphone in this case.

MIMXRT1170-EVKB
Hardware requirements
  • Mini/micro USB cable

  • MIMXRT1170-EVKB board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the hello world multicore demo in the terminal window:

Hello World from the Primary Core!

Copy Secondary core image to address: 0x20200000, size: 3280
Starting Secondary core.
The secondary core application has been started.

Press the SW7 button to toggle Secondary core Start/Stop.
When no action is taken the secondary core application crashes intentionally after 100 LED toggles (simulated exception), generating the RemoteExceptionEvent to this core.
Use the Stop and then the Start button to get it running again.

.
.
.

Secondary core cannot be stopped!

Note: The “Copy Secondary core image to address…” log message is not displayed on the terminal window when MCUXpresso IDE is used. In case of MCUXpresso IDE the secondary core image is copied to the target memory during startup automatically.

Note: The MIMXRT1170-EVKB board does not support stopping of secondary code. After pressing the button prints that secondary core cannot be stopped. Only way to start the secondary core again is POR.

Note: To download and debug IAR EW project using J-Link (replacing the default CMSIS-DAP debug probe), following steps are needed:

  1. Remove J6 and J7 jumpers.

  2. Attach the J-Link probe (J-Link Plus / J-Trace) to the board using the J1 connector.

  3. Set “J-Link / J-Trace” in CM7 project options -> Debugger -> Setup panel (replacing CMSIS-DAP option).

  4. Unselect the “Use macro file(s)” in CM7 project options -> Debugger -> Setup panel.

  5. Enable “Use command line options” in CM7 project options -> Debugger -> Extra Options panel (–jlink_script_file=$PROJ_DIR$/../evkbmimxrt1170_connect_cm4_cm7side.jlinkscript command line option is applied).

  6. Click on “Download and Debug” button. During the loading process you can be asked by J-Link sw to select the proper device name (MIMXRT1176XXXA_M7 is unknown). Click O.K. and choose the MIMXRT1176xxxxA device.

  7. It is not possible to attach to the CM4 core when using the J-Link. Also, the multicore debugging does not work with that probe.

Note: To download and debug Keil MDK project using J-Link (replacing the default CMSIS-DAP debug probe), following steps are needed:

  1. Remove J6 and J7 jumpers.

  2. Attach the J-Link probe (J-Link Plus / J-Trace) to the board using the J1 connector.

  3. Set “J-LINK / J-TRACE Cortex” in CM7 project options -> Debug panel (replacing CMSIS-DAP Debugger option).

  4. After the CM7 application build click on Download/F8 button (menu Flash -> Download).

  5. Power off and power on the board.

  6. Multicore example starts running, one can start debugging the CM7 side by clicking on Start/Stop Debug Session (Ctrl + F5).

  7. It is not possible to attach to the CM4 core when using the J-Link.

MIMXRT1160-EVK
Hardware requirements
  • Mini/micro USB cable

  • MIMXRT1160-EVK board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the hello world multicore demo in the terminal window:

Hello World from the Primary Core!

Copy Secondary core image to address: 0x20200000, size: 3280
Starting Secondary core.
The secondary core application has been started.

Press the SW7 button to toggle Secondary core Start/Stop.
When no action is taken the secondary core application crashes intentionally after 100 LED toggles (simulated exception), generating the RemoteExceptionEvent to this core.
Use the Stop and then the Start button to get it running again.

.
.
.

Secondary core cannot be stopped!

Note: The “Copy Secondary core image to address…” log message is not displayed on the terminal window when MCUXpresso IDE is used. In case of MCUXpresso IDE the secondary core image is copied to the target memory during startup automatically.

Note: The MIMXRT1160-EVK board does not support stopping of secondary code. After pressing the button prints that secondary core cannot be stopped. Only way to start the secondary core again is POR.

Note: To download binary of cm7 core into qspiflash and boot from qspiflash directly, following steps are needed:

  1. Compile flash target of the project, and get the binaray file “hello_world.bin”.

  2. Set the SW1: 1 off 2 off 3 on 4 off, then power on the board and connect USB cable to J11.

  3. Drop the binaray into disk “RT1160-EVK” on PC.

  4. Wait for the disk disappear and appear again which will take couple of seconds.

  5. Reset the board by pressing SW3 or power off and on the board. (If default boot core is cm4, binary of cm4 could be downloaded and boot according to steps above.)

Note: To download and debug IAR EW project using J-Link (replacing the default CMSIS-DAP debug probe), following steps are needed:

  1. Remove J6 and J7 jumpers.

  2. Attach the J-Link probe (J-Link Plus / J-Trace) to the board using the J1 connector.

  3. Set “J-Link / J-Trace” in CM7 project options -> Debugger -> Setup panel (replacing CMSIS-DAP option).

  4. Unselect the “Use macro file(s)” in CM7 project options -> Debugger -> Setup panel.

  5. Enable “Use command line options” in CM7 project options -> Debugger -> Extra Options panel (–jlink_script_file=$PROJ_DIR$/../evkmimxrt1160_connect_cm4_cm7side.jlinkscript command line option is applied).

  6. Click on “Download and Debug” button. During the loading process you can be asked by J-Link sw to select the proper device name (MIMXRT1166XXXA_M7 is unknown). Click O.K. and choose the MIMXRT1166xxxxA device.

  7. It is not possible to attach to the CM4 core when using the J-Link. Also, the multicore debugging does not work with that probe.

Note: To download and debug Keil MDK project using J-Link (replacing the default CMSIS-DAP debug probe), following steps are needed:

  1. Remove J6 and J7 jumpers.

  2. Attach the J-Link probe (J-Link Plus / J-Trace) to the board using the J1 connector.

  3. Set “J-LINK / J-TRACE Cortex” in CM7 project options -> Debug panel (replacing CMSIS-DAP Debugger option).

  4. After the CM7 application build click on Download/F8 button (menu Flash -> Download).

  5. Power off and power on the board.

  6. Multicore example starts running, one can start debugging the CM7 side by clicking on Start/Stop Debug Session (Ctrl + F5).

  7. It is not possible to attach to the CM4 core when using the J-Link.

MIMXRT700-EVK
Hardware requirements
  • Mini/micro USB cable

  • MIMXRT700-EVK board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect the PC host and the board

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the hello world multicore demo in the terminal window:

Hello World from the Primary Core!

Starting Secondary core.
The secondary core application has been started.

Press the SW5 button to Stop Secondary core.
Press the SW7 button to Start Secondary core again.
When no action is taken the secondary core application crashes intentionally after 100 LED toggles (simulated exception), generating the RemoteExceptionEvent to this core.
Use the Stop and then the Start button to get it running again.

.
.
.

Secondary core cannot be stopped!

NOTE: #1: The MIMXRT700-EVK board does not support stopping of secondary code. After pressing the button prints that secondary core cannot be stopped. Only way to start the secondary core again is POR.

FRDM-K32L3A6
Hardware requirements
  • Mini/micro USB cable

  • FRDM-K32L3A6 board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect the PC host and the board

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the hello world multicore demo in the terminal window:

Hello World from the Primary Core!

Starting Secondary core.
The secondary core application has been started.

Press the SW1 button to Stop Secondary core.
Press the SW2 button to Start Secondary core again.
When no action is taken the secondary core application crashes intentionally after 100 LED toggles (simulated exception), generating the RemoteExceptionEvent to this core.
Use the Stop and then the Start button to get it running again.

.
.
.

FRDM-MCXN947
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXN947 board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo

Note: MCUXpresso IDE project default debug console is semihost

  1. Connect a type-c USB cable between the PC host and the MCU-Link USB port (J17) on the board

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the hello world multicore demo in the terminal window:

Hello World from the Primary Core!

Copy Secondary core image to address: 0x2004e000, size: 3280
Starting Secondary core.
The secondary core application has been started.

Press the SW3 button to Stop Secondary core.
Press the SW2 button to Start Secondary core again.
When no action is taken the secondary core application crashes intentionally after 100 LED toggles (simulated exception), generating the RemoteExceptionEvent to this core.
Use the Stop and then the Start button to get it running again.

.
.
.

Note: The “Copy Secondary core image to address…” log message is not displayed on the terminal window when MCUXpresso IDE is used. In case of MCUXpresso IDE the secondary core image is copied to the target memory during startup automatically.

FRDM-MCXN947T
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXN947T board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo

Note: MCUXpresso IDE project default debug console is semihost

  1. Connect a type-c USB cable between the PC host and the MCU-Link USB port (J17) on the board

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the hello world multicore demo in the terminal window:

Hello World from the Primary Core!

Copy Secondary core image to address: 0x2004e000, size: 3280
Starting Secondary core.
The secondary core application has been started.

Press the SW3 button to Stop Secondary core.
Press the SW2 button to Start Secondary core again.
When no action is taken the secondary core application crashes intentionally after 100 LED toggles (simulated exception), generating the RemoteExceptionEvent to this core.
Use the Stop and then the Start button to get it running again.

.
.
.

Note: The “Copy Secondary core image to address…” log message is not displayed on the terminal window when MCUXpresso IDE is used. In case of MCUXpresso IDE the secondary core image is copied to the target memory during startup automatically.

LPCXpresso55S69
Hardware requirements
  • Mini/micro USB cable

  • LPCXpresso55s69 board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo

Note: MCUXpresso IDE project default debug console is semihost

  1. Connect a micro USB cable between the PC host and the CMSIS DAP USB port (P6) on the board

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the hello world multicore demo in the terminal window:

Hello World from the Primary Core!

Copy Secondary core image to address: 0x20033000, size: 3280
Starting Secondary core.
The secondary core application has been started.

Press the SW3 button to Stop Secondary core.
Press the SW2 button to Start Secondary core again.
When no action is taken the secondary core application crashes intentionally after 100 LED toggles (simulated exception), generating the RemoteExceptionEvent to this core.
Use the Stop and then the Start button to get it running again.

.
.
.

Note: The “Copy Secondary core image to address…” log message is not displayed on the terminal window when MCUXpresso IDE is used. In case of MCUXpresso IDE the secondary core image is copied to the target memory during startup automatically.

MCX-N5XX-EVK
Hardware requirements
  • Mini/micro USB cable

  • MCX-N5XX-EVK board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo

Note: MCUXpresso IDE project default debug console is semihost

  1. Connect a micro USB cable between the PC host and the MCU-Link USB port (J5) on the board

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the hello world multicore demo in the terminal window:

Hello World from the Primary Core!

Copy Secondary core image to address: 0x2004e000, size: 3280
Starting Secondary core.
The secondary core application has been started.

Press the SW3 button to Stop Secondary core.
Press the SW4 button to Start Secondary core again.
When no action is taken the secondary core application crashes intentionally after 100 LED toggles (simulated exception), generating the RemoteExceptionEvent to this core.
Use the Stop and then the Start button to get it running again.

.
.
.

Note: The “Copy Secondary core image to address…” log message is not displayed on the terminal window when MCUXpresso IDE is used. In case of MCUXpresso IDE the secondary core image is copied to the target memory during startup automatically.

MCX-N9XX-EVK
Hardware requirements
  • Mini/micro USB cable

  • MCX-N9XX-EVK board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo

Note: MCUXpresso IDE project default debug console is semihost

  1. Connect a micro USB cable between the PC host and the MCU-Link USB port (J5) on the board

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the hello world multicore demo in the terminal window:

Hello World from the Primary Core!

Copy Secondary core image to address: 0x2004e000, size: 3280
Starting Secondary core.
The secondary core application has been started.

Press the SW3 button to Stop Secondary core.
Press the SW4 button to Start Secondary core again.
When no action is taken the secondary core application crashes intentionally after 100 LED toggles (simulated exception), generating the RemoteExceptionEvent to this core.
Use the Stop and then the Start button to get it running again.

.
.
.

Note: The “Copy Secondary core image to address…” log message is not displayed on the terminal window when MCUXpresso IDE is used. In case of MCUXpresso IDE the secondary core image is copied to the target memory during startup automatically.

FRDM-MCXL255
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXL255 board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the MCU-Link USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the hello world multicore demo in the terminal window:

Hello World from the Primary Core!

Copy Secondary core image to address: 0xa1000000, size: 4278
Starting Secondary core.
The secondary core application has been started.

Press the SW2 button to toggle Secondary core Start/Stop.
When no action is taken the secondary core application crashes intentionally after 100 LED toggles (simulated exception), generating the RemoteExceptionEvent to this core.
Use the Stop and then the Start button to get it running again.

.
.
.

Secondary core cannot be stopped!

Note: The “Copy Secondary core image to address…” log message is not displayed on the terminal window when MCUXpresso IDE is used. In case of MCUXpresso IDE the secondary core image is copied to the target memory during startup automatically.

Note: The FRDM-MCXL255 board does not support stopping of secondary code. After pressing the button prints that secondary core cannot be stopped. Only way to start the secondary core again is POR.

Note: As it is not possible to use any on-board LED from the cm0plus core the secondary core is running LED indication is not working in this example.

FRDM-IMXRT1186
Hardware requirements
  • Type-C USB cable

  • FRDM-IMXRT1186 board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the hello world multicore demo in the terminal window:

Hello World from the Primary Core!

Copy Secondary core image to address: 0x303C0000, size: 3280
Starting Secondary core.
The secondary core application has been started.

Press the SW8 button to toggle Secondary core Start/Stop.
When no action is taken the secondary core application crashes intentionally after 100 LED toggles (simulated exception), generating the RemoteExceptionEvent to this core.
Use the Stop and then the Start button to get it running again.

.
.
.

Secondary core cannot be stopped!

NOTE: #1: The FRDM-IMXRT1186 board does not support stopping of secondary code. After pressing the button prints that secondary core cannot be stopped. Only way to start the secondary core again is POR.

NOTE: #2: The “Copy Secondary core image to address…” log message is not displayed on the terminal window when MCUXpresso IDE is used. In case of MCUXpresso IDE the secondary core image is copied to the target memory during startup automatically.

NOTE: #3: FRDM-IMXRT1186 GPIO_AON_04 pin is shared between SW8 button and headphone HP_DET_B pin. Once a headphone is inserted into J101 Audio Jack connector the SW8 button functionality is affected. Please remove the headphone in this case.

FRDM-IMXRT700
Hardware requirements
  • Type-C USB cable

  • FRDM-IMXRT700 board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect the PC host and the board

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the hello world multicore demo in the terminal window:

Hello World from the Primary Core!

Starting Secondary core.
The secondary core application has been started.

Press the SW5 button to toggle Secondary core Start/Stop.
When no action is taken the secondary core application crashes intentionally after 100 LED toggles (simulated exception), generating the RemoteExceptionEvent to this core.
Use the Stop and then the Start button to get it running again.

.
.
.

Secondary core cannot be stopped!

NOTE: #1: The FRDM-IMXRT700 board does not support stopping of secondary code. After pressing the button prints that secondary core cannot be stopped. Only way to start the secondary core again is POR.

FRDM-MCXE32B
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXE32B board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a type-c USB cable between the host PC and the MCU-Link USB port (J13) on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the multicore manager demo in the terminal window:

Hello World from the Primary Core!

Starting Secondary core.
The secondary core application has been started.

Press the SW3 button to toggle Secondary core Start/Stop.
When no action is taken the secondary core application crashes intentionally after 100 LED toggles (simulated exception), generating the RemoteExceptionEvent to this core.
Use the Stop and then the Start button to get it running again.

Press the SW3 button (“User” on the board silkscreen) once to stop the secondary core and again to start it. On the FRDM-MCXE32B only a single user button is wired, so the same button toggles Stop/Start.


Note:
The secondary core (M7_1) image is embedded into the primary core (M7_0) image
and programmed to flash at address 0x00600000. The primary core releases the
secondary core through the MC_ME interface and the secondary core runs in place
directly from flash. No copy-to-RAM step is performed.