Skip to main content

IAR Embedded Workbench for Arm 9.70.x

__loadImage

In this section:
Syntax
__loadImage(path, offset, debugInfoOnly)
Parameters
path

A string that identifies the path to the debug image to download. The path must either be absolute or use argument variables. For information about argument variables, see Argument variables.

offset

An integer that identifies the offset to the destination address for the downloaded debug image.

debugInfoOnly

A non-zero integer value if no code or data should be downloaded to the target system, which means that C-SPY will only read the debug information from the debug file. Or, 0 (zero) for download.

Return value

Value

Result

Non-zero integer number

A unique module identification.

int 0

Loading failed.

Table 45. __loadImage return values 


For use with

All C-SPY drivers.

Description

Loads a debug image (debug file).

Note

Images are only downloaded to RAM and no flash loading will be performed, unless you are using J-Link or TI MSP-FET.

Example

Your system consists of a ROM library and an application. The application is your active project, but you have a debug file corresponding to the library. In this case you can add this macro call in the execUserSetup macro in a C-SPY macro file, which you associate with your project:

__loadImage("ROMfile", 0x8000, 1);

This macro call loads the debug information for the ROM library ROMfile without downloading its contents (because it is presumably already in ROM). Then you can debug your application together with the library.

Example

Your system consists of a ROM library and an application, but your main concern is the library. The library needs to be programmed into flash memory before a debug session. While you are developing the library, the library project must be the active project in the IDE. In this case you can add this macro call in the execUserSetup macro in a C-SPY macro file, which you associate with your project:

__loadImage("ApplicationFile", 0x8000, 0);

The macro call loads the debug information for the application and downloads its contents (presumably into RAM). Then you can debug your library together with the application.

See also

Images and Loading multiple debug images.