AnsweredAssumed Answered

Debug variables wrong

Question asked by Moffa.J_r_my on Jan 24, 2017
Latest reply on Jan 24, 2017 by Philipp Krause

Hello,

I'm facing a very embarrasing problem with variables in ST visual develop.

When I add a breakpoint just before a function call and I hover the parameter being sent with my mouse I can see it. But when I step into the function, the parameter became wrong : it has totally random values.

 

Also when the mcu has to do calculations, it can do it wrong.

 

This kind of calculation can be wrong :

result = (uint16_t)((sqrt((float)sum / measures_nb) / 1023.0 * 3.3 / 0.1) * 1000);

 

If I do this with another compiler, the result is correct.

 

I disabled all optimisations except +split because without this I get a .text overflow

 

If someone can help, I appreciate.

 

Thanks

Outcomes