2022-01-08 06:06 AM
Could someone tell me, what I'm doing wrong? Why can't I find out the memory value in "Memory browser" window?
Very simple code:
uint8_t p = HAL_GPIO_ReadPin(LED_GPIO_Port, LED_Pin);
printf("Address of variable 'p' is: %p\r\n", &p); // 0x20004ff7
Solved! Go to Solution.
2022-01-08 09:16 AM
Variable p might've been optimized out. Try to qualify it as volatile.
[EDIT] If you can't display content of RAM as such, it might be also that the debugger does not work properly for whatever reason. "Blue pill" also sounds like a potential problem with not having a geniune STM32...
JW
2022-01-08 06:24 AM
As you write simple code... Hear you about registers?
Your memory browser you open in debuger run ?
2022-01-08 07:22 AM
The "Expressions" or "Variables" tab would be a more appropriate place to view the value of a variable.
2022-01-08 08:19 AM
Yes, I heard about the registers.
And yes I opened it is in debugger run!
But I do not understand what you want to say?!?
2022-01-08 08:19 AM
I'm study the addresses and pointers in С. Therefore, I need to use window of "Memory Browser"...
2022-01-08 08:34 AM
It's not clear from your screenshot if you're in debug mode at all. Even if you are, it does not appear execution is paused. The memory browser won't work unless you are in debug mode and execution is paused. It does not update continuously or when not connected to the chip.
You don't mention what chip you're on (STM32F103?), but unavailable addresses will show up as ???. If you only have 20kB of RAM, this is why the vast majority of the addresses show up as ???.
On top of those, the "Memory Browser" in Eclipse is not the most robust thing. Its functionality is the combination of several third-party tools that do not always work seamlessly together. Expect it to be finicky. You can also use the "Memory" tab with varying results.
2022-01-08 08:55 AM
Sorry, I have a "BluePill" stm32f103c8t6, RAM=20K, Flash=64K.
CubeIDE v1.8.0.
Operating system is Debian 11.
The chip is connected and debugger is running, not stopped and not on a pause.
Do you think on another board it will work?
2022-01-08 09:16 AM
Variable p might've been optimized out. Try to qualify it as volatile.
[EDIT] If you can't display content of RAM as such, it might be also that the debugger does not work properly for whatever reason. "Blue pill" also sounds like a potential problem with not having a geniune STM32...
JW
2022-01-08 09:27 AM
> The chip is connected and debugger is running, not stopped and not on a pause.
Reread my answer about being paused.
2022-01-09 12:22 AM
I want say, that your code is compiled and optimized to use register
or by higher level of optimize is wiped out and showed address is stack.
because value p isnt used anywhere.