2020-05-11 06:35 AM
Working on the bootloader, it successfully downloads the binary, verifies it, programs it and jumps to it. But in the loaded application is crashing.
Using System Workbench (Eclipse)
I had a similar problem a few years ago and I recall I loaded the application's symbol table in the debugger console, but I don't remember the commands and I have not yet found them on line.
I was also thinking: it would be a lot easier if I could simply load the bootloader and the application together as one with both symbol tables. But everything I've found for combining them removes the symbol table. And Eclipse will only let you load one ELF file.
Anyone have any ideas? 🙂
2020-05-11 07:15 AM
I don't know the answer to your question, but do you need the bootloader's symbols to debug crash in the*application*?
JW
2020-05-11 07:17 AM
No, I need the applications symbol table to debug a crash in the application.
2020-05-11 07:34 AM
Then load the application into debugger, leaving the bootloader as binary in FLASH.
JW
2020-05-11 07:43 AM
When the application runs by itself, it runs just fine. But when it is branched to from the debugger is crashes.
If I load the application while the bootloader is in memory the debugger removes the bootloader.
2020-05-11 08:13 AM
Figured it out. Go to the Debugger Console and enter the command "add-symbol-file <filename> <.text address>"
The hard part was figuring out the .text address. It's not the code entry point, it's the address just after the vector table.
My load address is 0x8008000, the vector table is 0xC0, so the .text address is 0x80080C0.
2020-05-11 08:30 AM
Would really depend on the section definitions in the linker script. Generally if you don't have the .MAP file to review, you could use objcopy or FromELF to dump/disassemble the content of the object file.
2020-05-11 08:42 AM
Thanks! Your right. It wasn't 0x80080c0, it was 0x80080e8. Found by looking at the map file! Probably because I put an information header just after the vector table. Makes sense.
2020-05-11 10:56 AM
Just as a follow up, the bug was that, while the bootloader was resetting the Vector Table Relocation register the application was resetting it back to the bootloaders vector table.
2020-05-11 11:14 AM
> Just as a follow up
Thanks for coming back with the solution, to both this and the symbols problem. It probably applies to gdb generally I suppose.
> If I load the application while the bootloader is in memory the debugger removes the bootloader.
Remove such a debugger. 😉
JW