Page 1 of 1

Invalid stack in RAM when debugging F4 board with STLink in Eclipse

Posted: Mon Jun 05, 2017 8:11 am
by stevestrong
Well, I have the mentioned problem in the title.
STM32F4_debug_RAM.jpg
STM32F4_debug_RAM.jpg (115.88 KiB) Viewed 332 times
The memory monitor window for the stack area shows invalid (zero) data.

Stepping through the code till a specific point is OK, then after returning from a function it jumps to 0 (due to stack?).

Variable inspection is OK.

What I am missing?

Re: Invalid stack in RAM when debugging F4 board with STLink in Eclipse

Posted: Mon Jun 05, 2017 11:31 am
by danieleff
I think it is only an eclipse memory display bug, and those are actually not zeros. Try to start the stack lower.

Re: Invalid stack in RAM when debugging F4 board with STLink in Eclipse

Posted: Mon Jun 05, 2017 1:00 pm
by stevestrong
Funny thing.
I had in the Debug configurations->Debugger, GDB Client Setup: Commands: "set mem inaccessible-by-default off".
I deleted this, restarted the board and the debugger and now it shows the stack data.

However, I still changes sometimes to show all zero, then back to show valid data after doing a step.

Is GDB faulty? Should I change to a newer version?

Re: Invalid stack in RAM when debugging F4 board with STLink in Eclipse

Posted: Wed Aug 09, 2017 9:28 am
by stevestrong
Now trying to debug a jump to bootloader, I encounter the problem that Eclipse does not show the correct content of the program memory.

If I let the program to start and break at main, everything runs correctly, as expected.
If I set the address of the disassembly window to 0x08000000 (flash start address), I see the correct symbol "__stm32_vector_table" displayed but the flash content displayed is totally wrong. If I step through, I also get invalid data executed.

Same thing if I want to display the content of system memory from 0x1FFF0000, invalid data displayed.

OTOH, all memory content is correctly displayed using STLink Utility.

What am I doing wrong?
Or what is Eclipse doing wrong, how can I change any relevant OpeOCD/GDB setup parameter?

Don't you guys have any problems debugging with Eclipse?

Re: Invalid stack in RAM when debugging F4 board with STLink in Eclipse

Posted: Sat Aug 19, 2017 10:49 am
by RogerClark
@Steve are you trying to jump to the bootloader in the F4 with it set to USB DFU??

Re: Invalid stack in RAM when debugging F4 board with STLink in Eclipse

Posted: Sat Aug 19, 2017 8:14 pm
by stevestrong
Yes, that was my intention.
And it did not work, that is why i tried to debug, but debugging is not working for some reason...

Re: Invalid stack in RAM when debugging F4 board with STLink in Eclipse

Posted: Sat Aug 19, 2017 9:06 pm
by zmemw16
that rang a bell, this of any help ?
http://www.stm32duino.com/viewtopic.php ... der#p32568
srp

Re: Invalid stack in RAM when debugging F4 board with STLink in Eclipse

Posted: Sat Aug 19, 2017 9:11 pm
by RogerClark
zmemw16 wrote:
Sat Aug 19, 2017 9:06 pm
that rang a bell, this of any help ?
http://www.stm32duino.com/viewtopic.php ... der#p32568
srp
I assume Steve tried that code and it did not work