FILES
Program diagnostics Outputs program diagnostic information. <assert.h>
Character handling Handles and checks characters. <ctype.h>
Mathematics Performs numerical calculations such as
trignometric functions.
<math.h> <mathf.h>
Non-local jumps Supports transfer of control between functions. <setjmp.h>
Variable arguments Supports access to variable arguments for
functions with such arguments.
<stdarg.h>
Input/output Performs input/output handling. <stdio.h>
General utilities Performs C program standard processing such as
storage area management.
<stdlib.h>
String handling Performs string comparison, copying, etc. <string.h>
Complex arithmetic Performs complex numeric operations. <complex.h>
Floating-point environment Supports access to floating-point environment. <fenv.h>
Integer type format conversion
Manipulates greatest-width integers and converts integer format.
<inttypes.h>
Multibyte and wide characters
Manipulates multibyte characters. <wchar.h>
<wctype.h>
Source: Compiler Package User Manual, Renesas 32-Bit Microcomputer, RX Family/RX600 Series. Renesas Electronics America, Inc., 2010. Table 9.26, page 328.
TABLE 4.3 Header Files that Contain Macros. STANDARD
INCLUDE FILE DESCRIPTION
<stddef.h> Defines macro names used in common by the standard include files.
<limits.h> Defines various limit values relating to the compiler internal processing.
<errno.h> Defines the value to be set in errno when an error is generated in a library function. <float.h> Defines various limit values relating to the limits of floating-point numbers. <iso646.h> Defines alternative spellings of macro names.
<stdbool.h> Defines macros relating to logical types and values.
<stdint.h> Declares integer types with specified width and defines macros.
<tgmath.h> Defines type-generic macros.
Source: Compiler Package User Manual, Table 9.27, pg. 329.
TABLE 4.4 Header Files Used in Demo Program of RX62N Microcontroller Board.
STANDARD
INCLUDE FILE DESCRIPTION
<config.h> Defines macros relating to the font size.
<glyph.h> Defines external constants, typedef enumerations and structures,
prototype for minimum, and full access for glyph API library.
<preamble.h> Defines basic definitions of all simple constants and types.
<st7579_lcd.h> Defines prototypes that are required by the LCD driver in the glyph API.
<yrdkrx62n_rspio.h> Defines prototypes for the glyph communication API.
<typedefine.h> Defines aliases of Integer Type.
<sbrk.h> Defines macro relating to size of area managed by sbrk.
<vect.h> Defines vector table.
<stacksct.h> Defines macros that refer to setting of stack area.
<iodefine.h> Define various input and output registers.
4.3 BASIC EXAMPLES
(Source: High-performance Embedded Workshop V.4.08, User’s Manual. Renesas Elec- tronics America, Inc., 2010.)
EXAMPLE 1
This is an example demonstrating how to Build, Debug, and Run a Project on the HEW-IDE. If you are testing your board for the first time, you will test it with the demo code that comes with the package. After launching the main window, you probably want to down- load and run it on the board. Follow these steps to acquaint yourself with the whole process:
Step 1: Ensure that ‘SessionRX600_E1_E20_SYSTEM’ session in the right-hand drop-
down list on the tool bar is selected.
Step 2: Click the <Connect> button on the ‘debug’ toolbar.
When you click on the connect button, an initial settings window will appear. Ensure that you select the right MCU group and device. Select the debugging mode as shown in Figure 4.10.
After clicking OK, a window will pop up which will show the status as connecting. This window indicates whether an initial configuration has been done or not. See Figure 4.11 to get an idea.
Figure 4.11 Window showing the status as connecting.
This window will show up for just a few seconds, and after that a configuration properties window will appear. You can see various configuration properties associated with MCU,
system, Internal flash memory overwrite, and external flash memory. You can select
any of them and edit the properties as your application demands. If you go to the MCU tab on the same window, you need to select one of three operating modes; i.e., on chip ROM
enabled extended mode, on chip ROM disabled extended mode,or single chip mode.
For the demo application, you can go on with the settings shown in the Figure 4.12.
Figure 4.12 Window showing configuration properties.
Once connected, you can see the status in the output window (Figure 4.13) as ‘connected.’ Also, you can see the status of the platform tab of other component windows. Here is the snapshot:
Figure 4.13 Window showing the status after the board has connected.
Step 3: The next step is building the program to check for any compiling error. Typically, in
build process, each phase of the build takes a set of project files and builds them. If every file builds successfully, then the next phase is executed. Let me shed some light on the build process. The building process takes place in three phases: the Compiler is the first phase, the Assembler is the second phase, and the Linker is the third and final phase. During the Com- piler phase, the C/C source files from the various projects are compiled in turns. During the Assembler phase, the assembler source files are assembled. During the Linker phase, all library files and output files from the Compiler and Assembler phases are linked together to produce the load module. Depending on your requirement, you can choose from the various build options available to you. If you want to build an individual file, first select it from proj- ect tab of the workspace window, and then you can select any one of these options:
䡲 Click the Build File toolbar button (Figure 4.14) 䡲 Select Build <file> from the pop-up menu 䡲 Select the [Build V Build File] menu option 䡲 Press CTRL F7
If you want to build a project, you can select any one of these:
䡲 Click the Build toolbar button (Figure 4.14) 䡲 Press F7
䡲 Select [Build V Build]
䡲 Right-click on a project in the Project tab of the Workspace window and select
Typically, the build operation compiles or assembles those files that are changed since the last build command. The Build all operation builds all files irrespective of whether the file has been modified or not.
For performing a build all operation, you may select any of these options:
䡲 Click the Build All toolbar button (Figure 4.14) 䡲 Select [Build V Build All]
䡲 Right-click on a project in the Projects tab of the Workspace window and select
[Build V Build All]from the pop-up menu
In each of the cases discussed, you can see the status of the build process in the build tab of the output window. An example that shows the status in the output window after the build process is next.
EXAMPLE