2. Getting Started

The wearable application has been pre-compiled for the MicroEJ simulator and the MIMXRT595-EVK device. The following chapters explain how to run a pre-compiled application on the simulator and MIMXRT595-EVK, the application flow, and how to recompile the wearable application to modify it.

2.1. Virtual Player

2.1.1. Execute Application

The virtual player is an executable that launches the wearable application on the MicroEJ simulator. Open folder [root]/gettingStarted/player and double-click on launcher-windows.bat to start the virtual player.

Note

java version 8 (https://www.java.com/fr/download/) must be installed on your computer before launching the player.

../_images/player_launch.png ../_images/player_bat.png ../_images/player.png

Use your mouse on the virtual display to simulate the hardware touch panel. Refer to the chapter Application Flow to navigate in the application.

Once the application is started, the date and time are updated from an NTP server.

2.1.2. Troubleshooting

  • The following error may appear when the Virtual Player is running another version of Java:
...\player\s3Standalone.microejLaunch:56: The following error occurred while executing this line:
...\player\platform\scripts\extension-init.xml:33: Unable to create javax script engine for javascript

Update the environment path to use java 8 by default.

  • The date and time update from an NTP server is not available over a VPN network.

2.2. Embedded Device

2.2.1. Deploy Main Application

The wearable application has been compiled to run on a MIMXRT595-EVK device. Deploy [root]/gettingStarted/board/blhost/application.bin file (see next chapters) and reset the board. Refer to the Application Flow chapter to navigate in the application (see Application Flow).

The following technique is using the application MCUBOOT (MCU Bootloader for NXP microcontrollers) to flash the board:

  1. Unplug the board.
  2. Ensure JP18 and JP19 are closed.
  3. Change DIP switches (SW7) to ON, OFF, ON (ISP0, ISP1, ISP2).
  4. Plug a USB cable on J38.
../_images/dlhost.jpg
  1. Open package folder [root]/gettingStarted/board/blhost.
  2. This folder already contains the compiled application; launch rt500_download_image.bat.
  3. Unplug the board.
  4. Change DIP switches (SW7) to OFF, OFF, ON (ISP0, ISP1, ISP2).
  5. Plug a USB cable on J40; the application starts.

2.2.2. Deploy Additional Watchface

Some additional watchfaces can be deployed during the execution of the main application. A simple watchface is available near the main application binary file: [root]/gettingStarted/board/blhost/simple_watchface.fo. This watchface has been compiled to be compatible with the main application and is ready to be sent through the Debug Console Serial Port.

  1. Ensure a USB cable is plugged on J40 (not J38).
  2. Install HTerm software http://der-hammer.info/pages/terminal.html.
  3. Open HTerm.
  4. Press the R button to refresh the COM ports list.
  5. Select the correct COM port and configure it: Baud 115200, Data 8, Stop 1, Parity None, Newline at LF.
  6. Click on Connect.
  7. Reset the board: some traces appear in the HTerm console.
  8. Click on Send file and select the feature file [root]/gettingStarted/board/blhost/simple_watchface.fo.
  9. Start deployment by clicking on Start.
../_images/Hterm_send_file.png

As soon as the transfer starts, a message with the number of bytes transferred appears in the console log. The end of the transfer is automatically detected when no more bytes are transmitted. The new watchface starts immediately.

Transferred bytes: 1024
Transferred bytes: 2048
[...]
Transferred bytes: 449536
Transferred bytes: 449990
Transfer is over
Application available. Loading application.
Waiting for an application to be available
[WF Registry] Adding SimpleWatchface
[WF Registry] Stopping FlowerWatchface
[WF Registry] Starting SimpleWatchface

Note

The new watchface is deployed in RAM. A board reset removes the watchface.

2.2.3. Troubleshooting

  • In some situations (i.e., in the watchface carousel or a low-power watchface is running), the system can be asleep in DeepSleep mode (see Power Management). In that case, the bytes transmitted to the COM serial port are skipped. Select a watchface or an application that is always active and restart additional watchface deployment.

  • If a WF200 board is connected to MIMXRT595-EVK board, the application tries to connect to a WiFi Access Point to request the current time and date to an NTP server (Refer to Network section).

    This Access Point’s credentials are hardcoded in the application, and a WiFi Access Point with the correct name must exist. Otherwise, this feature will not be available.

    The section Wifi Default Access Point explains how to create this Access Point.

2.3. Application Flow

On startup, the application displays the Flower Watchface.

The user can do the following actions:

  • A long touchscreen press to enter the watchface carousel.
  • A user button press (SW1 or SW2 located on the top of the board) to enter the application list.

The watchface carousel lets the user select one of the three watchfaces available. To change the watchface, the user shall use the touchscreen to swipe to the left or to the right and then press shortly to enter the desired watchface.

The application list lets the user select one of the available applications. To change the application, the user shall use the touchscreen to swipe to the top or to the bottom and then press shortly to enter the desired application.

The user can come back to the application list from any application by pressing any user button (SW1 or SW2).

When entering the clocks application, the last selected watchface is displayed.

../_images/flowChart.png

2.4. Update Application

The application has to be compiled against the MicroEJ platform made for MIMXRT595-EVK. This platform implements specific libraries, uses concepts and tools described in the following chapters. To update, build and deploy the application, a setup is first mandatory. Refer to the chapter Setup to install required elements. Then refer to the chapter Build the Demo to build the application again.