What causes Data Corruption fault in TSS_Library?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

What causes Data Corruption fault in TSS_Library?

762 次查看
ViniciusHoff
Contributor II

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?

标签 (1)
0 项奖励
4 回复数

621 次查看
ViniciusHoff
Contributor II

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);

}

0 项奖励

621 次查看
BlackNight
NXP Employee
NXP Employee

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

0 项奖励

621 次查看
vicentegomez
NXP TechSupport
NXP TechSupport

Hi Hoff

Can you tell me how to reproduce your problem, or can you please send me your project?

Regards

Vicente

0 项奖励

621 次查看
ViniciusHoff
Contributor II

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.

0 项奖励