Debug two application images using macro __loadModule

Technical Note 73861






2015-11-06 10:41


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.

Example application IAR Embedded Workbench for ARM 5.30 (

Example application IAR Embedded Workbench for ARM 6.21 (

Ambiguous symbols

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.

Det här innehållet finns tyvärr inte på svenska.

Vår webbplats finns främst på vårt koncernspråk engelska, förutom det innehåll för investerare som vi är lagstadgade att kommunicera på svenska. Vi rekommenderar att du besöker vår globala webbplats på engelska för att få en bättre upplevelse.

Vi stöder inte längre Internet Explorer. För att få bästa möjliga upplevelse av rekommenderar vi att du uppgraderar till en modern webbläsare som Chrome eller Edge.