cancel
Showing results for 
Search instead for 
Did you mean: 

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

magicmatrix
Associate II

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.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Osman SOYKURT
ST Employee

Hello @magicmatrix ,

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

Osman SOYKURT
ST Software Developer | TouchGFX

View solution in original post

1 REPLY 1
Osman SOYKURT
ST Employee

Hello @magicmatrix ,

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

Osman SOYKURT
ST Software Developer | TouchGFX