Learning MicroEJ

I’m having a really hard time learning MicroEJ. Can anyone help me?
ThankYou

Hi @camelkuning ,

Let me help by pointing you in right direction.

First and foremost let’s start with the introduction shall we?

This overview introduces our core concepts, but mainly remember, we at MicroEJ are all about providing software to enable embedded devices. We do that through a Virtual Execution Environment (VEE). To develop application for and with that VEE, we use tools in our Software Development Toolkit. That’s it, we are at our core, a software solution provider for embedded devices based on Virtual Execution and Managed Code rather than native code. It brings portability, security and isolation to software applications.

Then I would check out the glossary, we use some terms and vocabulary that can be specific to our technology and taking a quick look can help you out.

After that, I would try for myself by using a Getting Started tutorial (e.g. the i.MX RT1170):

Don’t worry if you do not own a device yet. You can start any of the Getting Started pages on your computer right now. Every Getting Started page starts with an executed application on a Virtual Device! No hardware and no license needed!

And last but not least, what will you do with MicroEJ? what goal do you want to achieve? Here depending on the kind of application, you want to create, I will start exploring the libraries and APIs.

Hope it helps! And happy coding!

Gaëtan for MicroEJ

Thank you for your help. I only have three months left to finish my academic project, which involves creating an ‘Embedded GUI.’ Due to a limited budget for equipment, I checked MicroEJ’s official documentation and found that the Espressif ESP32 is the most affordable hardware option. I’ve already purchased an ESP32-S3 and a compatible display, so I really need to learn how to use MicroEJ.

To be honest, I haven’t fully grasped the MicroEJ architecture yet. For example, what exactly is a VeePort, and what is a BSP? I have successfully run my GUI on the MicroEJ simulator, but I don’t understand how to implement and flash it directly onto the physical device.

I previously built a project using a standard ESP32 with the Arduino IDE. I found the Arduino workflow very simple to understand: you assemble the components, write the logic, and flash it straight to the board. I am highly interested in MicroEJ, but I find its workflow and architecture difficult to comprehend compared to Arduino.

I would sincerely appreciate any guidance or simple explanations you can provide to help me bridge this gap. Thank you very much in advance.

No worry.

BSP: Board Support Package, a software collection (think of it as drivers) that supports and initializes the hardware (pins, clocks, startup, the whole shebang).

To not paraphrase the documentation, I would say MicroEJ Architectures are the software equivalent of a hardware architecture, so for each ARM Architecture and its assembler (a specific Instruction Set Architecture say Cortex-M4: the ARMv7E-M core with Thumb v1 and Thumb v2 ASM support), you have a corresponding MicroEJ Architecture except we also couple this support with an existing (and most of the time pre-configured) toolchain (so Index of /modules/com/microej/architecture/CM4/CM4hardfp_GCC48/flopi4G25/8.6.0 is the MicroEJ Architecture 8.6.0 for Cortex-M4 and GCC 4.8). The MicroEJ Architecture also includes the VEE (Virtual Execution Environment).

VEE Ports: They are ports of a MicroEJ Architecture onto a specific board. To continue the analogy, what the flopi4G25 MicroEJ Architecture is to a Cortex-M4 Hardware Architecture, a VEE Port is to a real device. We base ourselves on a MicroEJ Architecture to support the MCU and its architecture and add peripherals support to use an embedded device (whether it be a customer product PCB (Printed Circuit Board) or an evaluation kit from one of our partner).

In your case, taking the ESP32-S3 as an example:

MicroEJ Architecture: Index of /modules/com/microej/architecture/ESP32/GNUv112_xtensa-esp32s3/simikou7/7.20.1

VEE Port for ESP32-S3-DevKitC-1-N8R8 (based on the previously linked MicroEJ Architecture): GitHub - MicroEJ/VEEPort-Espressif-ESP32-S3-DevKitC-1-N8R8: VEE Port for Espressif ESP32-S3-DevKitC-1-N8R8 development board. · GitHub

The MicroEJ Architecture is based on the Xtensa ESP32 hardware architecture and a GNU toolchain (GCC, LD and the likes). The VEE Port for ESP32-S3-DevKitC-1-N8R8 is based on Espressif tools (ESP IDF including a GNU toolchain) and BSP.

MicroEJ SDK will use the VEE Port to build the Managed Code (for the ESP32 S3 VEE Port, Java is used) then we use the ESP IDF and tools to build the following into one executable/firmware:

  • Managed Code (Application + Libraries)
  • MicroEJ VEE
  • BSP + C code

The VEE Port will then reuse the tools provided by Espressif to flash the board.

The build and flash are respectively triggered by build.bat/sh and run.bat/sh.

Some context and notes:

  1. The BSP folder here: VEEPort-Espressif-ESP32-S3-DevKitC-1-N8R8/ESP32-S3-DevKitC1-Xtensa-FreeRTOS-bsp at master · MicroEJ/VEEPort-Espressif-ESP32-S3-DevKitC-1-N8R8 · GitHub is Espressif BSP + Espressif additional support + MicroEJ VEE Port support (called Abstraction Layers). It is not the pure BSP of Espressif for the ESP32-S3-DevKitC-1-N8R8.
  2. The VEE Port for ESP32-S3-DevKitC-1-N8R8 is still based on MicroEJ SDK 5. We have a newer suite of tools: MicroEJ SDK 6 which bases itself around other building components (most notably Gradle).
  3. Be sure to read and follow the README.rst at GitHub - MicroEJ/VEEPort-Espressif-ESP32-S3-DevKitC-1-N8R8: VEE Port for Espressif ESP32-S3-DevKitC-1-N8R8 development board. · GitHub . IF you have the right board (you did not specify the board you have, only the MCU (microcontroller)).
  4. Build flow for VEE Port from a MicroEJ Architecture (and right below the build flow for an Executable/Firmware): Overview — MicroEJ Documentation

Have a nice day!

Gaëtan for MicroEJ

Is there a complete YouTube tutorial video? Or is there anyone who offers a tutorial?

There is a tutorial video on this page:

And on Youtube:

But beware it is designed for the STM32F7508-DK device and using MicroEJ SDK 6.

The ESP32-S3 VEE Port I mentioned previously in our conversation is compatible with SDK 5. We do not have a SDK 5 focused video.

Have a nice day!
Gaëtan

I’ve already seen that. I mean, for example, if we’re talking about something other than MicroEJ—let’s say we’re talking about web development—there are a lot of people discussing it, so there’s a wealth of learning resources available, which means we also have plenty of options.

You’re actually closer than you think. The fact that your GUI already runs on the simulator means the hardest part of the application work is done. What’s left is the build-and-flash pipeline, which is admittedly where MicroEJ’s workflow diverges most from Arduino.

Here’s a quick description that might help you starting from your Arduino experience:

In Arduino: you write code > hit upload > it compiles and flashes. One tool, one step.

In MicroEJ: there are two “worlds” that get stitched together into one firmware:

  1. Your Java application (the GUI you already built) gets compiled into a .o file by the SOAR linker
  2. The BSP/VEE Port (C code, drivers, RTOS, hardware init), BTW this is what Arduino “hides” from you

The flash step means: take the output of (1), link it into the BSP project (2), compile the whole thing with the ESP-IDF toolchain, and flash the resulting binary to your board.

For your ESP32-S3 specifically, here’s what to focus on:

  1. Get the VEE Port building first, without your app. Clone the [ESP32-S3 VEE Port repo]( GitHub - MicroEJ/VEEPort-Espressif-ESP32-S3-DevKitC-1-N8R8: VEE Port for Espressif ESP32-S3-DevKitC-1-N8R8 development board. · GitHub ), follow its README to build and flash the demo. This validates that your toolchain (ESP-IDF), board connection, and flash workflow all work. Think of this as the LED blink/Hello World equivalent. I still do not know if you have a N8R8 DevKitC board, I assume so.
  2. Then swap in your application. Once the VEE Port builds and runs, you configure it to include your application’s .o output instead of the demo. The SDK 5 build process handles this via the application.out file dropped into the BSP.
  3. If native build errors come up, they’re probably ESP-IDF toolchain setup issues (wrong version, missing environment variables), not MicroEJ issues. The VEE Port README specifies the exact ESP-IDF version required, try to match it precisely.

You’re right that the community is smaller than web dev, that’s simply the reality of embedded development.

Given the simulator side is working maybe focus on getting the VEE Port demo running on your physical board (drop the GUI/screen support at first, you can connect it afterwards). Once that works, the path from simulator to hardware becomes easier.

Have a nice day!

Gaëtan

okkay, I saw in the MicroEJ documentation that there’s also an STM32F7508-DK, but when I checked on several marketplaces, it’s already out of stock, and the store offers an alternative: the STM32H7S78-DK. What do you think? Will it be compatible with MicroEJ, and will there be more configuration options? Because when I looked on YouTube, there’s also this: https://youtu.be/DxWzyWLE7dI?si=yASK8dUougzEAM98.
I’m hoping for a quick response from you.
Thank You Very Much

First the tutorial video while working is outdated and using MicroEJ SDK 5 (information from the documentation: SDK 5 User Guide — MicroEJ Documentation )

Then yes you are right the STM32F7508-DK evaluation appears to be discontinued. If you really really want to change hardware (the ESP32 board should be enough), may I suggest a Linux-based one?

We have a Linux abstraction layer available, up-to-date, here:

A VEE Port up-to-date with a full step-by-step tutorial (for the i.MX 93):

Or you can create a Linux VEE Port on an existing evaluation board (Raspberry Pi, Arduino Uno Q, Nvidia Jetson Nano, or the multitudes of other Linux-based hobbyist-focused evaluation board), you wouldn’t have to deal with the flashing steps (Linux-based embedded device come with pre-built binaries most of the time (Linux image and rootFS) that you have just copy on an SDCard), you would have all the Linux based tools, and exhaustive documentation outside of MicroEJ for common stuff.

Have a nice day!

Gaëtan

I’m planning to buy an STM hardware device that comes with a display, but I also need to make sure it’s compatible with MicroEJ. Do you have any suggestions? Of course, I’m working with a limited budget—the maximum is $233.00.

I’m not the biggest authority on what you should buy. I wouldn’t want to guarantee anything but I provided a getting started with a board under your budget (i.MX 93 FRDM + screen is under 200$ last I checked and the screen is a HDMI-compatible reusable screen).

Have a nice day!

Gaëtan