Everything
2.7 Usage of PIC/PID Function

The PIC/PID function enables the code and data in the ROM to be reallocated to desired addresses without re-linkage even when the allocation addresses have been determined through previously completed linkage.

To use the PIC/PID function, a "master" program and an "application" program must be prepared.

In the PIC/PID function, a program whose code or data in the ROM has been converted into PIC or PID is called an application, and the program necessary to execute an application is called the master.

This section describes debugging of an application program (load module) whose code or data in the ROM has been converted into PIC or PID and reallocated to different addresses.

 

-

PIC

When the pic option is specified for compilation, the PIC function is enabled and the code in the code area (P section) becomes PIC. The PIC always uses PC relative mode to acquire branch destination addresses or function addresses, so it can be reallocated to any desired addresses even after linkage.

-

PID

When the pid option is specified for compilation, the PID function is enabled and the data in ROM data areas (C, C_2, C_1, W, W_2, W_1, and L sections) becomes PID. A program executes relative access to the PID by using the register (PID register) that indicates the start address of the PID. The user can move the PID to any desired addresses by modifying the PID register value even after linkage.

 

Remark 1.

For details on the PIC/PID function, see "CC-RX Compiler User's Manual".

Remark 2.

For setting of the PIC/PID function by the build tool, see "CS+ CC-RX Build Tool Operation".

 

To start debugging after changing the allocation of a load module whose code or data in the ROM has been converted into PIC or PID, take the following steps.

(1)

Add a download file

Add the application load-module file as a download file for the master (see "2.7.1 Changing the allocation of a load module using the PIC/PID function").

(2)

Set conditions for downloading of the load module file

Specify two offset values for the application load module: [PIC Offset], which is an offset from the original address, and [PID Offset], which is an offset to be set in the PID register selected at the time the load module was created.

(3)

Download

Download the master and the application load-module file (see "2.5.1 Execute downloading").

Debugging of the code and data in the ROM allocated to new addresses is now possible.