__loadImage
Syntax
__loadImage(path,offset, debugInfoOnly)
Parameters
pathA 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.
offsetAn integer that identifies the offset to the destination address for the downloaded debug image.
debugInfoOnlyA 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. |
| Loading failed. |
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.
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.