cancel
Showing results for 
Search instead for 
Did you mean: 

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

DVolp.5
Associate

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

32 REPLIES 32

Interesting, I will try soon.

for me this unfortunately does not work.

No matter how the optimation settings are selected (-O0 or -Og ).

Every time I restart the Debugging I see the "Failed to evaluate expression"

To solve the Problem I must put a breakpoint in a Funktion where the Variable is in use, then I can add the variable to "Live Expressions". After this I can run the Programm an can see and change the value of the Variable with no Problems.

System:

Ubuntu 18.04

STM32CUBEIDE 1.5

ST_LINK V2

µC STM32G031G6

Strange thing, another Projekt on the same Conmputer and on a nucleo f042 (with build in STLinkV2.1) work fine.

ioannis
Associate II

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

Thank you so much

lprzenioslo
Associate II

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
Senior

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.

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

Slh
Senior

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...

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.

DrDro
Associate III

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.