Please enable JavaScript to view this site.

Waijung 2 User Guide

How this block appears in a Simulink model?


What can be configured?


Configuration Parameter

Selectable Option/Value



Not configurable

By default: ESP-IDF

Operating system

Not configurable

By default: FreeRTOS

Simulink manages build system


This parameter is not configurable. By default, it is Checked

Project path


The folder in which the build files will be generated. If Simulink manages build system is Checked, the build files will be generated in the same directory as the model file.

Project version


The project version consists of a prefix (first text box) with a maximum of 16 characters and a suffix (second text box) of maximum 15 characters. For the suffix only numbers are allowed.

Import external source files to the Waijung2 build folder



Folder path to src files (.c, .cpp)

Browse for the relevant files using browse button


Folder path to header file (.h)

Browse for the relevant files using browse button


Build Options

Generate code--Deploy to hardware--External mode simulation--Processor-in-the-loop (PIL) simulation


Generate code - When the build button is pressed, the C code will be generated.

Deploy to hardware - When the build button is pressed, the C code will be generated, compiled, and uploaded to the target microcontroller board.

External mode simulation - Run the Simulink model in External mode in ESP32. Go to External mode in ESP32 for more details

Processor-in-the-loop (PIL) simulation - Run the Simulink model in PIL in ESP32. Go to Processor-in-the-loop simulation in ESP32 for more details

Default xTaskCreate_stack depth


Enter the stack size of the tasks that will be created by Waijung 2 depending on the number of unique sample times specified in the model file.

Base task priority


This parameter is not configurable. By default, it is set at 0

Highest (maximum) priority


This value can be found in FreeRTOSConfig.h file

ESP32 Family


Select the ESP32 family. More details can be found here.

ESP32 Flash Size


Select the flash memory size of the ESP32 board in use.

COM Port

All available COM ports will be displayed

Select the COM port of the ESP32 device.

Flash baudrate



Start serial monitor on CMD after build


Enable or disable opening the serial monitor on CMD to monitor the serial messages from ESP32. This will only available when build options is set to Deploy to hardware

Monitor baudrate


Baudrate to monitor the serial data

Advanced configuration


Check to modify the default partition table

Edit partition table


Able to manipulate the partition settings

Remove partition


used to remove partition

Add partition


used to add partition

When to use this block?

It is mandatory to use this block in every model file created using Waijung 2 block set for the ESP32 target.

This block can be used to set up the Simulink code generation environment for the ESP32 target. All generated source files will be copied to the Project path directory which is the directory where the current Simulink model file is created.


Copyright 2024 Aimagin Co.,Ltd. Rev.1650