What causes Data Corruption fault in TSS_Library?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

What causes Data Corruption fault in TSS_Library?

1,176 Views
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?

Labels (1)
0 Kudos
Reply
4 Replies

1,035 Views
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 Kudos
Reply

1,035 Views
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 Kudos
Reply

1,035 Views
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 Kudos
Reply

1,035 Views
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 Kudos
Reply