Troubleshooting Guide

Last modified by Microchip on 2025/12/15 09:02

Introduction

Welcome to the Troubleshooting Guide. This page is designed to help you identify and resolve common issues that may arise while using and running Microchip Graphics Suite (MGS). Whether you’re experiencing performance issues, display errors, or unexpected behavior, this guide will assist you in diagnosing and fixing the problem to ensure a smooth user experience.

Run-time Issues

The topics below discuss potential problems you might encounter while running MGS applications and ways to debug them.

Enable Debug Asserts

To catch unexpected conditions and behavior in the library, debug asserts can be enabled by setting LE_ASSERT_ENABLE to 1 in legato_config.h. Debug asserts can catch errors like memory allocation errors, NULL pointers, etc.

Use the debugger to determine where the assert is happening.

Memory Allocation Errors

The MGS library uses its own memory pools for dynamic memory allocations. The size of the memory pools is pre-configured when the project is first created.

If memory allocation errors are observed (e.g., with debug asserts), it may be necessary to increase the size of the library's memory pools. Refer to the Optimizing the Memory Manager Settings page for information on how to debug memory pool allocation errors and optimize the pools sizes.

Touch-Related Issues

Touch is Not Working on Certain Widget Areas

If a touch-enabled widget, like a button, has children widgets, those children may get the touch events in the area where it overlaps with its parent. In the accompanying image, the button widget, btnParent, has a child image widget, imgLogo. If the user touches the imgLogo widget space, the touch event will not reach the btnParent widget. To make sure that imgLogo does not block the touch events, its Enabled property must not be set.

Disable child widget touch

Image Rendering Issues

Certain images may not draw correctly on the screen. This is especially true for some images using compressed formats like PNG and JPG. A quick way to check if the issue is image format-related is to store the images as RAW or RAW RLE and see if the issue still happens. If the issue doesn't occur, consider storing the affected images as RAW or RAW RLE. 

If PNG or JPG must be used, refer to the steps below to try and troubleshoot the issue.

PNG images require a lot of memory to decode. If PNG images don't render correctly, make sure that the project is configured correctly. Refer to the Managing Memory for PNG Decoding page.

JPG is a lossy image format, so expect to have some image quality degradation when storing images in your project as JPEGs. To keep the image quality high, configure the JPG image asset in the Image Asset Manager. Also, make sure that there is enough memory for the JPG decoder to run. To do so, refer to the Managing Memory for JPEG Decoding page.

Text Rendering Issues

Refer to the guide below for troubleshooting issues with text rendered on the screen. General information on how to use fonts and strings is available in the MGS Graphics Assets Guide.

Text and Labels Are Jagged and Not Smooth

If the edges of the text and labels are not smooth, like what's shown in the accompanying image, anti-aliased fonts must be used. 

Aliased Text Example

Aliased Text

To enable anti-aliasing, go to the Font Manager and select the font used for the string or text. 

Enable Anti-aliased Fonts

Also, make sure that Alpha Blending is enabled in Project Settings > Renderer.

Enable Alpha Blending

With anti-aliasing enabled, the text should look crisp and smooth on the edges.

Antialiasing Enabled

Anti-aliased Text

Back to Top

Display Corruption or Display Artifacts

To troubleshoot display artifacts, do the following:

Check Color Mode Settings

Make sure that the color mode settings for the project, layers, and display driver are configured correctly. Refer to the Setting the Project Color Mode page to make sure that the color mode configurations are correct.

Check for Insufficient Memory

If the library is unable to allocate memory, unexpected behavior may occur including corrupted frames or missing widgets. Enable Debug Asserts (LE_ASSERT_ENABLE) in legato_config.h to help catch allocation errors.

Hardware Related Issues

Display artifacts can also be caused by a wrong configuration of the display driver or display interface. Refer to the Microchip Graphics Suite (MGS) Development Kits page for information on how to configure the hardware and the display drivers.

Back to Top

Performance Issues

The rendering performance on the embedded device can vary based on the project's configuration and design. Certain settings or design decisions may lead to sub-optimal drawing efficiency. For information on how to configure the project for optimal performance, refer to the Optimizing for Performance page.

Visualizing Damage Areas

Slow performance may be due to large areas or unexpected areas in the screen that are being redrawn. To visualize the areas that were redrawn in the screen, set LE_DEBUG_BLIT_RECTS to 1 in legato_config.h. When this macro is set, the library will highlight the redrawn areas with a blue rectangle. Focus on optimizing the highlighted areas that are too big or not expected to be redrawn.

Visualizing Damage Areas

Back to Top

Forum Support

For other issues, please visit the Microchip Graphics Suite forum site. Post a topic in the forum to get support.

Back to Top