cancel
Showing results for 
Search instead for 
Did you mean: 

Live Expressions showing wrong values

THML
Associate II

I am using CubeIDE version 1.11.0 for a STM32F411RC project.

After i've changed boards (between two equal custom boards), my live expressions started showing wrong values. The values are only wrong in the live expression, because if I halt the program and read them, they are correct.

I've tried removing the variables from the live expression and inserting them back again, but it didn't work. I also tried turning my variables volatile. I also removed all optimizations, but to no avail. I erased and remade my debug configurations from scratch, but it didn't change anything.

The only thing that worked was turning on the Serial Wire Viewer (SWV) in the debug configurations. It worked once, but when I stopped the debugger, did some changes, and started it again, it was all wrong all over again. It never got right again after that.

Is there some kind of configuration I am missing? The only thing I didn't try yet was reinstalling the CubeIDE.

5 REPLIES 5
Wijeden RHIMI
ST Employee

Hello @THML​ 

First let me thank you for posting.

Could you please provide a simple project where the issue occurs to help us reproduce this behavior and further analyze it.

Kind regards,

Wijeden.

PReka.3
Associate

I have the same problem with Live Expression. Did you solve it, what was wrong?

AScha.3
Chief III

my experiences with Live Expression : its more like a game...some work, most not; always i got it working on first setup/use , but after many mod program/compile/debug sessions or next day, more and more Live Expressions no more working...so, more like lucky, if they work. i almost stopped using them, because debug/stop normal expression working correct and so more useful for me; or use SWV - is working (just start or stop using swv is also a game).

If you feel a post has answered your question, please click "Accept as Solution".
Radosław
Senior II

If this variable are structure etc, just fold and unfold them. In same cases, only eclipse restart helps.

daneichenwald
Associate II

We have been having this exact issue on and off for about year and its extremely frustrating.  The problem seems to be that the live expressions are off by 1 row. 

  • Var1 value is shown in row 2 and decoded as var2. 
  • Var2 value is shown in row 3 and decoded as var3. 
  • And so on. 

So the values seem to be correct (but on the next line) but of course the decoding is incorrect.

This is a pretty mature project that has used CubeIDE from the start.  This issue gradually started happening more and more often about a year ago.  One theory was that it was code size related.  To test this I commented out a large block of code (100K) and everything worked great...for a few months.  I ran with the code excluded and no issues.  But of course the code continued to grow and its not so easy to comment out large blocks anymore so this strategy no longer works.  BTW, I have no idea why this possibly would have solved the problem, but it did.  I could exclude the code and the problem went away and reinclude it and the problem returned.  Very reproducible.

Like the OP, I have no optimizations and have removed and readded all of my live expressions.  Another team mate runs from VSCode and has no issues with the same code base.  I have also created a new workspace and this seems to work for one debug session before the issue returns.

So unfortunately, I can't provide code for this as it would require providing our entire code base.  Any thoughts on possible causes?

Thanks!