Skip to main content
Associate II
October 9, 2025
Solved

When using ARM V6 compiler.The touchGFX program cannot run automatically.Reasons and Solutions.

  • October 9, 2025
  • 1 reply
  • 172 views

Post edited by ST moderator to be inline with the community rules especially with the code sharing. In next time please use </> button to paste your code. Please read this post: How to insert source code

 

Everything works fine when using the GNU compiler.

However, when using the ARM V6 compiler,The touchGFX program cannot automatically run.

The reason is that the printf statement  was used in the touchgfx library.

In ARM V6 C++ Standard Library, The printf IO is redefined to breakpoint instruction.

So the program cannot run automatically when using  touchgfx library in KEIL.

Solutions:

Retargeting printf()

/* Defining __FILE_INCOMPLETE as 1 allows compilation of __FILE with
* a strict ANSI C standard without conflict with stdio.h.
*/
#define __FILE_INCOMPLETE 1
#include <stdio.h>

struct __FILE
{
int handle;
/* Whatever you require here. If the only file you are using is */
/* standard output using printf() for debugging, no file handling */
/* is required. */
};
int fputc(int ch, FILE *f)
{
/* Your implementation of fputc(). */
return ch;
}
int ferror(FILE *f)
{
/* Your implementation of ferror(). */
return 0;
}

There are other bugs in TouchGFX for KEIL.

The analog clocks do not display pointers, etc.

 

 

Best answer by Osman SOYKURT

Hello @magicmatrix ,

Thank you for sharing your solution, this is appreciated :)

1 reply

Osman SOYKURT
Osman SOYKURTBest answer
Technical Moderator
October 22, 2025

Hello @magicmatrix ,

Thank you for sharing your solution, this is appreciated :)

Osman SOYKURTST Software Developer | TouchGFX