Skip to main content
RLarr.1
Associate III
October 19, 2022
Question

Reduce code size for bootloader

  • October 19, 2022
  • 3 replies
  • 1552 views

We currently have a bootloader we have been using in our products. However it was created with emWin and we are transitioning everything to TouchGFX. The current boot loader fits in code space of 0xC000 and includes a few text updates to the 480x272 TFT display during programming updates. Using TouchGFX with nothing more than a few text lines to the display puts the code size to about twice what I have available. If I removed TouchGFX resource from CubeMx I end up with code that is about 6k under the 0xC000 size.

Unless I am missing something I may have only three choices:

  1. Return to the emWin for the bootloader.
  2. Find a reduction in required resources for TouchGFX framwork
  3. Attempt to write directly to the framebuffer and set up the hardware manually removing the TouchGFX framework.

Any ideas or articles on reducing the footprint for TouchGFX would be greatly appreciated. It looks like I need something that fits into about 6k of code space.

Thanks

This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
October 19, 2022

>>Attempt to write directly to the framebuffer and set up the hardware manually removing the TouchGFX framework.

I see this as the least complicated approach.

Writing text from simple bitmap font tables, and painting same size bitmaps, in the scale of things, not hard stuff.

Some of the BSP examples do text, line and circle drawing without any extensive library code.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
RLarr.1
RLarr.1Author
Associate III
October 21, 2022

Thanks for the comment. It was indeed helpful. I now have what I needed using one of the BSP examples,

Piranha
Principal III
October 23, 2022

Tossing out the Newlib printf() functions with their dependencies will also save several KB of FLASH and almost 2 KB of RAM.