cancel
Showing results for 
Search instead for 
Did you mean: 

Float value implementation and debugging

NoviceStm32
Associate II

Is there a proper way to implement a float value? When i try to declare a float variable and debug via the variables tab and or live expression (global variable) I keep getting incorrect values in some instances. 

I have included the float library and enabled -u_printf_float / -u_scanf_foat. 

NoviceStm32_0-1734424900179.png

NoviceStm32_1-1734424937178.png

NoviceStm32_2-1734424981648.png

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Karl Yamashita
Principal

It could be an issue with the Live expression view

I've seen where the Live Expression did not have correct value, but if you pause the debugger and look at the variable in the Expression tab, the value was correct. 

Don't worry, I won't byte.
TimerCallback tutorial! | UART and DMA Idle tutorial!

If you find my solution useful, please click the Accept as Solution so others see the solution.

View solution in original post

2 REPLIES 2
Karl Yamashita
Principal

It could be an issue with the Live expression view

I've seen where the Live Expression did not have correct value, but if you pause the debugger and look at the variable in the Expression tab, the value was correct. 

Don't worry, I won't byte.
TimerCallback tutorial! | UART and DMA Idle tutorial!

If you find my solution useful, please click the Accept as Solution so others see the solution.

You are a life saver!!! That solved my issue.