2024-02-14 10:45 PM - edited 2024-02-14 10:45 PM
like the following code:
int ANDresult = i&j;
The value of ANDresult is 0x20022002. In our assignment our professor asked us to write down the address of the variable ANDresult, I tried to add ANDresult as an expression in the Memory monitor but the CubeIDE redirected to the address 0x20022002, which obviously is not the address of ANDresult.
Thanks!
Debugger: STLink V2
MCU:STM32F103VET6
Solved! Go to Solution.
2024-02-15 02:44 AM
Hi
STM32CUbeIDE 's Memory Monitor requires an address. When you give the Memory monitor the variable name "ANDresult", it believes it is an address. Just give Memory monitor the address to the variable: &ANDResult.
Another approach would be to use the "Variables" window or the "Expressions" window to see directly ANDresult .
2024-02-14 11:50 PM
Welcome @OW1TY2, to the community!
Where do you get the certainty that this is NOT the address?
Have you looked at the memory structure of the STM32F103xE, which you can find in the data sheet?
Regards
/Peter
2024-02-15 01:41 AM
Because the content of the memory address 0x20022002 are all "?", and I'm certain that 0x20022002 shall be the exact value stored in the variable ANDresult.
Like this:
2024-02-15 02:01 AM - edited 2024-02-15 02:02 AM
OK, now I've checked the data sheet myself: the STM32F103VET6 has 512KB flash and therefore 64KB SRAM, which in fact cover an address space between 0x20000000 and 0x2000FFFF. So if you are now talking about 0x20022002, this may well be the value of ANDresult and therefore the result of the AND function.
What is the value (not the adress) of i and j?
2024-02-15 02:06 AM
You have to "pause" debug, to see the (updated) values .
2024-02-15 02:44 AM
Hi
STM32CUbeIDE 's Memory Monitor requires an address. When you give the Memory monitor the variable name "ANDresult", it believes it is an address. Just give Memory monitor the address to the variable: &ANDResult.
Another approach would be to use the "Variables" window or the "Expressions" window to see directly ANDresult .
2024-02-15 06:43 PM
So does it mean that to locate the address (not value) of a variable in Memory, I have to add a "&" before it?
2024-02-16 12:14 AM