Renesas RL78 APPLICATION NOTE

APPLICATION NOTE
R20AN0581EC0100
Rev.1.00
Apr.01.21
RL78 Smart Configurator
User’s Guide: IAREW
Introduction
This application note describes the basic usage of the RL78 Smart Configurator (hereafter called the Smart Configurator), and the procedure for importing its output files to IAR Embedded Workbench.
References to the Smart Configurator and Integrated Development Environment (IDE) in this application note apply to the following version.
IAR Embedded Workbench for Renesas RL78 V4.20.1
Target device and support compiler
Refer to the following URL for the range of supported devices:
https://www.renesas.com/smart-configurator
R20AN0581EC0100 Rev.1.00 Page 1 of 65 Apr.01.21
RL78 Smart Configurator User’s Guide: IAREW
Contents
Overview ......................................................................................................................... 4
Purpose ........................................................................................................................................ 4
Features ....................................................................................................................................... 4
Software Components ................................................................................................................ 4
Before Using the Smart Configurator ........................................................................... 5
Creating a New IAR C Project File ............................................................................................. 5
Installing the Smart Configurator .............................................................................................. 6
Uninstalling the Smart Configurator ......................................................................................... 6
Operating the Smart Configurator ................................................................................. 7
Procedure for Operations ........................................................................................................... 7
Starting the Smart Configurator ................................................................................................ 9
Create and Loading a Configuration File ................................................................................ 10
Creating a New Smart Configurator Configuration File .................................................. 10
Opening an Existing Configuration File ........................................................................... 11
Window ....................................................................................................................................... 12
Main Menu ............................................................................................................................ 13
Toolbar ................................................................................................................................. 13
Smart Configurator View .................................................................................................... 14
MCU Package View ............................................................................................................. 14
Console View ....................................................................................................................... 15
Configuration Problems View ............................................................................................ 15
Setting of Peripheral Modules ..................................................................................... 16
Board Setting ............................................................................................................................. 16
Selecting the Device ........................................................................................................... 16
Selecting the Board ............................................................................................................ 17
Exporting Board Settings ................................................................................................... 18
Importing Board Settings ................................................................................................... 18
Clock Settings ........................................................................................................................... 19
System Settings ........................................................................................................................ 20
Component Settings ................................................................................................................. 21
Switching Between the Component View and Hardware View ...................................... 21
Adding a Software Component ......................................................................................... 22
Removing a Software Component .................................................................................... 24
Setting a Code Generator Component ............................................................................. 25
Changing the Resource for a Code Generator Component ........................................... 26
Setting SNOOZE Mode Sequencer (SMS) Component ................................................... 28
Update SMS Data Files ....................................................................................................... 31
Logic Event Link Controller (ELCL) Modules Download ................................................ 32
R20AN0581EC0100 Rev.1.00 Page 2 of 65 Apr.01.21
RL78 Smart Configurator User’s Guide: IAREW
Setting an ELCL Component ............................................................................................. 33
Downloading RL78 Software Integration System Modules ............................................ 34
Setting a RL78 Software Integration System Module...................................................... 35
Changing Version of BSP Configuration .......................................................................... 35
Configure General Setting of Component ........................................................................ 37
Pin Settings................................................................................................................................ 39
Changing the Pin Assignment by PIOR Function ........................................................... 40
Changing the Pin Assignment of a Software Component .............................................. 41
Assigning Pins Using the MCU Package View ................................................................ 42
Exporting Pin Settings ....................................................................................................... 43
Importing Pin Settings ........................................................................................................ 43
Pin Setting Using Board Pin Configuration Information................................................. 44
Pin Filter Feature ................................................................................................................. 44
Interrupt Settings ...................................................................................................................... 45
Changing Interrupt Priority Setting ................................................................................... 45
Changing Interrupt Bank Setting ....................................................................................... 46
Managing Conflicts ...................................................................................................... 47
Resource Conflicts ................................................................................................................... 47
Resolving Pin Conflicts ............................................................................................................ 47
Generating Source Code ............................................................................................. 49
Generating Source Code File ................................................................................................... 49
Configuration of Generated Files and File Names................................................................. 50
Initializing Clocks ...................................................................................................................... 53
Initializing Pins .......................................................................................................................... 54
Initializing Interrupts ................................................................................................................. 55
Loading Generated Files in Integrated Development Environment .......................... 56
Loading in IAR Embedded Workbench ................................................................................... 56
Save and Build IAR Project File ............................................................................................... 58
Creating User Programs .............................................................................................. 59
Adding Custom Code ............................................................................................................... 59
Backing up Generated Source Code ........................................................................... 61
Generating Reports ...................................................................................................... 62
Report on All Configurations (PDF or Text File) .................................................................... 62
Configuration of Pin Function List and Pin Number List (in csv Format) ........................... 63
Image of MCU Package (in png Format) ................................................................................. 63
Help ............................................................................................................................... 64
Documents for Reference ............................................................................................ 65
R20AN0581EC0100 Rev.1.00 Page 3 of 65 Apr.01.21
RL78 Smart Configurator User’s Guide: IAREW

Overview

Purpose

This application note describes the basic usage of the RL78 Smart Configurator (hereafter called the Smart Configurator), and the procedure for importing its output files to IAR Embedded Workbench.
Refer to the User’s Manual of IAR Embedded Workbench for how to use them.

Features

The Smart Configurator is a utility for combining software to meet your needs. It handles the following three functions to support the embedding of drivers from Renesas in your systems: importing middleware in the form of SW integration feature, generating driver code, and making pin settings.

Software Components

The Smart Configurator supports three types of software components: Code Generator, Graphical Configurator, and RL78 Software Integration System:
(1) Code Generator drivers (DTC, A/D Converter, Interrupt Controller, etc.)
The Code Generator drivers is a control program for peripheral functions of microcomputer such as DTC, A/D converter, Interrupt Controller, etc. It is convenient to embed a software component using code generation function.
(2) Graphical Configurator (SMS, ELCL)
The Graphical Configurator module makes it easy to set up complex configurations by providing a graphical GUI compared to other drivers. It provides software components for SNOOZE mode sequencer (SMS) and logic and event link controller (ELCL).
(3) RL78 Software Integration System (CAPACITIVE SENSING UNIT (CTSU2L), etc.)
The RL78 Software Integration System module is a software component of drivers, middleware SW that provides a simple GUI for generating code.
R20AN0581EC0100 Rev.1.00 Page 4 of 65 Apr.01.21
RL78 Smart Configurator User’s Guide: IAREW

Before Using the Smart Configurator

Creating a New IAR C Project File

(1) Select [Create New Project…] from the [Project] menu of IAR Embedded Workbench, to create a C
project.
Figure 2-1. Create an IAR C Project
(2) Please input project name and specify the path location for saving project files.
Figure 2-2. Specify *.ewp File
(3) After step (2), a new C project workspace is created successfully in IAR IDE.
R20AN0581EC0100 Rev.1.00 Page 5 of 65 Apr.01.21
RL78 Smart Configurator User’s Guide: IAREW

Installing the Smart Configurator

Download the Smart Configurator from the URL below.
https://www.renesas.com/smart-configurator
After activating the installer, install the Smart Configurator by following the procedure of the installer. You will require administrator privileges to do this.

Uninstalling the Smart Configurator

If you wish to uninstall the Smart Configurator, select “Smart Configurator for RL78” from [Apps & features] in the control panel.
R20AN0581EC0100 Rev.1.00 Page 6 of 65 Apr.01.21
RL78 Smart Configurator User’s Guide: IAREW

Operating the Smart Configurator

Procedure for Operations

Figure 3-1 Operating Procedure, shows the procedure for generating a source file using Smart Configurator and loading it into IAR Embedded Workbench. For the operation of IAR Embedded Workbench, refer to relevant document of IAR.
R20AN0581EC0100 Rev.1.00 Page 7 of 65 Apr.01.21
RL78 Smart Configurator User’s Guide: IAREW
Operations in the IAR Embedded Workbench
Operations in the Smart Configuration
Starting the Smart Configurator
Create and loading a configuration file
Setting of peripheral modules
Generating source code
Setting of interrupts
Refer to ‘3 Operating the Smart
Refer to ‘4 Setting of Peripheral Modules’
Refer to ‘4.6 Interrupt Settings
Refer to ‘6 Generating Source Code’
Creating the user program
Refer to ‘8 Creating User Programs
Building
Generating reports
Refer to ‘10 Generating Reports’
Setting pins
Refer to ‘4.5 Pin Settings
Refer to ‘3.3 Create and Loading a
Loading generated files in IDE
Refer to ‘7 Loading Generated Files in
Create an IAR project file
Refer to ‘2.1 Creating a New IAR C
Execution and debugging
Refer to ‘7.2 Save and Build IAR
Configurator
Configuration File
Project File’
R20AN0581EC0100 Rev.1.00 Page 8 of 65 Apr.01.21
Integrated Development Environment
Figure 3-1. Operating Procedure
RL78 Smart Configurator User’s Guide: IAREW

Starting the Smart Configurator

Select [Smart Configurator for RL78 Vx.x.x] of [Renesas Electronics Smart Configurator] from the Windows start menu. The main window of the Smart Configurator will be starting.
Note: Please replace Vx.x.x with your version.
Figure 3-2. Starting of Smart Configurator
R20AN0581EC0100 Rev.1.00 Page 9 of 65 Apr.01.21
RL78 Smart Configurator User’s Guide: IAREW
(1)
(2)
(3)
(4)
(5)

Create and Loading a Configuration File

Smart Configurator saves and refers to the configuration file (*. scfg) the configuration information of the microcontroller, build tool, peripheral function, pin function etc. used in the project.

Creating a New Smart Configurator Configuration File

On the main window, click the [New Configuration File] button to display the [New Smart Configuration File] dialog box.
(1) In [Platform:] panel, select the device.
(2) In [Toolchain:], select [IAR RL78 Toolchain].
(3) In [File name:], enter the file name.
(4) Confirm [Location:]. Please make sure the destination path is the same as IAR C project file path (refer
to Figure 2-2 Specify *.ewp File).
(5) Click [Finish] to create the configuration file.
Figure 3-3. Create a Configuration File
(6) Add any driver component, make random setting, generate code, and save the project as *.scfg file in
the same path as IAR project which was created in IAR IDE.
R20AN0581EC0100 Rev.1.00 Page 10 of 65 Apr.01.21
RL78 Smart Configurator User’s Guide: IAREW

Opening an Existing Configuration File

On the main window, click the [Opening an Existing Configuration File] button to display the [Open] dialog box. Select the (*. scfg) file and click [Open].
.
Figure 3-4. Opening an Existing Configuration File
R20AN0581EC0100 Rev.1.00 Page 11 of 65 Apr.01.21
RL78 Smart Configurator User’s Guide: IAREW
(1)
(2)
(3)
(4)
(5)
(6)

Window

The main window is displayed when the Smart Configurator is started. The configuration of the window is shown in Figure 3-5, Main Window.
(1) Menu bar
(2) Main toolbar
(3) Smart Configurator view
(4) MCU Package view
(5) Console view
(6) Configuration Problems view
Figure 3-5. Main Window
R20AN0581EC0100 Rev.1.00 Page 12 of 65 Apr.01.21
RL78 Smart Configurator User’s Guide: IAREW
Menu
Details
File
New
The dialog box [New Smart Configurator File], which is used to create a new project, is displayed.
Open
The dialog box [Open], which opens an existing project, is displayed.
Save
Saves a project with the same name.
Restart
Smart Configurator is restarted.
Exit
Execution of the Smart Configurator is terminated.
Window
Preference
The dialog box [Preference], which is used to specify the properties of the project, is displayed.
displayed.
Help
Help Contents
The help menu is displayed.
Home Page
The home page is opened.
Release Notes
The release note is opened.
Tool News
The tool news is opened.
API Manual
The API manual is opened.
About
The version information is displayed.
Toolbar button
Related menu item
[File] → [Save]

Main Menu

Table 3-1, Main Menu Items, lists the items of the main menu.
Table 3-1. Main Menu Items
Show View The dialog box [Show view], which is used to set the view of the window, is

Toolbar

Some functions of the main menu are allocated to the buttons on the toolbar. Table 3-2, Toolbar Buttons and Related Menu Items, shows the description of those tool buttons.
Table 3-2. Toolbar Buttons and Related Menu Items
[File] → [New]
[File] → [Open]
R20AN0581EC0100 Rev.1.00 Page 13 of 65 Apr.01.21
RL78 Smart Configurator User’s Guide: IAREW

Smart Configurator View

The Smart Configurator view consists of seven pages: [Overview], [Board], [Clocks], [System], [Components], [Pins], and [Interrupts]. Select a page by clicking on a tab; the displayed page will be changed.
Figure 3-5. Smart Configurator View

MCU Package View

The states of pins are displayed on the figure of the MCU package. The settings of pins can be modified from here.
Two types of package view can be switched between [Assigned] and [Default Board]. [Assigned] displays the assignment status of the pin setting, and [Default Board] displays the initial pin setting information of the board. The initial pin setting information of the board is the pin information of the board selected by [Board:] on the [Board] page (refer to "4.1.2 Selecting the Board").
Figure 3-7. MCU Package View
R20AN0581EC0100 Rev.1.00 Page 14 of 65 Apr.01.21
RL78 Smart Configurator User’s Guide: IAREW

Console View

The Console view displays details of changes to the configuration made in the Smart Configurator or MCU Package view.
Figure 3-6. Console View

Configuration Problems View

The Configuration Problems view displays the details of conflicts between driver used interrupts, configured peripherals, used pins, used settings.
Figure 3-7. Configuration Problems View
R20AN0581EC0100 Rev.1.00 Page 15 of 65 Apr.01.21
RL78 Smart Configurator User’s Guide: IAREW
Button
Operation explanation
Yes
Change to the selected device.
No
It does not change the device.
Save and continue
(Note*1)
After saving the current configuration contents to the configuration file, change to the selected device.
Continue
(Note*1)
Changes to the selected device without saving the current configuration contents to the configuration file.
Cancel
(Note*1)
It does not change the device.

Setting of Peripheral Modules

You can select peripheral modules from the Smart Configurator view.

Board Setting

You can change the board and device on the [Board] page.

Selecting the Device

Click on the [ ] button to select a device.
Figure 4-1. Selecting the Device
The following message is displayed when changing the device. For each button operation, refer to "Table 4-1, Device Change Confirmation Operation List".
Figure 4-2. Confirm Device Change
Table 4-1. Device Change Confirmation Operation List
Note *1: Smart Configurator view is marked with dirty *.
R20AN0581EC0100 Rev.1.00 Page 16 of 65 Apr.01.21
RL78 Smart Configurator User’s Guide: IAREW
Button
Operation explanation
Save and continue
After saving the current configuration contents to the configuration file, change to the selected device.
Continue
Changes to the selected device without saving the current configuration contents to the configuration file.
Cancel
It does not change the device.

Selecting the Board

By selecting a board, the following settings can be changed at one time.
Pin assignment (Initial pin setting)
Frequency of the main clock
Frequency of the subsystem clock
• Target device
The board setting information is defined in the Board Description File (.bdf).
The .bdf file of Renesas made board (e.g. Renesas Starter Kit) can be downloaded from website and imported.
In addition, by downloading the .bdf file provided by the alliance partner from website and importing it, it is possible to select alliance part boards.
Figure 4-3. Selecting the Board
If you change the board, the message shown in “Figure 4-2” or the following message will be displayed. For each button operation, refer to "Table 4-2, Board Change Confirmation Operation List".
Figure 4-4. Confirm Board Change
Table 4-2. Board Change Confirmation Operation List
R20AN0581EC0100 Rev.1.00 Page 17 of 65 Apr.01.21
RL78 Smart Configurator User’s Guide: IAREW
(1)
(2)
(1)

Exporting Board Settings

Follow the procedure below to export the board settings.
(1) Click on the [ (Export board setting)] button on the [Board] tabbed page.
(2) Select the output location and specify a name (Display Name) for the file to be exported.
Figure 4-5. Exporting Board Settings (bdf Format)

Importing Board Settings

Follow the procedure below to import board settings.
(1) Click on the [ (Import board setting)] button and select a desired bdf file.
(2) The board of the imported settings is added to the board selection menu.
Figure 4-6. Importing Board Settings (bdf Format)
Once a board setting file is imported, the added board is also displayed in the board selection menu of other projects for the same device group.
R20AN0581EC0100 Rev.1.00 Page 18 of 65 Apr.01.21
RL78 Smart Configurator User’s Guide: IAREW
(1)
(2)
(3)
(4)
(4)
(4)
(4)

Clock Settings

You can set the system clock on the [Clocks] page. The settings made on the [Clocks] page are used for all drivers.
Follow the procedure below to modify the clock settings.
(1) Specify the operation mode and EVDD setting.
(2) Select the clocks required for device operations on the board (the high-speed on-chip oscillator is
selected by default).
(3) Specify the frequency of each clock in accordance with the board specifications (note that the frequency
is fixed for some internal clocks).
(4) For the multiplexer symbol, select the clock source for the output clocks.
Figure 4-7. [Clocks] Page
R20AN0581EC0100 Rev.1.00 Page 19 of 65 Apr.01.21
RL78 Smart Configurator User’s Guide: IAREW
(2)
(1)
(3)
(4)

System Settings

You can set the on-chip debug setting on the [System] page. This setting is reflected in into r_bsp file.
For example, make desired setting as in below figure for illustration, after that click on [ Generate Code] button as in step (4).
Figure 4-8. Smart Configurator [System] Page Setting
The on-chip debug setting is reflected into r_bsp file in: \<ProjectDir>\src\smc_gen\r_bsp\r_config\ r_bsp_config.h file. If you want to change the on-chip debug setting code value, change your desired setting and generate code again.
Figure 4-9. On-Chip Debug Setting Code Generation
Note: Depending on the MCU type selection or chip part numbers, these setting values varies. Please refer to the latest
device HUM for the detail setting configuration
.
R20AN0581EC0100 Rev.1.00 Page 20 of 65 Apr.01.21
RL78 Smart Configurator User’s Guide: IAREW
Tree view for components
(1)
(2)

Component Settings

Drivers and middleware can be combined as software components on the [Components] page. Added components are displayed in the tree view at the left of the page.
Figure 4-10. [Components] Page

Switching Between the Component View and Hardware View

The Smart Configurator provides two tree view: Component View and Hardware View. You can Switch two view by clicking the following icons:
(1) Click on the [ (Component View)] icon. The tree view will display the components by component
category.
(2) Click on the [ (Hardware View)] icon. The tree view will display the components in a hardware
resource hierarchy.
Figure 4-11. Switching to the Hardware View
R20AN0581EC0100 Rev.1.00 Page 21 of 65 Apr.01.21
Loading...
+ 47 hidden pages