We are using MCUXpresso for K81 development with a JLink debugger. We have a bootloader in the first 16K that successfully transitions to an application above that including moving the vectors seemlessly. This all works when running live, but I cannot figure out how to use MCUXpresso to debug the application in this scenario.
For example, I can debug the Bootloader and step in assembly into the application, and I can let it run and halt and see that it halts at a valid address in the application.
But what I want is to flash the bootloader and then debug the application with its source symbols. When I try to do this, it never breaks at main() and always seems to be in the weeds when I halt.
If I disconnect the debugger and reboot the target, it clearly runs just fine with the code that is getting flashed, both in the bootloader and application areas. So, the problem appears to be related to getting MCUXpresso and JLink to be able to debug it properly.
What would help is some basic steps to make this work within the IDE.
You have to properly load the symbols with gdb.
if you want to debug the bootloader and the application, then just attach and load the symbols:
https://mcuoneclipse.com/2020/11/03/debugging-bootloader-and-application-with-one-debug-session/