Home >
GDB Deep Dive
Gillian Minnehan - Memfault- Watch Now - Duration: 32:26
Fantastic talk Gillian! :-)
It was really informative.. I do have a question though.
How would you go around generating a coredump for a device on the field? lets say for a cortex-m processor.
Lets say we have some sort of flash memory, wouldnt a hardfault make it impossible to generate a coredump and write it to the flash memory (its a hardfault afterall ) ?
Say we are saving it in ram, then a reboot would essentially clear out any contents on power up, unless we do some sort of linker magic to preserve a section across reboots..
As i mentioned, it was a fantastic introduction to gdb..
Srikrishna, glad you enjoyed it. Thanks for jumping into the chat with a great question again. Saving a coredump will have to happen before the device reboots, so the state of the system can be saved. Therefore, collecting data for a coredump will need to happen as part of the handling of a fault, so you would need to write your own fault handler to do this collection. You can take a look at our fault handler here. Notice that we call memfault_platform_coredump_get_regions()
in this handler, which is a function that will collect data for the coredump. As far as where to put it once it has been collected, yes, flash is one option. You could also store it in the "noinit" region of RAM, which persists across boots. You can take a look at our RAM-backed coredump here which does exactly that! Note however that space is more limited when using that region so only a few items could be collected like the active stack, PC, and LR. But, it is typically faster to get up and running with when first trying out coredump collection.
Thank you for the response Gillian! :-)
Oh thats a nice way of storing the coredumps... the noinit section... but I would imagine for flash storage it has to happen after a reboot and recover the data from the noinit section and then dump it into flash memory before rest of the system boots up..
Nevertheless, very interesting and helpful! Thank you again Gillian.
This was such a great presentation. Thank you for sharing all of this!