Get Started with Kernel

This Getting Started is a step-by-step guide explaining how to build a Multi-Sandbox Executable for the NXP i.MXRT1170 Evaluation Kit.

This Executable will be built from the Kernel GREEN sources.

The Multi-Sandbox Executable built in this Getting Started can then be used to complete the Get Started with Multi-Sandbox Applications Getting Started.

During this Getting Started, you will learn how to:

  • Get the Kernel GREEN,

  • Configure it,

  • Build the project and get the modules: Virtual Device, Executable, Javadoc, …

  • Run a Sandboxed Application project on this Multi-Sandbox Executable.

In case you are not familiar with MicroEJ, please visit Discover MicroEJ to understand the principles of our technology.

Prerequisites

Note

This Getting Started has been tested in the following conditions:

To get the most out of this training, participants should have:

Hardware setup

To follow this training, you need:

Environment Setup

To follow this Getting Started, you need to:

Install MICROEJ SDK 6

Follow MICROEJ SDK 6 installation Guide, IntelliJ is used on this Getting Started but feel free to use your favorite IDE,

Accept the MICROEJ SDK EULA

You may have to accept the SDK EULA if you haven’t already done it, please have a look at SDK EULA Acceptation.

Setup the NXP i.MXRT1170 EVKB

Follow this Environment Setup guide to get a development environment up and running for NXP i.MXRT1170 EVKB.

Additionally, make sure to:

  • Insert a micro-SD card (FAT32-formatted) in the board connector,

  • Connect the 1GB Ethernet connector to the internet.

Congratulations! You have finished the setup of your environment. You are now ready to discover how to build and flash the Kernel-GREEN.

Set up the Kernel GREEN on your IDE

Import the Project

Clone or download the Kernel GREEN sources,

The first step is to import the Kernel-GREEN into your IDE:

Note

If you are using an IDE other than IntelliJ, please have a look at Import a Project section.

  • If you are in the Welcome Screen, click on the Open button. Otherwise click either on File > Open…,

  • Select the Kernel-GREEN directory located where you downloaded it and click on the OK button.

The Gradle project should now be imported in IntelliJ, your workspace contains the following project in the Projects view:

Import demo application

Configure the Project

Select a VEE Port

As Applications need to depend on a VEE Port in order to be built, so does a Kernel project. Refer to the Prerequisites section of the Kernel GREEN README to learn more about the VEE Port requirements.

By default, the Kernel-GREEN project already uses the NXP i.MXRT1170 VEE Port 3.0.0.

Kernel Configuration

The configuration/common.properties file provides a default configuration for the Kernel (runtime heap size, maximum number of threads, images heap size, etc.).

This configuration will also impact Sandboxed Applications running on top of the Kernel (e.g. max number of threads per application).

Check the Kernel GREEN README for more information about the Kernel configuration.

Run the Kernel GREEN on NXP i.MXRT1170 Evaluation Kit

Make sure to have completed all the Environment Setup steps before going further.

Build the Executable for the NXP i.MXRT1170 Evaluation Kit

In order to build the Executable of the Kernel-GREEN, the SDK provides the buildExecutable Gradle task.

Note

If you are using an IDE other than IntelliJ, please have a look at Build an Executable section. Come back on this page if you need to activate an Evaluation License.

  • Double-click on the buildExecutable task in the Gradle tasks view.

  • The build stops with a failure.

  • Go to the top project in the console view and scroll up to get the following error message:

    Console Output License UID
  • Copy the UID. It will be required to activate your Evaluation license.

Request your Evaluation License:

  • Request your Evaluation license by following the Request your Activation Key instructions. You will be asked to fill the machine UID field with the UID you copied before.

  • When you have received your activation key by email, drop it in the license directory by following the Install the License Key instructions (drop the license key zip file to the ~/.microej/licenses/ directory).

Now your Evaluation license is installed, you can relaunch your Kernel build by double-clicking on the buildExecutable task in the Gradle tasks view. It may take some time.

The gradle task deploys the Kernel in the BSP and then builds the BSP using Make.

The Kernel-GREEN is built and ready to be flashed on a NXP i.MXRT1170 Evaluation Kit once the hardware setup is completed.

Flash the Kernel GREEN on the NXP i.MXRT1170 Evaluation Kit

In order to flash the Kernel-GREEN on the NXP i.MXRT1170 Evaluation Kit, the application provides the Gradle runOnDevice task.

Note

If you are using an IDE other than IntelliJ, please have a look at Run on Device section.

  • Double-click on the runOnDevice task in the Gradle tasks view. It may take some time:

    runOnDevice task

Once the Executable is flashed, you should see the Kernel-GREEN traces in your console:

Logs Output on Termite Serial Terminal
Well Done

Well Done!

Now you know how to build and run a Multi-Sandbox Executable!

If you want to learn how to run a Sandboxed Application on your Multi-Sandbox Executable, you can continue this Getting Started.

Run a Sandboxed Application on your Multi-Sandbox Executable and Virtual Device

Follow the Create and Run a Sandboxed Application Getting Started to create and run a Sandboxed Application project on your Multi-Sandbox Executable and Virtual Device.

Note

When it comes to selecting the Multi-Sandbox Executable and Virtual Device (section Run the Sandboxed Application on the Virtual Device), follow this procedure:

  • Open the settings.gradle.kts files located at the root of your MyApplication project,

  • Include the Kernel-GREEN project as a dependency of the MyApplication project,

    rootProject.name = "MyApplication"
    includeBuild("C:\\YOUR_PATH\\Kernel-GREEN")
    
  • Reload the Gradle project:

    Virtual Device
  • The Kernel-GREEN project should now appear in the Gradle tasks view:

    Kernel GREEN and MyApplication Gradle tasks
  • Open the build.gradle.kts file of the MyApplication project,

  • Add the dependency to the Kernel-GREEN project: microejVee("com.microej.kernel:GREEN:2.1.1")

    Note

    Make sure that the version corresponds to the version defined in your Kernel GREEN build.gradle.kts file.

  • Come back to the Run the Sandboxed Application on the Virtual Device Getting Started.

Going Further

You have now successfully executed a Sandboxed Application on an embedded device so what’s next?

If you are an application developer you can continue to explore MicroEJ’s APIs and functionalities by running and studying our samples at GitHub:

Foundation Libraries

Eclasspath

IoT

This project gathers all the basic examples of the foundation libraries.

This project gather all the examples of eclasspath.

This project gathers simple applications using net libraries.

https://github.com/MicroEJ/Example-Foundation-Libraries

https://github.com/MicroEJ/Example-Eclasspath

https://github.com/MicroEJ/Example-IOT

You can also learn how to build bigger and better applications by reading our Application Developer Guide.

If you are an embedded engineer you could look at our VEE port examples at GitHub. And to learn how create custom VEE ports you can read our VEE Porting Guide.

You can also follow the Kernel Developer Guide for more information on our multi-application framework or read about our powerful wearable solution called VEE Wear.

Last but not least you can choose to learn about specific topics by following one of our many Training Courses ranging from how to easily debug application to setting up a Continuous Integration process and a lot of things in between.