Skip to main content
Knowledgebase
Home
Renesas Singapore - Knowledgebase

How large is memory allocated as stack area by default in RL78 compiler?

Latest Updated:09/05/2013

Question:

I am using the RL78/78K0R compiler in the CubeSuite+ environment.
How large a size of memory is allocated as the stack area by default?

Please tell how the user can specify the stack size and allocate the stack area.

Answer:

In the default state, the largest consecutive area in the unused RAM area is allocated as the stack area. Therefore, the maximum stack size can be allocated in RAM by default.

The method for specifying the stack size and allocating the stack area by the user is given below.

  1. Define the memory area name and size in a link directive file.

    [Example]
    When the RAM area of a microcontroller is from 000ff700H to 000ffeffH, the original link directive file becomes as follows:
    MEMORY RAM : (000ff700H, 00000800H)

    If the following stack area is separately defined with respect to this, the RAM area should also be re-defined in the link directive file.
    Stack name: STACK_NAME (any name is possible)
    Start address of stack area: 0ffe00H
    Stack size: 0e0H

    MEMORY RAM: (0ff700H,700H)
    MEMORY STACK: (0ffe00H,0e0H)

  2. From the Property panel of the build tool, enter the stack name "STACK_NAME" in [Link Options] tab -> [Stack] -> [Area name].

For details on link directives, refer to the following from here.
CHAPTER 5, LINK DIRECTIVE SPECIFICATIONS, in
CubeSuite+ Integrated Development Environment User's Manual: RL78, 78K0R Coding

Suitable Products
CS+ (formerly CubeSuite+)
C Compiler Package for RL78 and 78K Families
Compiler for RL78 Family and 78K0R [CA78K0R]