On the TWR-LCD, I’m using a USB MSD bootloader. In Programming part of flash I showed how to download and debug the application on top of the bootloader. But how to debug both the bootloader and the application? At the same time with CodeWarrior for MCU? The magic key is tell CodeWarrior to use ‘Other Executables’.
Basically it means to tell the debugger the debug information of other applications, which are already running on the board. Kind of telling the debugger ‘hey, there is some more source and debug information you should be aware of’.
The same thing works as well if I’m only ‘attaching’ (see Hot-Sync: Attach, Connect & Download) to the target application. Using ‘Other Executables’ allows me to give all the needed information to the debugger, so it can be debugged.
In the debug/launch configuration, there is a ‘Other Executables’ tab:
To add a new executable, I press the ‘Add’ button:
Next I specify the other application (.elf) file and check ‘Load Symbols’: that way the debugger will load the symbols (also know as ‘symbolics’ information, line, source and other debug information) of that file:
💡 There is as well a ‘Download to Device’ check box: if enabled, it will flash that application to the device. What I see is that it will do an erase of the device followed by programming the application. So this does not work in my view to download e.g. the bootloader and the application in one step.
The above dialog allows me to specify multiple such ‘other executables’, if I need it. I realize that this ‘other executable’ could be very useful to debug e.g. an Embedded Linux application.
After the ‘other executable’ has been configured, I can quickly turn on/off the ‘Load Symbols’. So for the bootloader project, I could turn on/off symbols of different loaded applications that way very quickly.
Debugger Command Line
The ability to load additional symbolics exists as well in the Debugger Shell (Command Line Debugger, see Debugger Shell: Test Automation). The command is ‘loadsym’ and ‘help loadsym’ gives information about the arguments:
That way I can add symbolic information while debugging using the Debugger Shell:
To debug ‘splitted’ applications like a bootloader and the loaded application, that ‘Other Executable’ settings did the trick for me: with ‘Load Symbols’ the debugger loaded incrementally the extra symbols, and with an ‘Attach’ configuration I’m able to debug both the bootloader and the loaded application. Additionally I can use the Debugger Shell to do this while debugging. Nice :-).
Happy Debugging 🙂