The PIC/PID runtime can be used for different scenarios:
- All code and data segments are internal. The simplest case would be for all segments to use the same
MEMORY directive and to have all of the
.bss type segments at the end. In such a simple case, the application could be converted to a binary file and linked into another application which could copy it to RAM and jump to its entry point.
- All of the essential segments are internal and therefore moveable. But, there may be some external segments which are absolute. This situation is probably difficult to test but we can download the entire application to the chip and at least debug it at its link time addresses.
- There are internal and external segments, but the application is linked as a ROM image (the application does not need to be flashed to ROM, however). It is possible to change the ROM Image Address to be an address into RAM and have the debugger download the image to the RAM address. Alternatively, we could have the ROM image converted to a binary file and linked into another application as in 1, above. The structures used in
__init_data() ,
_rom_copy_info and
__bss_init_info , have been modified for SDA PIC/PID to have an extra field which tells the runtime where the segment is internal or external so that the internal segments are copied to position-relative addresses and the external segments copied to absolute addresses.