Graphics Component  Version 5.26
MDK-Professional Middleware for Graphical User Interfaces
 All Files Pages
Execution Models

The Graphics component supports in principle three execution models (for more information please refer to User and Reference Guide - 15. Execution Model: Single Task/Multitask):

Single Task System (Superloop)

The entire program runs in one superloop. Normally, all software components are periodically called. Interrupts must be used for real time parts of the software since no real time kernel is used.

Multitask system: One Task Calling Graphics Functions

A CMSIS-RTOS is used, but only one task calls Graphics functions. From the Graphics component point of view, it is the same as being used in a single task system.

An user code template is available for this execution model (GUI_SingleThread.c). You can add it to a project by right-clicking on the Source Group and selecting Add New Item to Group. Under the Graphics component, you will find the emWin GUI Thread for Single-Tasking Execution Model.

In this file, a GUIThread is defined with a stack size of 2048 bytes. This value is based on the stack requirements as described in the User and Reference Guide - 35.2.2 Stack Requirements. As stated there, you can reduce this stack size by 200 bytes if no memory devices are used and an additional 600 bytes if the Window Manager is not used.

Please make sure that the total amount of stack is added to the value Total stack size [bytes] for threads with user-provided stack size in the RTX_Conf_CM.c file.

Multitask System: Multiple Tasks Calling Graphics Functions

A CMSIS-RTOS is used, and multiple tasks call Graphics functions. This works without a problem as long as the software is made thread-safe, which is done by enabling multitask support in the configuration and adapting the kernel interface routines. An user code template is available for this execution model (GUI_MultiThread.c). You can add it to a project by right-clicking on the Source Group and selecting Add New Item to Group. Under the Graphics component, you will find the emWin GUI Thread for Multi-Tasking Execution Model.

In this file, a GUIThread is defined with a stack size of 2048 bytes. This value is based on the stack requirements as described in the User and Reference Guide - 35.2.2 Stack Requirements. As stated there, you can reduce this stack size by 200 bytes if no memory devices are used and an additional 600 bytes if the Window Manager is not used. Additionally, two threads are defined with a stack size of 600 bytes that will call this GUIThread.

Please make sure that the sum of all stacks is added to the value Total stack size [bytes] for threads with user-provided stack size in the RTX_Conf_CM.c file.