sema42_dualcore#
Overview#
The sema42 example shows how to use SEMA42 driver to lock and unlock a sema gate:
In this example:
Firstly, Core 0 turn on LED and lock a sema gate then boot up Core 1 wake up.
Core 1 must be wait until Core 0 unlocks this sema gate to lock it.
After user press any key in terminal window, the sema gate will be unlocked by core 0, then core 1 will lock it and turn off the LED
If the board does not have LED to show the status, then core 1 will send a flag to core 0 when core 1 has locked the sema gate. Core 0 outputs the success log after it received the flag.
Supported Boards#
MIMXRT1180-EVK
Hardware requirements
Mini/micro USB cable
MIMXRT1180-EVK board
Personal Computer
Board settings
This example project does not call for any special hardware configurations. Although not required, the recommendation is to leave the development board’s jumper settings and configurations in default state when running this example.
Prepare the demo
Connect a USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Build core1 project first, then build core0 project.
Download the core0 program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the demo runs successfully, Green LED will turn on, follow the instruction in the terminal log, press anykey, the Green LED will turn off.
FRDM-K32L3A6
Hardware requirements
Mini/micro USB cable
FRDM-K32L3A6 board
Personal Computer
Board settings
This example project does not call for any special hardware configurations. Although not required, the recommendation is to leave the development board’s jumper settings and configurations in default state when running this example.
Prepare the demo
Connect a USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Build core1 project first, then build core0 project.
Download the core0 program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the demo runs successfully, the log would be seen on the OpenSDA terminal like below and Red LED will turn on.
Sema42 example!
Press any key to unlock semaphore and Core 1 will turn off the LED
When press any key in the terminal, the LED will be turned off and the terminal tells
Now the LED should be turned off
Sema42 example succeed!
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
Connect a type-c USB cable between the PC host and the MCU-Link USB port (J17) on the board
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
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the demo runs successfully, the log would be seen on the OpenSDA terminal like below and Red LED will turn on.
Sema42 example!
Press any key to unlock semaphore and Core 1 will turn off the LED
When press any key in the terminal, the LED will be turned off and the terminal tells
Now the LED should be turned off
Sema42 example succeed!
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
Connect a type-c USB cable between the PC host and the MCU-Link USB port (J17) on the board
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
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the demo runs successfully, the log would be seen on the OpenSDA terminal like below and Red LED will turn on.
Sema42 example!
Press any key to unlock semaphore and Core 1 will turn off the LED
When press any key in the terminal, the LED will be turned off and the terminal tells
Now the LED should be turned off
Sema42 example succeed!
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
Connect a micro USB cable between the PC host and the MCU-Link USB port (J5) on the board
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
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the demo runs successfully, the log would be seen on the OpenSDA terminal like below and Red LED will turn on.
Sema42 example!
Press any key to unlock semaphore and Core 1 will turn off the LED
When press any key in the terminal, the LED will be turned off and the terminal tells
Now the LED should be turned off
Sema42 example succeed!
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
Connect a micro USB cable between the PC host and the MCU-Link USB port (J5) on the board
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
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the demo runs successfully, the log would be seen on the OpenSDA terminal like below and Red LED will turn on.
Sema42 example!
Press any key to unlock semaphore and Core 1 will turn off the LED
When press any key in the terminal, the LED will be turned off and the terminal tells
Now the LED should be turned off
Sema42 example succeed!
MIMXRT700-EVK
Hardware requirements
Micro USB cable
MIMXRT700-EVK board
Personal Computer
Board settings
This example project does not call for any special hardware configurations. Although not required, the recommendation is to leave the development board’s jumper settings and configurations in default state when running this example.
Prepare the demo
Connect a USB cable between the PC host and the MCU-LINK USB port on the board.
Open a serial terminal on PC for MCU-LINK serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Build core1 project first, then build core0 project.
Download the core0 program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the demo runs successfully, the log would be seen on the MCU-LINK terminal like below and Red LED will turn on.
Sema42 example!
Press any key to unlock semaphore and Core 1 will turn off the LED
When press any key in the terminal, the LED will be turned off and the terminal tells
Now the LED should be turned off
Sema42 example succeed!
FRDM-IMXRT700
Hardware requirements
Type-C USB cable
FRDM-IMXRT700 board
Personal Computer
Board settings
This example project does not call for any special hardware configurations. Although not required, the recommendation is to leave the development board’s jumper settings and configurations in default state when running this example.
Prepare the demo
Connect a USB cable between the PC host and the MCU-LINK USB port on the board.
Open a serial terminal on PC for MCU-LINK serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Build core1 project first, then build core0 project.
Download the core0 program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the demo runs successfully, the log would be seen on the MCU-LINK terminal like below and Red LED will turn on.
Sema42 example!
Press any key to unlock semaphore and Core 1 will turn off the LED
When press any key in the terminal, the LED will be turned off and the terminal tells
Now the LED should be turned off
Sema42 example succeed!
FRDM-IMXRT1186
Hardware requirements
Type-C USB cable
FRDM-IMXRT1186 board
Personal Computer
Board settings
This example project does not call for any special hardware configurations. Although not required, the recommendation is to leave the development board’s jumper settings and configurations in default state when running this example.
Prepare the demo
Connect a USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Build core1 project first, then build core0 project.
Download the core0 program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the demo runs successfully, Green LED will turn on, follow the instruction in the terminal log, press anykey, the Green LED will turn off.
MCX-W72-EVK
Hardware requirements
Type-C USB cable
MCX-W72-EVK Board
Personal Computer
Board settings
Prepare the Demo
Connect a USB cable between the host PC and the EVK board J14.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the demo runs successfully, the log would be seen on the terminal like below.
Sema42 example!
Press any key to unlock semaphore and Core 1 will lock it
When press any key in the terminal, the terminal tells
Wait for core 1 lock the semaphore
Sema42 example succeed!
MCXW72-LOC
Hardware requirements
Type-C USB cable
MCXW72-LOC Board
Personal Computer
Board settings
Prepare the Demo
Connect a USB cable between the host PC and the LOC board J3.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the demo runs successfully, the log would be seen on the terminal like below.
Sema42 example!
Press any key to unlock semaphore and Core 1 will lock it
When press any key in the terminal, the terminal tells
Wait for core 1 lock the semaphore
Sema42 example succeed!
KW47-EVK
Hardware requirements
Type-C USB cable
KW47-EVK Board
Personal Computer
Board settings
Prepare the Demo
Connect a USB cable between the host PC and the EVK board J14.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the demo runs successfully, the log would be seen on the terminal like below.
Sema42 example!
Press any key to unlock semaphore and Core 1 will lock it
When press any key in the terminal, the terminal tells
Wait for core 1 lock the semaphore
Sema42 example succeed!
KW47-LOC
Hardware requirements
Type-C USB cable
KW47-LOC Board
Personal Computer
Board settings
Prepare the Demo
Connect a USB cable between the host PC and the LOC board J3.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the demo runs successfully, the log would be seen on the terminal like below.
Sema42 example!
Press any key to unlock semaphore and Core 1 will lock it
When press any key in the terminal, the terminal tells
Wait for core 1 lock the semaphore
Sema42 example succeed!
FRDM-MCXW72
Hardware requirements
Type-C USB cable
FRDM-MCXW72 Board
Personal Computer
Board settings
Prepare the Demo
Connect a USB cable between the host PC and the FRDM board J10.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the demo runs successfully, the log would be seen on the terminal like below.
Sema42 example!
Press any key to unlock semaphore and Core 1 will lock it
When press any key in the terminal, the terminal tells
Wait for core 1 lock the semaphore
Sema42 example succeed!