cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE Live Expressions not showing decimal places for floats.

Garnett.Robert
Senior III

Hi,

I'm debugging code with floats. I am using live expressions to watch the values, but even though I choose the decimal format I am not getting the decimal places for float values. I seem to remember doing this in another project and getting the decimal places.

Are there any settings you need to configure to get the thing to display floats correctly or doesn't the IDE do this?

0693W00000GXyW7QAL.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
LCE
Principal

There's a setting under properties / C/C++ Build / Settings / Tool Settings / MCU Settings

0693W00000GY3QnQAL.png

View solution in original post

6 REPLIES 6
TDK
Guru

It doesn't display trailing zeroes after the decimal point. "3" is certainly a valid value for a float, as is "0".

0693W00000GY2d2QAD.png

If you feel a post has answered your question, please click "Accept as Solution".
LCE
Principal

There's a setting under properties / C/C++ Build / Settings / Tool Settings / MCU Settings

0693W00000GY3QnQAL.png

Garnett.Robert
Senior III

HI LCE

Thank's for that.

I saw those settings, but there names are quite cryptic. I thought they had something to do with how code was compiled, not the actual IDE.

Best regards

Rob

Hi TDK,

The problem with that is that the value was 3.873... not 3.0 the decimal paces were ignored. I was sure that I had decimal places in other projects.

Best regards

Rob

TDK
Guru

Those settings do have to do with how the code is compiled.

I can't reproduce what you're seeing here (with checkboxes unmarked).

If you feel a post has answered your question, please click "Accept as Solution".
Garnett.Robert
Senior III

Setting the checkboxes fixes the problem, but at times the IDE still insists on displaying without the floating point representation. Then suddenly it comes good when your back is turned.

Like many things with Eclipse it seems to have a mind of its own.

Another issue I had was the Build Analyser wasn't mapping code to the correct memory segment. The memory segments were all shown correctly, but the variables assigned to them all ended up in AXI Ram. Then after some debugging and playing around the Build Analyzer woke up and displayed the memory map correctly.

I reckon there must be background threads that do all this stuff and they just don't run or run really slowly.

It's a pain as you think you have written bad code and you get sidetracked trying to work out what's wrong with your code when in fact it's Eclipse being Eclipse.

Best regards

Rob