跳转到主内容
Knowledgebase
Home
Renesas Electronics China - Knowledgebase

About securing the area of the repeat area used by the DTC

Last Updated:01/16/2018

Question:

I am aware that the address for the DTC repeat area needs to be set to xx00H.
But, does the address need to be secured as an area?
Isn't simply setting an address to a DTC register enough?
If necessary, tell me a method for performing the declaration in C programming.

Answer:

The DTC repeat area needs to be secured as an area by the program. Otherwise, the area may be used for other purposes at build time.
Although there are several methods for securing a fixed RAM area in C programming, CA78KOR provides a relatively simple method using the #pragma sfr directive. As a simple test, create a program file to only declare an area for the DTC.
An example below explains how to secure 10 bytes from the address 0xFFD00 as a DTC repeat area when the CubeSuite+ development environment is employed.

#pragma section @@DATA DD1 AT 0FFD00H
 unsigned char DTCDATA[10];

The required definition is as follows:
In the first line, using a "#pragma section" instruction, a data segment is changed from the standard @@DATA to DD1, and allocates the segment starting from the address 0xFFD00. In the second line, an array DTADATA[10] composed of 10 elements of a character data type (bytes) is defined.
When using DTCDATA defined as described above, declare it as an external variable to access each component of the array.

extern unsigned char DTCDATA[10];

The above definition in the built program will output to the MAP file as indicated below.

* gap * FEFCAH 00D36H
 DD1 FFD00H 0000AH DSEG AT
 DD1 DTCAREA FFD00H 0000AH

Suitable Products
RL78/G14
RL78/F13
RL78/F14
RL78/F15
  • 这篇文章对您有帮助吗?