Get Started with MICROEJ VEE for STM32F7508-DK Discovery Kit

In this section, you will learn to:

build an existing VEE Port for the STM32F7508-DK Discovery kit,

run an application on the STM32F7508-DK Discovery kit Virtual Device,

run the same application on your STM32F7508-DK Discovery kit.

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

Please be aware that this Get Started guide is tailored to MICROEJ SDK 5. Please follow this link to access the new Get Started guide based on the newest SDK 6, for the latest features and enhancements.

Prerequisites

This Getting Started is separated in two main parts.

The first part consists of running a demo application on the Virtual Device. All you need is:

an Internet connection to access Github repositories & MicroEJ Central Repository.

MICROEJ SDK 23.07 installed (download below)

 

The second part consists of running the same demo application on your device. For that you will need:

a STM32F7508-DK Discovery kit,

a RS232 Terminal (e.g. Termite),

to choose for a C compilation toolchain: either STM32CubeIDE (GNU Compiler) or IAR Embedded Workbench for Arm. You will be guided on how to install toolchain later,

Git .

 

Setup SDK in an Empty Workspace

Start MICROEJ SDK.

Select an empty workspace.

If you launched the SDK for the first time and you are not familiar with Eclipse workspaces, select the default one and press OK.
If not, create an empty directory and select it as a workspace.

Select the MicroEJ repository where to import MicroEJ architectures from.

If you launched the SDK for the first time and you are not familiar with MicroEJ repositories, select the default one and press OK.
If not, create an empty directory and select it as a workspace.

Select Help > Check for Updates and install the latest SDK version by following the Update SDK Version instructions. You will be prompted to restart the SDK.

Close the Welcome page

You are now ready to import projects.

1 – Run an application on the Virtual Device

1.1 – Build a VEE Port for the STM32F7508-DK Discovery Kit

Download the VEE Port sources using the following command:

git clone --recursive -b 1.6.1 https://github.com/MicroEJ/VEEPort-STMicroelectronics-STM32F7508-DK.git
 
Import the projects in the SDK’s workspace:

Select File > Import > General > Existing Projects into Workspace.

Point Select root directory to where you cloned the sources.

Uncheck the Search for nested projects option if checked and select every project except the java-testsuite-runner-* projects.

Click on the Finish button.

 

Your first VEE Port is imported in your workspace and now you can build it.

Right click on stm32f7508-freertos-configuration.

Select Build Module.

The build starts. It may takes few minutes. Then the project STM32F7508-Platform-CM7hardfp_GCC48-1.6.1 is automatically refreshed and compiles without error.

 

Your first VEE Port is built and ready to use for simulation.

The project STM32F7508-Platform-CM7hardfp_IAR83-1.6.1 still indicates an error.
By default, the project is configured to build a VEE Port using STM32CUBE-IDE (GNU Compiler). This will be the one used for simulation.
In the second part of the Getting Started, we will give you the possibility to switch the configuration to use IAR Embedded Workbench for Arm instead.

1.2 – Launch your First Application on the Virtual Device

Download the Widget Demo sources using the following command:

git clone -b 7.5.1 https://github.com/MicroEJ/Demo-Widget.git

If you don’t have Git installed, you can download the source code directly from our GitHub repository. Then you can click on Code > Download ZIP.

 

Import the projects in the SDK:

Select File > Import > General > Existing Projects into Workspace.

Point Select root directory to where you cloned the sources.

Click on the Finish button.

The application project com.microej.demo.widget is imported in your workspace. After dependencies resolution it should compile without errors.

 

At this stage, your SDK’s workspace contains:

a VEE Port for STM32F7508-DK Discovery kit,

the Widget Demo application.

 

You are now ready to launch your first application on the Virtual Device:

Go to Run > Run Configurations... > MicroEJ Application,

Select DemoWidget (SIM) launcher,

Click on the Run button.

You may need to allow the JDK to access the network through a UAC prompt.

 

The Virtual Device starts and executes the Widget Demo application.

Well done !

Now you know how to run an application on a Virtual Device.

If you want to learn how to integrate the VEE Port in the BSP and run an application on your STM32F7508-DK Discovery kit, you can continue this Getting Started: Launch Widget Demo on your STM32F7508-DK Discovery kit.

Otherwise, look at other examples and resources about MicroEJ technology in MicroEJ Insights section.

2 – Run an application on your STM32F7508-DK Discovery Kit

2.1 – Setup your BSP

This chapter takes approximately one hour and will take you through the steps to set up and build the BSP.
To complete this section, you may request a 30 days Evaluation License and install an activation key.

 

Before deploying the application on your board, you must check that your BSP is correctly set up.
To do so, the VEE Port comes with a precompiled application.

 

By default the STM32F7508-DK Discovery kit’s VEE Port is built for the GNU toolchain. If you want to switch to IAR toolchain, follow the Platform Setup part of the documentation.

 

Download your C compilation toolchain by following the BSP Setup instructions.

Install your C compilation toolchain by following the STM32CubeIDE Setup or the IAR Embedded Workbench Setup instructions.

Setup environment variables in the BSP of the VEE Port. If you are using the GNU toolchain, edit the file set_project_env.bat located in stm32f7508_freertos-bsp/project/microej/scripts/SW4STM32 folder:

• Set ECLIPSE_CDT_INSTALLATION_DIR. It is the path of the Eclipse CDT installation directory (e.g. C:\ST\STM32CubeIDE_1.9.0\STM32CubeIDE).

• Add GNU_TOOLS_FOR_STM32_DIR. It is the path for arm-none-eabi-objcopy.exe (e.g. %ECLIPSE_CDT_INSTALLATION_DIR%\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.0.202111181127\tools\bin).

• Add CUBEPROGRAMMER_DIR. It is the path for STM32_Programmer_CLI.exe (e.g. %ECLIPSE_CDT_INSTALLATION_DIR%\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.0.200.202202231230\tools\bin).

 

If you are using the IAR toolchain, setup environment variables by following the IAR toolchain instructions.

If you are using the IAR toolchain, the folder will be EWARM instead of SW4STM32 for the rest of the Getting Started.

 

Open a terminal, execute RunAtFirstBSPCompile.bat script located in stm32f7508_freertos-bsp/project/microej/scripts directory. Wait for the script to finish.

Open a terminal, execute build.bat script located in stm32f7508_freertos-bsp/project/microej/SW4STM32 directory. Wait for the build script to finish (it may take a few minutes).

Connect the USB connector of the board to your computer with a mini-USB cable by following the Board Configuration instructions.

Open your device manager to get the COM port where your board is connected.

Set up a serial terminal (e.g. Termite) to see output logs from the board. Set it with the COM port retrieved previously and a baudrate of 115200.

Open a terminal, execute run.bat script located in stm32f7508_freertos-bsp/project/microej/SW4STM32 directory.

When flashed, the precompiled application prints Hello World ! in the logs output.

 

Congratulations, you setup your BSP and are now ready to discover how to build and flash a MicroEJ application.

2.2 – Build your First Application for the STM32F7508-DK Discovery Kit

Back to the SDK:

Go to Run > Run Configurations... > MicroEJ Application.

Select DemoWidget (EMB) launcher.

Click on the Run button.

The run stops with the following message:

[INFO ] Launching in Evaluation mode. Your UID is XXXXXXXXXXXXXXXX.
[ERROR] Invalid license check (No license found).
FAIL
Java returned: -1

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 you just 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.

 

Now your SDK license is installed, you can launch your application build again.

Go to Run > Run Configurations... > MicroEJ Application.

Select DemoWidget (EMB) launcher.

Click on the Run button.

 

If you are using the GNU toolchain, the application will be deployed in the folder stm32f7508_freertos-bsp\projects\microej\SW4STM32.

2.3 – Build the BSP and Run the Application

Open a terminal and go to stm32f7508_freertos-bsp\projects\microej\SW4STM32 folder.

Execute build.bat script to build the BSP.

The Firmware has been build and is ready to be flashed on the hardware.

Execute run.bat script to flash the board.

Once the Firmware has been flashed, you should see the Widget Demo running on your board.

 

MicroEJ Insights

Thank you for following this Getting Started.

To discover insights about MicroEJ technology, please follow some of the entry points below. You will find useful links to our documentation and our GitHub. You will also discover important feature of the MicroEJ technology.

Get familiar with MicroEJ:

At this point, you can try to run other examples on your VEE Port. Here is an exhaustive list of them so that you can go further in the MicroEJ technology:

Understand How to Build a Firmware: it is a document which describes the components, their dependencies and the process involved in the build of a Firmware.

Get Started With GUI: it is a guided tutorial to get the basics concepts of our UI.

Create your First Native Method: it is a tutorial which describes how to add a native call to your Java application. See more...

• Before making this tutorial, take a look at our documentation to understand the Simple Native Interface (SNI).

• This tutorial has been made for another VEE Port but can be done with STM32F7508-DK Development kit. Below you will find the parts that are different with your VEE Port.

• To add the native LED C implementation to the BSP in the third party C IDE, copy Leds.c file in stm32f7508_freertos-bsp\projects\microej\hal\src directory.

How to use Networking libraries: it is an example of how to use MQTT with MicroEJ. See more...

• For this example, you can use this MQTT Web socket Client. You can keep the default configuration. Keep the host name in mind.

• Connect your board to the Internet with an ethernet cable.

• Replace test.mosquitto.org by your host name in the variable BROKER of the HelloWorldConstants.java file.

NEXT STEP

Develop an App Using a Ready-to-Use MicroEJ Firmware

Go further with MicroEJ by experimenting with our ready-to-use multi-sandbox firmware for the STM32F7508-DK. Create, test and execute a widget demo easily on a virtual device or real development board, without worrying about low-level software or hardware porting.

Go To Tutorial

MICROEJ INSIGHTS

MICROEJ Documentation

Now you can take a look at our MICROEJ development documentation and read parts useful to the growth of your software solution.
Below you can find some important chapters:

  • Application Developer Guide: It covers concepts essential to MicroEJ Applications design.
  • MICROEJ VEE Port Developer Guide: It covers the main process and configuration of a MicroEJ VEE.
  • Tutorials: There are multiple tutorials to master different subjects about the MicroEJ environment (including UI development, code quality and debug, CI/CD…).

MICROEJ INSIGHTS

GitHub Resources

On our GitHub, there are some examples, MicroEJ VEE Port sources or documentation about embedded challenges. Here are some examples:

MICROEJ INSIGHTS

Important Features

Here is a list of different features about MicroEJ that could be interesting to you:

Embedded Graphical User Interface and Internet Connectivity on Embedded Systems

Need Help?

Go to our Forum

If you have any issue, you can go to our forum and look if there is already a topic about this issue. If not, ask us the question and our experts will be happy to answer.

Go To Forum

MicroEJ Developer Forum

Need Help?

Get Support

How can we help you? Our technical support team is here to help if you have any issue or technical question about MicroEJ. Send your technical support request by email and we’ll connect you to one of our experts.

Contact Us