sprintf function is changing the first declared uint16 variable

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Dear all,

   

I have a quite interesting bug (?) in my projects..

   

It seems like the sprintf function is changing the first declared uint16 in its value, even it isn't used in the function at all!
Also when using the debugger, some variables couldn't be changed, during the next instruction the value is changed.

   

Does anyone of you know this behavior or even has a solution for it?
Thanks a lot in advance,
best regards,
Thomas

0 Likes
5 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Are you talking about Designer or Creator? And which version?

   

Bob

0 Likes
Anonymous
Not applicable

I am using Creator 1, right now I can't use the Creator 2 because I don't have the 24MHz Crystal for the CY8CKIT-050 yet.

0 Likes
Anonymous
Not applicable

Hi Thomas,

   

 

   

Can you please tell more about what you are trying to do and how you are using sprintf() function.

   

It will be easier to narrow down on the actual problem if you will attach the project.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I think we ought to know which compiler you use, 'cause the libraries are different.

   

There is another issue with sprintf, which seemingly is not able to handle floats in PSoC5, it only returns "0.0000" regardless of the given value.

   

Bob

0 Likes
Anonymous
Not applicable

How about upload your project so people here can help. If you can re-create the same problem using of the the development kits would even better so people could duplicate the problem.

0 Likes