Build and run the ezhv_examples

This section describes the steps required to configure the environment to build, run, and debug ezhv example applications. The <install_dir>/boards/<board_name>/ezhv_examples/led_blinky is used as an example.

For each example, generally there are two folders, one for the cm33_core0 core and the other for the EZHV core. For the led_blinky example, they are:

<install_dir>/boards/<board_name>/ezhv_examples/led_blinky/cm33_core0

<install_dir>/boards/<board_name>/ezhv_examples/led_blinky/ezhv

Build the application for the auxiliary core (ezhv) first, because the primary core application project (cm33_core0) must know the auxiliary core application binary when running the linker. When the auxiliary core application binary is not ready, it is impossible to finish the primary core linker. This section focuses on the auxiliary core (ezhv). For details about building the primary core for different toolchain, see the corresponding chapter.

Set the toolchain for EZHV

To set the toolchain for EZHV, perform the following steps:

  1. Download and install the RISCV LLVM toolchain.

  2. Add a system environment variable RISCVLLVM_DIR, and set the value to the RISCV LLVM install path.

    • For Linux or Mac, run the command:

      export RISCVLLVM_DIR=<your_risc_llvm_install_path>
      
    • For Windows, as shown in Set the toolchain for EZHV, perform the following steps:

      1. Click Windows Start -> Settings.

      2. Search and open Edit environment variable for your account

      3. Create a new variable.

  3. Download Ninja from this link. Add the path ninja executable to system environmental variable PATH. When it finishes, run the ninja – version in command line to verify the installation. The result looks like:

    $ ninja --version
    1.10.1
    
  4. Download and install CMake.

Parent topic:Build and run the ezhv_examples

Build the EZHV project

To build the EZHV project, go to the project folder <install_dir>/boards/<board_name>/ezhv_examples/<example>/ezhv/riscvllvm.

  • For Windows, click the build_debug.bat.

  • For Linux or Mac, run the build_debug.sh in the command line.

When the build finishes, a binary ezhv_image.bin is generated in the folder <install_dir>/boards/<board_name>/ezhv_examples/<example>/ezhv/binary.

Parent topic:Build and run the ezhv_examples

Run the project

There are two ways to run the project: Run with primary core, or run independently.

  • Run with primary core.

    After EZHV binary ezhv_image.bin is created, follow the primary core project guide to build the primary core project and run.

  • Debug the EZHV independently.

    Currently SEGGER Ozone can be used to run and debug the EZHV executable.

    1. An external J-Link plus is needed, connect JP18 1-2 on the mimxrt700evk board to use external debugger and connect external J-Link to J18.

    2. Download and install the J-Link.

    3. Download and install the SEGGER Ozone.

    4. Open Ozone and create project, click File -> New -> New Project Wizard.

    5. Select the device MIMXRT798S_EZHV.

    6. Select the built EZHV executable.

    7. On the Ozone window, click the button to run.

Parent topic:Build and run the ezhv_examples