Renesas Technology, Tools FAQs
Last Updated: June 7, 2004
Document Number: 04042001_e
Q.
When describing a program without using the standard library functions, is there any problem with the size of the heap area being 0
(zero)?
A.
If you are not using the C standard function at all, there is no problem with the heap area size being 0 (zero).
However, the startup program (*) of the sample bundled with the M3T-CC32R requires use of the heap area because the user main
function is called through the _c_main function when the standard library is initialized before the main function.
When setting the heap area size to 0, modify the section of the startup program that calls up c_main function so that it calls the main
function.
(1)Using HEW
[Creating a new program]
Remove the check next to the [Use Standard I/O Library] in [New Project-3/6 - Setting the Contents of Files to be Generated].
[Project operations]
Go to [Option (O)], open [Renesas M32R Standard Toolchain], select the [Assembly] tab, and set the [Category] to [Source].
When the display changes, set [Show entries for] to [Defines]. The main function will be called when the value of
__STANDARD_IO__ is set to 0. (_c_main function is called when this value is 1.)
(2)When using either the TM default or start.ms in the smp32R directory, please change the following two items as shown.
[Line 25]
.import $_c_main -> .import $main
[Lines 76 and 77]
SETH R0, #HIGH($_c_main) -> SETH R0,#HIGH($main)
OR3 R0, R0, #LOW($_c_main) -> OR3 R0, R0, #LOW($main)
* When using HEW and TM, the sample startup program is set to the default values.
Notes:
standard functions that use the heap area are functions that require the low-level function _get_core. Standard functions that require
_get_core are described in the M3T-CC32R Users Manual <C Compiler>, Chapter 11.1.1 The Low-level Library for the C Standard
Library, "Table 11.3 C Standard Library vs Low-level Library".
Top of Page | Back to Previous Page
Terms of Use Privacy Policy
(C)2004 Renesas Technology Corp., All Rights Reserved.
Kommentare zu diesen Handbüchern