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

Post Reply
stevestrong
Posts: 1823
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

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

Post by stevestrong » Mon Jun 05, 2017 8:11 am

Well, I have the mentioned problem in the title.
STM32F4_debug_RAM.jpg
STM32F4_debug_RAM.jpg (115.88 KiB) Viewed 493 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?

danieleff
Posts: 336
Joined: Thu Sep 01, 2016 8:52 pm
Location: Hungary
Contact:

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

Post by danieleff » Mon Jun 05, 2017 11:31 am

I think it is only an eclipse memory display bug, and those are actually not zeros. Try to start the stack lower.

stevestrong
Posts: 1823
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

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

Post by stevestrong » Mon Jun 05, 2017 1:00 pm

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?

stevestrong
Posts: 1823
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

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

Post by stevestrong » Wed Aug 09, 2017 9:28 am

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?

User avatar
RogerClark
Posts: 7478
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

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

Post by RogerClark » Sat Aug 19, 2017 10:49 am

@Steve are you trying to jump to the bootloader in the F4 with it set to USB DFU??

stevestrong
Posts: 1823
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

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

Post by stevestrong » Sat Aug 19, 2017 8:14 pm

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...

zmemw16
Posts: 1489
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

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

Post by zmemw16 » Sat Aug 19, 2017 9:06 pm

that rang a bell, this of any help ?
http://www.stm32duino.com/viewtopic.php ... der#p32568
srp

User avatar
RogerClark
Posts: 7478
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

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

Post by RogerClark » Sat Aug 19, 2017 9:11 pm

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

Post Reply