I'm trying to program an S9KEAZ128 device using the PE micro GDB server and arm-none-eabi-gdb.exe while preserving a portion of the memory.
Using the S32DS IDE I'm able to preserve memory using the Advanced Options on the Debugger page but I'm not sure how this translates to GDB commands. I've seen the "monitor preserve0" command in some examples, but I'm not sure how it works or how I tell it what address range to preserve. Any guidance would be appreciated.
I was able to figure this out on my own. The GDB commands look like this:
monitor preserve<idx> <enable> <start> <end>
For example, to preserve two memory regions (0x0 to 0x1fff and 0x3000 to 0x3fff) you would use these two commands:
monitor preserve0 1 0 1fff
monitor preserve1 1 3000 3fff
The enable field is just a 0 or 1 (use 1 to enable memory preservation).
Small correction: the start and end address passed to monitor preserve should be in decimal not hexadecimal.