Skip to main content
Associate
January 13, 2025
Solved

TouchGFX code optimization - unused code?

  • January 13, 2025
  • 2 replies
  • 734 views

Originally a reply here (solved), but split to a separate thread as it is a new question.


Hello,

Is there any  way to disable the code which is auto generated by the Touch GFX  designer which is not used by the application. so I can reduce the space of the code 

Thanks 

Best answer by mƎALLEm

I don't think there is a portion of code that will be generated for TouchGFX and it will not be used by the application.

Assume TouchGFX designer generates a code that will not be used by the application it will be for sure discarded by the linker/compiler.

If you are looking to reduce the size of the code, use the compiler optimization or use an external Flash memory (if you have one) to extend the Flash memory size.

2 replies

Andrew Neil
Super User
January 13, 2025

Do you have reason to believe that TouchGFX  designer actually is generating code that is never used by the application?

Examples would help.

With suitable optimisation, the compiler should remove functions that are never called ?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
mƎALLEm
mƎALLEmBest answer
Technical Moderator
January 13, 2025

I don't think there is a portion of code that will be generated for TouchGFX and it will not be used by the application.

Assume TouchGFX designer generates a code that will not be used by the application it will be for sure discarded by the linker/compiler.

If you are looking to reduce the size of the code, use the compiler optimization or use an external Flash memory (if you have one) to extend the Flash memory size.

"To give better visibility on the answered topics, please click on ""Accept as Solution"" on the reply which solved your issue or answered your question."