Skip to content
Advertisement

ARM GDB cannot access memory only on Linux

Trying to switch development to Linux, but running into a (probably simple newbie) problem. On my Mac, I can use ARM GDB (arm-eabi-none-gdb from the GNU ARM Embedded Toolchain) to load my elf to my STM32L432, then at my breakpoints a simple i lo (or examine, or whatever) gives me the local vars. On Linux, however, the exact same code gives me something like the following:

JavaScript

Is there something I should be doing different to map the memory correctly?

Edit: Thought I’d start again today with a mem dump of the entire SRAM block (datasheet RM0394 page 63) to see if there’s just some offset (maybe some sort of memory aliasing that I was unaware of), but even the dump command is stymied:

JavaScript

This isn’t happening on my Mac, and I can see the data I’m looking for on my scope (nothing like debugging software with a scope), so the problem isn’t with the SRAM, but with gdb.

And to the person who voted to close, could you specify in what way this is off-topic? I’m stepping through code using gdb and there are tags for pretty much everything I mention, which leads me to believe that this is an appropriate place for the question. I’m not asking for “debugging help” as in “help with debugging specific code”, I’m asking for help with a very widely used debugger on somewhat common equipment.

Advertisement

Answer

For anyone with this problem in the future (sc. myself), the issue was that gdb was not tracking the memory region that includes my SRAM (viz. 0x2000c000 to 0x40000000). The fix was to set up a memory region manually.

Before:

JavaScript

After:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement