2.6.2 Prepare for using the overlaid section selection function

The optimizing linker (rlink) used by CC-RL can allocate multiple sections defined in a program to the same address. The sections allocated in this way are called "overlaid sections".

The debug tool provides a function to select the debug target section from the overlaid sections (priority sections) allocated to the same address. The function is called "overlaid section selection function".

A load module using overlaid sections can be debugged with switching of the priority section before program execution.

The method for generating a load module to use the overlaid section selection function is shown below.

(1)

Copy the ROM area contents to RAM

Copy the ROM area contents to the RAM area to expand the code and data in the RAM.

(2)

Set build options

Set the ROM-to-RAM mapped sections and overlaid sections to use the overlaid section selection function.

Select the build tool node on the project tree and select the [Link Options] tab on the Property panel.

(a)

Set ROM-to-RAM mapped sections

Setting the ROM-to-RAM mapped sections is made with the [ROM to RAM mapped section] property in the [Section] category.

This reserves the RAM section with the same size as that of the ROM section and relocates the symbols defined in the ROM section to addresses in the RAM section.

Figure 2.37

[ROM to RAM mapped section] Property

 

If you click the [...] button, the Text Edit dialog box will open.

Figure 2.38

Text Edit Dialog Box

 

Enter the section name in [Text] in the format of "ROM section name=RAM section name", with one section name per line.

You can specify up to 32767 characters per line, up to 65535 lines.

If you click the [OK] button, the entered section names are displayed as subproperties.

Figure 2.39

[ROM to RAM mapped section] Property (After Setting Sections)

 

To change the section names, you can use the [...] button or enter them directly in the text box of the subproperty.

(b)

Set ROM sections and RAM sections (overlaid sections)

Setting the sections is made with the [Section start address] property in the [Section] category.

Figure 2.40

[Section start address] Property

 

<1>

Set ROM sections

If you click the [...] button, the Section Settings dialog box will open.

Figure 2.41

Section Settings Dialog Box

 

If you click the [Add...] button, the Section Address dialog box will open.

Figure 2.42

Section Address Dialog Box

 

Enter in [Address] the address of the ROM section to be added and click the [OK] button to add the entered address to [Address] in the Section Settings dialog box.

Figure 2.43

Section Settings Dialog Box (After ROM Section Addresses Are Added)

 

Click the Section column on the added address row and click the [Add...] button to open the Add Section dialog box.

Figure 2.44

Add Section Dialog Box

 

Enter in [Section name] the name of the ROM section to be added and click the [OK] button to add the entered section to [Section] in the Section Settings dialog box.

Figure 2.45

Section Settings Dialog Box (After ROM Sections Are Added)

 

For other ROM sections, set addresses and section names in the same way.

Remark

Click the Address column and click the [Add...] button to open the Section Address dialog box, allowing you to add a new address.

Figure 2.46

Section Settings Dialog Box (After Multiple ROM Sections Are Added)

 

<2>

Set RAM sections (overlaid sections)

Click an added address and click the [Add...] button to open the Section Address dialog box.

Figure 2.47

Section Address Dialog Box

 

Enter in [Address] the address of the RAM section to be added and click the [OK] button to add the entered address to [Address] in the Section Settings dialog box.

Figure 2.48

Section Settings Dialog Box (After RAM Section Addresses Are Added)

 

Click the added address row (Address column or Section column) and click the [New Overlay...] button to open the Add Overlay dialog box.

Figure 2.49

Add Overlay Dialog Box

 

Enter in [Section name] the name of the RAM section to be added and click the [OK] button to add the entered section to [Section] in the Section Settings dialog box.

Figure 2.50

Section Settings Dialog Box (After RAM Sections Are Added)

 

Add the sections to be allocated to the same address by using the [New Overlay...] button in the same way.

The added sections are displayed under [Overlay n] (n: number starting with "1").

Figure 2.51

Section Settings Dialog Box (After Overlaid Sections Are Added)

 

For other RAM sections, set addresses and section names in the same way.

Remark

Click the Address column and click the [Add...] button to open the Section Address dialog box, allowing you to add a new address.

Figure 2.52

Section Settings Dialog Box (After Multiple RAM Sections Are Added)

 

Click the [OK] button. The specified ROM sections and RAM sections (overlaid sections) will be displayed in the text boxes.

Figure 2.53

[Section start address] Property (After Setting Sections)

 

(3)

Run a build of the project

Run a build of the project.

A load module file to use the overlaid section selection function is generated.