Using the Microchip Graphics Suite (MGS) Simulator in Native Mode

Last modified by Microchip on 2026/04/13 10:30

Introduction

Native mode allows the Graphical User Interface (GUI) application developed with Microchip Graphics Suite (MGS) to be converted into a CMake® project within Microsoft® VS Code®, enabling it to be built and executed directly on a PC.

By leveraging VS Code, developers can use native mode simulation for source-level debugging and development, making it easier to test, troubleshoot, and refine their GUI applications without needing embedded hardware.

This approach streamlines the development workflow, providing a familiar environment for code editing, debugging, and iterative improvement.

Prerequisites

Before you begin, you must be able to generate an MGS Simulator project in VS Code. If not, please refer to the Using the MGS Simulator for VS Code guide.

Using the Native Mode

Exporting to a VS Code® Workspace

Click the Expand button button on the MGS Simulator tab and select Export (Native). The PROJECT DETAILS should show Native.

Export to Native Mode


Click the Export (Export button) button to export the MGS application to a VS Code workspace. When prompted for the Export Directory, navigate to your preferred location and click Select Folder.

Select Export Directory

The MGS Simulator will export the MGS application to a VS Code workspace in the selected location and will automatically launch another VS Code window using the Native Mode workspace.

VS Code Native Mode Workspace

Note: If you are prompted to install any extension(s) when the project is launched in VS Code for the first time, select Install.

C/C++ Extension pack

C/C++ Extension Pack (For GDB debug)

CodeLLDB Extension

CodeLLDB (For LLDB debug)

Running the Native Mode Simulator Project

To build and run the project, click Run and Debug Run and Debug button and click the Start Debugging Start Debugging button button.

Start Debugging

The VS Code terminal will show the progress of the build. If the build is successful, the GUI will launch in a separate window.

Simulator Output

Debugging the Native Mode Simulator Project

Since the Native Mode Simulator project is running in VS Code, the debugging features of VS Code are available for developers. 

Debugging features of VS Code

Important: Note that the Native Mode simulator workspace in VS Code is a copy of the MGS project. Thus, any changes made to the source files in the Native Mode simulator workspace will not be applied to the original MGS project. These changes must be copied to the original MGS project. Otherwise, these changes will be lost if the Native Mode simulator is exported again.

Back to Top