If having a boot loader running on a micro-controller, it is very useful if both the boot loader and the loaded application can be debugged together:
So how to make this work?
First have the boot loader flashed and have it loaded an application (see https://mcuoneclipse.com/2019/10/06/linking-bootloader-applications-with-eclipse-and-freemarker-scripts/).
Then have in the application project a debug launch configuration created (I’m using a J-Link here):
The trick is to configure this launch so it does not flash/overwrite anything on the target and does an ‘attach’ instead:
To prevent writing a new binary, make sure ‘Load image’ is unchecked and ‘Load Symbols’ for the application is checked:
Finally, load the extra symbols of the boot loader itself:
💡 If I have more parts for which I want the debug symbols, I can use the ‘+’ and add more files.
With this, I have source level debugging for both the boot loader *and* the application 🙂
Happy Bootloading 🙂