Skip to main content
Knowledgebase
Home
Renesas Singapore - Knowledgebase

How can I assign program to address 10000h or higher (Area B in Figure 1)?

Latest Updated:02/22/2008

Question:

In R8C series MCUs with 64 Kbytes or more ROM、the ROM is divided into two areas according to the fixed vector table. How can I assign my program to address 10000h or higher (Area B in Figure-1)?

Answer:

The PDF version(78KB) is from here.

1. Assigning the entire program to Area B

A program is assigned by sections. The default section of a program is called program. Therefore, the program section is located in Area B. In assembler start-up, the section location is described in file sect30.inc. In C start-up, it is specified by the linker option.

1.1 Using assembler start-up

Change file sect30.inc as shown in Figure-2, and assign the program section to address 10000h.

1.2 Using C start-up

Change the setting of the linker option, and assign the program section to address 10000h. Set up in the following order.

(1) Select Section Order as Category in Link tab dialog (Figure-3 ①).
   Click Edit (Figure-3 ②).

(2) Select program (Figure-4 ①). Click Remove (Figure-4 ②).

(3) Select rom_FE (Figure-5 ①), click Add (Figure-5 ②).
   In Add section, input “program” as the Section name (Figure-5 ③).
 

(4) After selecting program. Click the Up arrow, and move program to the top of address 10000h (Figure-6).

[NOTES]
data_SEI, data_SOI, data_NEI, data_NOI, interrupt, and vector can be assigned to Area B in the same manner. However, rom_NE and rom_NO cannot be assigned to Area B.

2. Assigning part of a program to Area B

Apply different section names to the programs located in Area A and Area B. The section name can be changed by describing #pragma section in the source program. In the example in Figure-7, the section name of the program assigned to Area A is program (not changed), and the section name of the program assigned to Area B is changed to program2.

2.1 Using assembler start-up
Change file sect30.inc as shown in Figure-8, and assign the program2 section to address 10000h.

2.2 Using C start-up
Change the setting of the linker option, and locate the program2 section to address 10000h. Set up in the following order.

(1) Select Section Order as Category in the Link tab dialog (Figure-9 ①).
Click Edit (Figure-9 ②).

(2) Select rom_FE (Figure-10 ①), click Add (Figure-10 ②).
   In the Add section, input program2 as the Section name (Figure-10 ③).

(3) Select program2. Click the Up arrow, and move program2 to the top of address 10000h (Figure-11).

Suitable Products
C/C++ Compiler Package for M16C Series and R8C Family [M3T-NC30WA]