Debugger watch window doesn't show correct values

Hey there,

I'm using keil v5.27.1.0 with a stm32h745 nucleo board. i'm developing firmware code for a student project.

i'm having a problem where the watch window shows jibberish values for variables. it's literally as simple as a line of code being 'variable = 1' and the debugger shows a value of 0 or 0xB1 or something. so far i have trouble recognizing any pattern or rule with which a variable shows 0, garbage or a value that seems to make sense. The shown values are the same for every variable after recompiling and flashing (also with different optimization settings) but they are weird and different for every different variable

i have added a little piece of debug code that jumps into an 'if' when the variable has the intended value. that seemed to work so i think it might be an issue with the debugger and the correct code might actually be running.

i'm fairly new to embedded development in general, so i think there might be a lot of causes for this. still, maybe that's a common error and a no brainer for experienced people. i can provide more info about my keil configurations, the software i'm designing and so on if needed.

thank you in advance!

Greetings, Alex

More questions in this forum