I am using the TSS_Library to implement some touch buttons. The project was working properly. However, sometimes occurs the fault interruption because of the data corruption fault.
This fault occurs without the program have changed anything in TSS_Library.
What can cause Data Corruption fault in TSS_Library?
I realized that the data corruption fault occurs always after that the program calls the sprintf() function.
The code is:
void print_msg(char *title, char *param)
{
char msg1[17];
sprintf(msg1, "%s %s", title param);
LCD_writeLine2(msg1);
}
Hi Vincius,
sprintf() needs a lot of stack/RAM, so I suspect there is a stack overflow. Try increasing the library heap size and increase the stack size in your application. Glad to hear that xsprintf() solved your problem :-), because this smaller variant uses much less stack/code.
Erich
Hi Hoff
Can you tell me how to reproduce your problem, or can you please send me your project?
Regards
Vicente
Hi Pedro
I can't send you the project, because I haven't permission of my company.
However, the problem occurs always after that the program calls the sprintf() function.
I solved the problem exchanging the sprintf() function for the XF1_xsprintf() function, provided byBlackNight, in the Processor Expert Components.
After I exchanged all sprintf() functions, this problem does not occurred more.