Skip to main content
DVolp.5
Visitor II
July 25, 2019
Question

[BUG] STM32CubeIDE Live Expression sometimes fail to evaluate expression.

  • July 25, 2019
  • 22 replies
  • 30030 views

Hi,

I have noticed a little problem in the "Live Expressions" function.

The first time I open STM32CubeIDE and debug my firmware, I can see the value of all expressions previously written by me.

When I stop the debug and debug again, some expressions does'nt show the value. Instead this appears the message " Failed to evaluate expression".

The curious is that if I "rename" the expression the correct value appears again. For example, adding a space (or removing a space) at end of a expression with the message " Failed to evaluate expression" solve the problem.

This are happenning with anyone more?

This is a real bug?! How this problem can be solved?

Best regards, 

DIego Volpini

22 replies

Peter.Farkas [hun]
Associate II
October 12, 2020

Win10 (64bit 1909)

+

STM32CubeIDE Version: 1.4.2

Build: 7643_20200813_1322 (UTC)

Looks better than before. The error could not be reproduced.

sgran.1
Associate
October 12, 2020

I managed to defeat the error on Windows and Mac!!

change optimization settings

the victory does not make me happy, since this is not described in any way in the manuals - only the big tambourine of the African shaman is pressed

Project propertys-->Build c/c++ settings-->Tools settings--> GCC compiler Debugging--> Level Maximum -g3

And in Optimization Level --> Optimize for Debugging -0g

After than --->>> all ok

Why -- I dont understand, but it working!

Need ask software team

fronders
Associate III
October 20, 2020

I'm not sure it has to do anything with optimization levels, since it sometimes does work, but after restarting the session with exactly same binary doesn't.. ​

sgran.1
Associate
October 20, 2020

I agree with you - this is a strange solution, but it helped me on all my computers MAC and Win10 - while working with the same project at different times on different computers (cloud ONE Drive and MEGA) - and this is stable for the last 7 - 8 days! Oh-oh-oh THIS MIRACLE AND GLORY TO OUR GOD --- >> STM.COM)))))))))))))

sgran.1
Associate
October 20, 2020

reinstalling theIDE 1.4.2 did not help solve the problem before

sgran.1
Associate
October 20, 2020

the creators of this project should think about how to fix their bug or explain to us how to use it

ioannis
Associate
December 30, 2021

I was trying to make it work, and i did it by moving the variable i want to monitor on the global section, at USER CODE 0 instead of USER CODE 1

lprzenioslo
Associate III
January 16, 2023

Hi,

I hope this helps someone. Not in understanding why this problem occurs, but maybe how to workaround it...

So I was facing this issue in which whenever I started debugging with ST-LINK, the debugger would stop with a program counter in a ranom place with the dialog saying:

"failed to enable live expressions".

I removed some parts of the code and it worked again (the program counter did not get to that place even before the crash). Also programming without debugging yield no issues.

What I did then is to extend the stack and heap size 2x in the Cube generator settings. With that the debugging started working again. I then reduced the heap and stack back to the original values- the debugging kept on working...

If not for the facts that the ST-LINK is attached to the board I am using and there are no SWD pins exposed, I would never touch this abomination again for the purposes of debugging.

JSILV.2
Associate III
February 2, 2023

I have TWO Computer with the same up-to-date CUBE-IDE running the same simple example on the same NUCLEO-F411RE (the same board). The example is reading the ADC, exposing the RAW value and calculating the input ADC' voltage. The ADC is read after one second using simple HAL_Delay().

In one Computer, under Debug, we can see the RAW value, the Calculated Voltage and the Scalling number for conversion of RAW to Voltage. The same SET, but in other computer, ONLY THE RAW value is exposed, the other two show ZERO and " Failed to evaluate expression" .

On both Computer after PAUSE we can read the last correct values.

The same up to date CUBE IDE on different Computer works differently.

Have, someone, a hint to avoid this issue?

Thanks in advance.

lprzenioslo
Associate III
February 2, 2023

Replace the st-link firmware with segger firmware- solved all my issues.

ABerg.8
Associate II
August 16, 2023

I followed this tip, it worked the first time, when I tried again I couldn't activate a tab anymore.

And when debugging again, the message appears in the console that debbing has been shut down.
Use win 10 CubeIDE V1.13.1, Build: 17479_20230728_0839 (UTC), these problems occurred for the first time with V 1.31.0.

Slh
Senior
April 26, 2023

Workaround: During program running, set one of variable in the Live Expression window to e.g 0 and hit Enter. It seems it synchronizes reading data...

NFern.1
Associate III
October 27, 2023

I am facing the same problem. This is the only solution that works for now.

msavi.11
Associate
May 21, 2024

Yeah, this problem still alive. I have this and don't know how to solve.

 

DrDro
Associate III
October 5, 2023

This bug is 4 years old!
I'm using STM32CubeIDE 1.13.2 under Win10 and I get this bug when I launch debug session. The only way to fix it is to close and start STM32CubeIDE again.

"Live Expressions" are closed in Debug Perspective.

How bad, after app restart it comes to error again.