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

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.

 

 

0 REPLIES 0