8. Setup

Before compiling the application on the MicroEJ platform, several steps are required to set up the environment. These steps must be done only once. After that, follow the chapter Build the Demo to compile and deploy the application on the simulator and / or the embedded device.

8.1. MicroEJ SDK

The application has been designed to run on a dedicated MicroEJ platform. This platform provides specific foundation libraries implementations. It must be first built before being able to launch the application against it. The build requires the installation of MicroEJ SDK. Read the documentation on https://www.microej.com/product/sdk/ and https://developer.microej.com/get-started/ to download MicroEJ SDK (just install MicroEJ SDK, do not follow the whole getting started).

After the installation step, start MicroEJ SDK on a new workspace.

8.2. Artifacts Repository

As mentioned in the chapter Libraries, the MicroEJ Central Repository is not sufficient to build the platform and run the application. A dedicated repository has been built, and the MicroEJ SDK workspace must be configured to use it.

The repository is available in the package. It is already usable (no need to unzip anything).

  1. Go to the unzipped package folder : [root]/artifactsRepository.
  2. Copy the full path of the file ivysettings.xml available in this folder.
  3. Open MicroEJ SDK.
  4. Open menu Window > Preferences.
  5. Go to the item MicroEJ > Module Manager.
  6. In the text box Module Repository Settings File, paste the ivysettings.xml full path.
  7. Click on Apply and Close.
../_images/ivy_settings.png

Your workspace now knows the repository. It can be used to build the platform and compile the application.

Note

The repository is a partial repository (see Additional Repository): it requires an internet connection to target the MicroEJ Central Repository (https://developer.microej.com/central-repository/).

8.3. Platform Projects

This step consists of importing some projects to build the MicroEJ platform designed for MIMXRT595-EVK. The platform projects are available in the package in a zip file. MicroEJ SDK allows importing a set of projects from an archive.

  1. Go to the unzipped package folder : [root]/platform/.
  2. Copy the full path of the file mimxrt595_freertos-platform.zip available in this folder.
  3. Open MicroEJ SDK.
  4. Open menu File > Import....
  5. Go to the item General > Existing Projects into Workspace.
  6. Click on Next >.
  7. Select the radio button Select archive file.
  8. Paste the mimxrt595_freertos-platform.zip full path and press Enter (or browse to select it from the file system).
  9. Ensure four projects are checked.
  10. Click on Finish.

The four projects are required to build the platform:

  • mimxrt595_freertos-configuration: It is the leading platform configuration project. It contains a file that describes the platform features. For several features, one or several additional files are required. It also contains script files to build the platform.
  • mimxrt595_freertos-fp: It is the simulator part of the platform. It describes how to represent the board (photo) and simulate it (touch panel, display, etc.).
  • mimxrt595_freertos-imageGenerator: The GCNanoLiteV specifies some bitmap image characteristics. This project is a plugin of the MicroEJ Image Generator tool, which allows describing these characteristics.
  • MIMXRT595-Platform-CM4hardfp_IAR83-x.y.z: This project will contain the platform source files after the platform build step. It is an empty project for the moment.
../_images/platform_projects.png

Note

Platform project throws an error (a red cross is visible on the project icon on the left). This is not an issue: the platform is not built yet, and MicroEJ Workbench considers the platform invalid. Don’t care about these errors/warnings and go to the next step.

8.4. Platform Build

For the moment, no platform is available in your workspace. The empty project MIMXRT595-Platform-CM4hardfp_IAR83-x.y.z does not yet represent a valid platform.

  1. Open menu Window > Preferences.
  2. Go to the item MicroEJ > Platforms in workspace.
  3. The list is empty: there is no platform yet.
  4. Click on Apply and Close.
  5. Click on mimxrt595_freertos-configuration project to select it.
  6. Click on the blue button available in the toolbar; it is called Build Selected Module.
../_images/blue_button.png

Platform building starts. You can see the build steps in the console. At the end of the build, the project MIMXRT595-Platform-CM4hardfp_IAR83-x.y.z contains two folders: build and source:

../_images/platform_project.png

Note

If the project remains empty, right-click on it and select Refresh.

You can retrieve the new platform in the Platforms in workspace menu:

  1. Open menu Window > Preferences.
  2. Go to the item MicroEJ > Platforms in workspace.
../_images/wip.png

Note

The red cross means the platform requires a license to be used.

The platform is now built. It can be used to build the application.

8.5. Application Project

Like the platform, the application project is available in a zip in the package.

  1. Go to the unzipped package folder : [root]/application/.
  2. Copy the full path of the file application-src.zip available in this folder.
  3. Open MicroEJ SDK.
  4. Open menu File > Import....
  5. Go to the item General > Existing Projects into Workspace.
  6. Click on Next >.
  7. Select the radio button Select archive file.
  8. Paste the application-src.zip full path and press Enter (or browse to select it from the file system).
  9. Ensure that all seven projects are checked.
  10. Click on Finish.

The application project is now available in your workspace. MicroEJ workbench automatically resolves its dependencies using the partial repository and the MicroEJ Central Repository. In a second time, Eclipse launches its automatic build workspace.

See next chapter to launch the application on the platform.