How can I locate the starting address of a variable in STM32CubeIDE?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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.
- Labels:
-
STM32CubeIDE
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-15 2: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 .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-15 1: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:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-15 2:01 AM - edited ‎2024-02-15 2: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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-15 2:06 AM
You have to "pause" debug, to see the (updated) values .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-15 2: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 .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-15 6: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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-16 12:14 AM
