This document describes, with the use of sample projects, how to build files output from the Smart Configurator for
RH850/F1KM devices in the various integrated development environments.
9.3 Adding the Application Code to the User Code Area ............................................................ 57
9.4 Adding the Application Code to main() .................................................................................. 58
R01AN4422EJ0120 Rev.1.20 Page 2 of 58
02 Mar, 2020
Smart Configurator Guide on Sample Projects for RH850/F1KM Devices
Type
Name
Abbreviation in This
Manual
IDE
CS+ for CC V7.00.00 or later
CS+
Toolchain
C Compiler Package for RH850 Family
CCRH
Toolchain
Real-time OS for RH850 Family [RI850V4] V2
RI850V4
IDE
MULTI v7.1.6 or later
MULTI
Toolchain
Green Hills Compiler
GHS CCRH850
IDE
IAR Embedded Workbench for RH850 V1.40.5 or later
IAREW
Toolchain
IAR C/C++ Compiler
IAR ICC
1. Overview
1.1 Purpose
This document describes, with the use of sample projects, how to build files output from the Smart Configurator for
RH850/F1KM devices in the various integrated development environments.
When applying this application note to a microcontroller, change the contents in accord with the specifications of the
microcontroller you are using and validate the correct operation of the sample projects.
1.2 Operating Environment
Install the Smart Configurator and tools to be used in order to create or build programs in each integrat ed de vel o pme nt
environment based on the source files generated by the Smart Configurator with the use of the sample projects.
For details on how to use your integrated development environment, refer to the user’s manual for the integrated
development environment you are using.
Table 1-1 Operating Environment
Green Hills is a registered trademark of Green Hills Software, Inc. in the United States and other countries.
IAR Embedded Workbench is a registered trademark of IAR Systems.
R01AN4422EJ0120 Rev.1.20 Page 3 of 58
02 Mar, 2020
Smart Configurator Guide on Sample Projects for RH850/F1KM Devices
Explanatory
Section
Section 2
intprg
File defining the EI maskable interru pt
Section 2
iodefine.h
Renesas CCRH header file defining the
RH850/F1KM-S4 devices
Section 4
SC_CS+CCRH
R7F701651
S4)
Project for CS+ for CC and CCRH compiler
Section 5
SC_CS+GHSCCRH850
R7F701649
S4)
Project for CS+ for CC and GHS CCRH850
Section 6
SC_CS+RI850V4
R7F701649
S4)
Project for CS+ for CC, CCRH compiler,
Section 7
SC_MULTI
R7F701645
Project for MULTI and GHS CCRH850
Section 8
SC_IAREW
R7F701645
S4)
Project (workspace) for IAREW and IAR
2. Outline of the Sample Projects
The Smart Configurator for RH850/F1KM devices outputs a main function and source files that initialize peripheral
modules that were set by components of the Smart Configurator. After the microcontroller has been reset, the
initialization processing that is to be performed before execution of the main function and the startup routine that starts
the main function and handles other processing are not output.
Therefore, we have prepared sample projects that include startup of the sample projects so that code for peripheral
modules according to the settings in the Smart Configurator and user applications employing this code can be built
immediately.
2.1 List of Sample Projects
The Smart Configurator for RH850/F1KM devices provides the following sample projects.
For details on the sample projects, see the descriptions in the relevant sections.
Table 2-1 Sample Projects
Folder Name Target Device Description
vector table for RH850/F1KM-S1 and
RH850/F1KM-S4 devices
registers for RH850/F1KM-S1 and
(RH850/F1KM-
(RH850/F1KM-
(RH850/F1KM-
compiler
and RI850V4
R01AN4422EJ0120 Rev.1.20 Page 4 of 58
02 Mar, 2020
(RH850/F1KMS4)
(RH850/F1KM-
compiler
ICC compiler
Smart Configurator Guide on Sample Projects for RH850/F1KM Devices
2.2 Notes on the Sample Projects
1. The Smart Configurator outputs the reg ister descriptors according to iodefine.h for the Renesas CCRH compiler.
Though header files of register definitions are also prepared in the GHS CCRH850 and IAR ICC compilers, include
iodefine.h for the Renesas CCRH compiler when building files generated by the Smart Configurator.
2. The Smart Configurator uses interrupts with the table lookup method as the method for selecting the interrupt
handler addresses. The address where the table starts is set as 0x00000200 in the sample projects.
3. The definition of the interrupt vector table of peripheral modules that was set in the Smart Configurator is reflected
in smc/general/r_cg_intvector.c, which is output by the Smart Configurator. The file sc_intprg-S1.c or sc_intprgS4.c in the intprg folder defines the vector table of EI maskable interrupt sources, which is not set by the Smart
Configurator.
4. Settings of files and sections provided with the sample projects are examples. They should be changed or created
newly by yourself to match the specifications of the microcontroller in use and the customer's system.
R01AN4422EJ0120 Rev.1.20 Page 5 of 58
02 Mar, 2020
Smart Configurator Guide on Sample Projects for RH850/F1KM Devices
Operations in CS+
Operations in the Smart Configurator
Starting CS+
Creating a CS+ project
Starting the Smart Configurator
Setting clocks and peripheral modules
Generating a source file
Creating the user application
Building
Execution and debugging
Registering source files
Preparing a startup file to suit the user
3. Basic Procedures for Operating the Smart Configurator
This section describes the basic operating procedures when building a user application with the files output from the
Smart Configurator for RH850/F1KM devices.
The basic operating procedures in each integrated development environment without the use of the sample projects are
described here. For the operating procedure when using a sample project, see the relevant section among sections 4 to 8,
in accordance with the sample project you will be using.
3.1 CS+ Environment
application
Setting build options (sections, etc.) to suit
the user application
R01AN4422EJ0120 Rev.1.20 Page 6 of 58
02 Mar, 2020
Figure 3.1 Basic Operating Procedure in the CS+ Environment
Smart Configurator Guide on Sample Projects for RH850/F1KM Devices
Operations in MULTI
Operations in the Smart Configurator
Starting MULTI
Starting the Smart Configurator
Setting clocks and peripheral modules
Generating a source file
Creating the user application
Building
Execution and debugging
Loading a MULTI project
Preparing a startup file to suit the user
application
Generating a MULTI project to
3.2 MULTI Environment
Creating a Smart Configurator project
Setting build options (sections, etc.) to suit
the user application
which the source file is registered
Figure 3.2 Basic Operating Procedure in the MULTI Environment
R01AN4422EJ0120 Rev.1.20 Page 7 of 58
02 Mar, 2020
Smart Configurator Guide on Sample Projects for RH850/F1KM Devices
Operations in IAREW
Operations in the Smart Configurator
Starting IAREW
Loading the connection file for the IAREW
Starting the Smart Configurator
Creating the user application
Building
Execution and debugging
Creating a workspace or project
Generating a source file
Setting clocks and peripheral modules
Preparing a startup file to suit the user
Generating a connection file for an IAREW
3.3 IAREW Environment
Creating a Smart Configurator project
project
project to which the sourc e file is registered
application
Setting build options (sections, etc.) to suit
the user application
Figure 3.3 Basic Operating Procedure in the IAREW Environment
R01AN4422EJ0120 Rev.1.20 Page 8 of 58
02 Mar, 2020
Smart Configurator Guide on Sample Projects for RH850/F1KM Devices
File Name
Outline of File
SC_CS+CCRH.mtpj
Project file for CS+
sc_boot.asm
Definition of the processing from a reset up to branching to the
startup routine and definition of the interrupt vector table
sc_cstart.asm
Definition of the startup routine to be execu ted unt il branching
sc_intprg.c
Definition of the EI-level maskable interrupt vector table
iodefine.h
Definitions of registers
4. Desc r iption of the Sample Project for CS+ and CCRH
4.1 Configuration of the Sample Project for CS+ and CCRH
The following shows the configuration of the sample project.
Table 4-1 File Configuration of the Sample Project for CS+ and CCRH
to the main function
The Smart Configurator does not output the above files.
R01AN4422EJ0120 Rev.1.20 Page 9 of 58
02 Mar, 2020
Smart Configurator Guide on Sample Projects for RH850/F1KM Devices
Operations in CS+
Operations in the Smart Configurator
(1) Starting CS+
(5) Setting clocks and peripheral modules
(6) Generating a source file
(7) Creating the user applicatio n
(8) Building
(9) Execution and debugging
Registering source files
(4) Starting the Smart Configurator
(3) Changing the device and replacing the
4.2 Basic Operating Procedure
Figure 4.1 shows the operating procedure when using the Smart Configurator based on a sample project.
(2) Loading the CS+ sample project
sc_intprg.c file
Figure 4.1 Operating Procedure for the Sample Project for CS+ and CCRH
R01AN4422EJ0120 Rev.1.20 Page 10 of 58
02 Mar, 2020
Smart Configurator Guide on Sample Projects for RH850/F1KM Devices
(1) Starting CS+
In the [Start] menu of Windows, select [Renesas Electronics CS+] → [CS+ for CC(RL78,RX,RH850)].
(2) Loading the CS+ sample project
From the [Open...] item of the [File] menu or [Open Existing Project] of CS+, select "SC_CS+CCRH.mtpj".
(3) Changing the device
The R7F701651 (RH850/F1KM-S4) is selected as the target device in the sample project. If you are using
another device, change the target device and file to be used with reference to section 4.3, "Procedure for
Changing the Device". If the device does not require changing, proceed to step (4).
(4) Starting the Smart Configurator
(4)-1. Confirm the setting of the path for the Smart Configurator for RH850/F1KM devices. In the Project Tree panel,
select [Smart Configurator (Design Tool)] and open the [Property] panel. Confirm that the path in which the
Smart Configurator for RH850/F1KM devices was installed is set in [Smart Configurator for RH850
executable file path].
(4)-2. Start the Smart Configurator for RH850/F1KM devices by double-clicking on [Smart Configurator (Design
Tool)] in the Project Tree panel.
R01AN4422EJ0120 Rev.1.20 Page 11 of 58
02 Mar, 2020
Smart Configurator Guide on Sample Projects for RH850/F1KM Devices
For steps (5) to (7), the procedure for setting clocks and components and generating a driver in the Smart
Configurator, see section 9, "Operations in the Smart Configurator".
(8) Building
Build the driver and application code. Select [Build Project] from the [Build] menu or click on the [Builds the
project. (F7)] button in the toolbar of CS+.
(9) Execution and debugging
For program execution and debugging in the emulator, refer to CS+ V7.00.00 Integrated Development Environment User’s Manual: RH850 Debug Tool (R20UT4299).
R01AN4422EJ0120 Rev.1.20 Page 12 of 58
02 Mar, 2020
Smart Configurator Guide on Sample Projects for RH850/F1KM Devices
Start
End
4.3 Procedure for Changing the Device
When the target device of the sample project in Table 2-1, "Sample Projects" differs from the device th a t is ac tually to
be used, the target device or file to be used must be changed according to the following procedure.
(1) Changing the microcontroller
(2) Replacing the sc_intprg.c file
Figure 4.2 Changing the Target Device of the Sample Project (CS+ Project)
(1) Changing the microcontroller
(1)-1. Select "R7F701651 (Microcontroller)" and then select [Change Microcontroller...] from the context menu.
Click on the [OK] button in the [Question] dialog box that appears.
R01AN4422EJ0120 Rev.1.20 Page 13 of 58
02 Mar, 2020
Smart Configurator Guide on Sample Projects for RH850/F1KM Devices
(1)-2. In the [Change Microcontroller] dialog box, select the RH850/F1KM-S1 or RH850/F1KM-S4 device to be
used.
Example: Changing from R7F701651 (RH850/F1KM-S4) to R7F701684 (RH850/F1KM-S1)
(1)-3. Confirm that the microcontroller displayed in the Project Tree panel has become the device after the change.
(1)-4. Save the project by selecting [Save Project] from the [File] menu.
R01AN4422EJ0120 Rev.1.20 Page 14 of 58
02 Mar, 2020
Smart Configurator Guide on Sample Projects for RH850/F1KM Devices
(2) Replacing the sc_intprg.c file
This step is only necessary when a device of the RH850/F1KM-S4 Group was changed to a device of the
RH850/F1KM-S1 Group in step (1).
(2)-1. Since the sc_intprg.c file included in the sample project is for RH850/F1KM-S4 devices, it should be replaced
with a file for RH850/F1KM-S1 devices. In Windows Explorer, rename sc_intprg-S1.c in the intprg folder
"sc_intprg.c" and replace sc_intprg.c of the sample project with this file.
(Files to which the description does not apply are omitted from this figure.)
R01AN4422EJ0120 Rev.1.20 Page 15 of 58
02 Mar, 2020
Smart Configurator Guide on Sample Projects for RH850/F1KM Devices
4.4 Settings in the Sample Project for CS+ and CCRH
The sample project is created in CS+ as an [Empty Application(CC-RH)] project. The include path is added and settings
of the following options are changed.
R01AN4422EJ0120 Rev.1.20 Page 16 of 58
02 Mar, 2020
Smart Configurator Guide on Sample Projects for RH850/F1KM Devices
File Name
Outline of File
SC_CS+GHSCCRH850.mtpj
Project file for CS+
Definition of the processing from a reset up to branching
Definition of the exception interrupt vector table (macro
definitions)
sc_linkerdr.ld
Linker directive file
sc_intprg.c
Definition of the EI-level maskable interrupt vector table
iodefine.h
Definitions of registers
5. Desc r iption of the Sample Project for CS+ and GHS CCRH850
5.1 Configuration of the Sample Project for CS+ and GHS CCRH850
The following shows the configuration of the sample project.
Table 5-1 File Configuration of the Sample Project for CS+ and GHS CCRH850
sc_startup.850
dr7f701649_irq.h
The Smart Configurator does not output the above files.
to the given application project, definition of the exception
interrupt vector table, and definition of the startup routine
up to branching to the main function
R01AN4422EJ0120 Rev.1.20 Page 17 of 58
02 Mar, 2020
Smart Configurator Guide on Sample Projects for RH850/F1KM Devices
Operations in CS+
Operations in the Smart Configurator
(1) Starting CS+
(5) Setting clocks and peripheral modules
(6) Generating a source file
(7) Creating the user applicatio n
(8) Building
(9) Execution and debugging
Registering source files
(4) Starting the Smart Configurator
(3) Changing the device, replacing the
directive file
5.2 Basic Operating Procedure
Figure 5.1 shows the operating procedure when using the Smart Configurator based on a sample project.
(2) Loading the CS+ sample project
sc_intprg.c file and editing Linker
Figure 5.1 Operating Procedure for the Sample Project for CS+ and GHS CCRH850
R01AN4422EJ0120 Rev.1.20 Page 18 of 58
02 Mar, 2020
Smart Configurator Guide on Sample Projects for RH850/F1KM Devices
(1) Starting CS+
In the [Start] menu of Windows, select [Renesas Electronics CS+] → [CS+ for CC(RL78,RX,RH850)].
(2) Loading the CS+ sample project
From the [Open...] item of the [File] menu or [Open Existing Project] of CS+, select
"SC_CS+GHSCCRH850.mtpj".
(3) Changing the device
The R7F701649 (RH850/F1KM-S4) is selected as the target device in the sample project. If you are using
another device, change the target device and file to be used with reference to section 5.3, "Procedure for
Changing the Device". If the device does not require changing, proceed to step (4).
(4) Starting the Smart Configurator
(4)-1. Confirm the setting of the path for the Smart Configurator for RH850/F1KM devices. In the Project Tree panel,
select [Smart Configurator (Design Tool)] and open the [Property] panel. Confirm that the path in which the
Smart Configurator for RH850/F1KM devices was installed is set in [Smart Configurator for RH850
executable file path].
(4)-2. Start the Smart Configurator for RH850/F1KM devices by double-clicking on [Smart Configurator (Design
Tool)] in the Project Tree panel.
R01AN4422EJ0120 Rev.1.20 Page 19 of 58
02 Mar, 2020
Loading...
+ 42 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.