sema42_uboot#
Overview#
The sema42 uboot example shows how to use SEMA42 driver to lock and unlock a sema gate. This example should work together with uboot. This example runs on Cortex-M core, the uboot runs on the Cortex-A core.
Supported Boards#
EVK9-MIMX8ULP
Hardware requirements
Micro USB cable
MIMX8ULP-EVK/EVK9 board
J-Link Debug Probe
5V power supply
Personal Computer
Board settings
No special settings are required.
Please note this application can’t support running with Linux BSP!
Prepare the Demo
Connect 5V power supply and J-Link Debug Probe to the board, switch SW10 to power on the board.
Connect a micro USB cable between the host PC and the J17 USB port on the target board.
Open two serial terminals (one for Cortex-A35 core, the other for Cortex-M33 core) 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 example
Make sure board boot in single boot mode, and A35 run into U-Boot console
Running the demo
The log below in the Cortex-M terminal window shows the commands to use in uboot:
**************************************************************
* Please make sure the uboot is started now. *
* Use the following commands in U-Boot(A35) console for SEMA42 gate access *
* - md.b 0x28037003 1 : Get SEMA42 gate status. *
* - 0 - Unlocked; *
* - 8 - Locked by Cortex-A35; *
* - 7 - Locked by Cortex-M33; *
* - mw.b 0x28037003 8 1 : Lock the SEMA42 gate. *
* - mw.b 0x28037003 0 1 : Unlock the SEMA42 gate. *
**************************************************************
Press anykey to start the example...
Follow the example output instructions:
Now the SEMA42 gate is unlocked, checking status in uboot returns 0.
Press anykey to lock the SEMA42 gate...
Now the SEMA42 gate is locked, checking status in uboot returns 3.
Lock or unlock the SEMA42 gate in uboot, the status does not change.
Press anykey to unlock the SEMA42 gate...
Now the SEMA42 gate is unlocked, checking status in uboot returns 0.
Lock the SEMA42 gate in uboot, after locked, then press anykey...
Cortex-A has locked the SEMA42 gate in uboot, Cortex-M could not lock.
Press anykey to reset the SEMA42 gate...
Now the SEMA42 gate is unlocked, checking status in uboot returns 0.
Press anykey to finish the example...
SEMA42 uboot example successed.
EVK-MCIMX7ULP
Hardware requirements
Micro USB cable
MCIMX7ULP-EVK board
5V power supply
Personal Computer
SD card
Board settings
No special settings are required.
Please note this application can’t support running with Linux BSP!
Prepare the Demo
This should be run together with uboot.
Build the project and generate the .bin file.
Copy the .bin file to <sdk_dir>/tools/imgutil/evkmcimx7ulp folder and rename to sdk20-app.bin.
In the folder <sdk_dir>/tools/imgutil/evkmcimx7ulp, run “mkimage.sh ram or mkimage.sh flash” (see readme in the <sdk_dir>/tools/imgutil )to create bootable image.
Prepare an SD card with the prebuilt U-Boot image and copy the sdk20-app.img generated into the SD card. Then, insert the SD card to the target board. Make sure to use the default boot SD slot and check the dip switch configuration
Open a serial terminal with the following settings to connect to Cortex-A:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Connect 5V power supply to the board, switch SW1 to power on the board.
Hit any key to stop autoboot in the terminals, then enter to U-Boot command line mode. Then write the image and run it from QSPI Flash with the following commands:
sf probe
sf erase 0x0 0x20000
fatload mmc 0:1 0x62000000 sdk20-app.img
sf write 0x62000000 0x0 0x20000
Open a serial terminal with the following settings to connect to Cortex-M:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Switch the SW1 to re-power the board.
Hit any key to stop uboot autoboot in the Cortex-A terminals.
Running the demo
The log below in the Cortex-M terminal window shows the commands to use in uboot:
**************************************************************
* Please make sure the uboot is started now. *
* Use the following commands in uboot for SEMA42 gate access *
* - md.b 0x4101b003 1 : Get SEMA42 gate status. *
* - 0 - Unlocked; *
* - 2 - Locked by Cortex-A; *
* - 3 - Locked by Cortex-M; *
* - mw.b 0x4101b003 2 1 : Lock the SEMA42 gate. *
* - mw.b 0x4101b003 0 1 : Unlock the SEMA42 gate. *
**************************************************************
Press anykey to start the example...
Follow the example output instructions:
Now the SEMA42 gate is unlocked, checking status in uboot returns 0.
Press anykey to lock the SEMA42 gate...
Now the SEMA42 gate is locked, checking status in uboot returns 3.
Lock or unlock the SEMA42 gate in uboot, the status does not change.
Press anykey to unlock the SEMA42 gate...
Now the SEMA42 gate is unlocked, checking status in uboot returns 0.
Lock the SEMA42 gate in uboot, after locked, then press anykey...
Cortex-A has locked the SEMA42 gate in uboot, Cortex-M could not lock.
Press anykey to reset the SEMA42 gate...
Now the SEMA42 gate is unlocked, checking status in uboot returns 0.
Press anykey to finish the example...
SEMA42 uboot example successed.
EVK-MIMX8ULP
Hardware requirements
Micro USB cable
MIMX8ULP-EVK/EVK9 board
J-Link Debug Probe
5V power supply
Personal Computer
Board settings
No special settings are required.
Please note this application can’t support running with Linux BSP!
Prepare the Demo
Connect 5V power supply and J-Link Debug Probe to the board, switch SW10 to power on the board.
Connect a micro USB cable between the host PC and the J17 USB port on the target board.
Open two serial terminals (one for Cortex-A35 core, the other for Cortex-M33 core) 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 example
Make sure board boot in single boot mode, and A35 run into U-Boot console
Running the demo
The log below in the Cortex-M terminal window shows the commands to use in uboot:
**************************************************************
* Please make sure the uboot is started now. *
* Use the following commands in U-Boot(A35) console for SEMA42 gate access *
* - md.b 0x28037003 1 : Get SEMA42 gate status. *
* - 0 - Unlocked; *
* - 8 - Locked by Cortex-A35; *
* - 7 - Locked by Cortex-M33; *
* - mw.b 0x28037003 8 1 : Lock the SEMA42 gate. *
* - mw.b 0x28037003 0 1 : Unlock the SEMA42 gate. *
**************************************************************
Press anykey to start the example...
Follow the example output instructions:
Now the SEMA42 gate is unlocked, checking status in uboot returns 0.
Press anykey to lock the SEMA42 gate...
Now the SEMA42 gate is locked, checking status in uboot returns 3.
Lock or unlock the SEMA42 gate in uboot, the status does not change.
Press anykey to unlock the SEMA42 gate...
Now the SEMA42 gate is unlocked, checking status in uboot returns 0.
Lock the SEMA42 gate in uboot, after locked, then press anykey...
Cortex-A has locked the SEMA42 gate in uboot, Cortex-M could not lock.
Press anykey to reset the SEMA42 gate...
Now the SEMA42 gate is unlocked, checking status in uboot returns 0.
Press anykey to finish the example...
SEMA42 uboot example successed.