Debug two application images using macro __loadModule
Technical Note 73861
11/6/2015 10:41 AM
If you have a bootloader built in one project and an application built in another project, you may have a problem to debug both at the same time since debug information is usually only available for the active project.
These examples shows how to use the C-SPY macro __loadModule (IAR Embedded Workbench for ARM version 5.30) or __loadImage (IAR Embedded Workbench for ARM version 6.21) to read debug information from the debug file of the inactive project.
Note that in IAR Embedded Workbench for ARM version 6.21 and newer the option 'Debugger > Images' can be used instead of this macro.
The example application consists of a bootloader and an application, each built in a separate project.
The bootloader is the active project, which loads a raw binary (the application) to a defined address, to which it jumps.
The projects runs in the Simulator and debug information is available for the bootloader as well as the application.
Download the example application from the link below, and follow the instructions in readme.pdf how to build and run the example application.
Combining debug information might lead to trouble when the same symbol is defined in both images.
One way to handle this situation is to open the Images window (use 'View > Images', IAR Embedded Workbench for ARM version 5.40 and later), highlight one of the listed images and select to show debug info only for the selected image. That is, click the right mouse button and select one of the alternatives 'Show only <image>'.
All product names are trademarks or registered trademarks of their respective owners.