cancel
Showing results for 
Search instead for 
Did you mean: 

Live Expressions showing unexpected value

HMcKi
Associate III

Took me a while to find this, I hope it helps others.

Running STM32CubeIDE v1.11.2. I noticed suddenly my variables values under Live Expressions were showing garbage. After a bit of investigation, I found I had to pad my structs to be 4 byte aligned.

4 REPLIES 4
Rim LANDOLSI
ST Employee

Hello @HMcKi ,

Thank you for posting this issue.

Could you please provide a minimalistic example to reproduce this problem.

Also, I wonder if you find the same issue with the expression view or it appears only in live expression.

Thank you,

Rim.

HMcKi
Associate III

Not happening now sorry, will keep an eye out.

Mike xx
Associate III

I have an example, in a FreeRTOS task I have a variable:

 SPI_Queue_Type SPI_TxBuf;

After a successful xQueueReceive() if I hover the cursor over SPI_TxBuf the element SPI_Action has a different value to if I hover over SPI_TxBuf.SPI_Action

I can't see anything wrong, the code functions as expected but the value in "Variables" tab is also wrong.

This is part of a multi-task complex code, and is very frustrating.

BTW There is no code optimisation.

SPozz.1
Associate III

Hello,
I'm occasionally experiencing the same problem after some time of debugging session, where the program is interrupted, run in steps and resumed continuously. I captured the the following image when the execution was suspendend/paused; it shows that the expression variable is different from the live expression variable. When the program resumes, the live variable gets insane unstable. Stopping the debug session or restarting the ide doesn't fix the problem.

The magic fix is achieved by disconnecting the USB cable from the ST-LINK (ST-LINK/V2 ISOL with latest firmware in my case) and restating the debug session.
I hope this help.

liveexp.png