Overview
========
The Multicore Hello World demo application demonstrates how to set up projects for individual
cores on a multicore system. 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.

Toolchain supported
===================
- IAR embedded Workbench  8.50.9
- Keil MDK  5.33
- GCC ARM Embedded  9.3.1
- MCUXpresso  11.3.0

Hardware requirements
=====================
- Mini/micro USB cable
- MIMXRT1170-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: 0x20340000, size: 19976
Starting Secondary core.
The secondary core application has been started.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:
This version of the hello world multicore example is intended to be used with i.MXRT1170 device that is configured in a way that Cortex-M4 boots first.
Once the Cortex-M4 core is booted and running it starts the Cortex-M7 core from the application code.
The boot order is controlled via the BT_CORE_SEL fuse that needs to be changed before loading this example code. Following steps need to be done. Keep in mind
that this operation is not reversible, i.e. once switching to Cortex-M4 entry it is not possible to change it back to Cortex-M7 entry.
1. Download the NXP-MCUBootUtility from https://github.com/JayHeng/NXP-MCUBootUtility .
2. Set the board SW1 switch: 1-off, 2-off, 3-off, 4-on .
3. Power the board and connect the USB cable between the host PC and the J20 port.
4. Run NXP-MCUBootUtility (<your location>\NXP-MCUBootUtility-2.3.0\bin\NXP-MCUBootUtility.exe).
5. In running NXP-MCUBootUtility, select the i.MXRT117x device and the USB-HID as a port for communication.
6. Connect to the device.
7. Switch to "eFuse Operation Utility" panel and click on Scan button to read the actual fuse state.
8. Set the BT_CORE_SEL bit (0x960[12]) by changing the value in the text box next to the @0x960 address (actual value AND 0x1000) and click on Burn button.
 
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. Click on "Download and Debug" button.
5. It is not possible to attach to the CM7 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 CM4 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 CM4 side by clicking on Start/Stop Debug Session (Ctrl + F5). 
7. It is not possible to attach to the CM7 core when using the J-Link.
