Renesas RE01B User Manual

Application Note
R01AN5310EJ0100 Rev.1.00 Page1 of 129 Mar. 15, 2021
RE01B Group
Getting Started Guide to Development Using CMSIS Package
Summary
Target Device
RE01B Group
When using this application note with other Renesas MCUs, careful evaluation is recommended after making modifications to comply with the alternate MCU.
R01AN5310EJ0100
Rev.1.00
Mar. 15, 2021
The RE01B Group CMSIS package combines the startup code and peripheral function drivers of
the RE01B Group
Chapter 2 describes an overview of the development environment. Chapter 3 provides an overview of the drivers. Chapter 4 explains the components and drivers. Chapter 5 explains basic functions (interrupts, pin settings, etc.). Chapter 6 explains how to create a user program. Chapter 7 explains how to create a project. Chapter 8 explains debugging.
Summary
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 2 of 129 Mar. 15, 2021
List of Terms
Terms
Description
Address mapping
Assignment of programs and data to specific areas in the MCU’s on-chip memory space (address space)
Callback function
A function, created by the user, that is called by a driver when a specific event occurs
CMSIS
A software interface standard specified by Arm®. CMSIS stands for Cortex® Microcontroller Software Interface Standard.
CMSIS-CORE
An MCU startup routine conforming to CMSIS
CMSIS-Driver
A peripheral function driver for a software interface conforming to CMSIS
Doxygen
A documentation generator. When comments are written in the source code in the format specified by Doxygen, reference documentation is automatically generated from the source code by Doxygen. (CMSIS provides documentation such as function specifications generated from the code in HTML format using Doxygen.)
Driver HAL
A driver with specifications exclusive to an MCU vendor (Renesas in the case of this document)
EWARM
The integrated development environment (IDE) provided by IAR Systems (EWARM: IAR Embedded Workbench® for Arm®)
ICU
RE01B interrupt controller unit
IRQ number
NVIC external interrupt input number
MTB
MTB (Micro Trace Buffer): Instruction trace method that uses a part of SRAM provided as an option for CortexM0+
NVIC
Nested vector interrupt controller mounted on Arm Cortex-M0 + etc.
R_CORE
Specifications exclusive to Renesas added to CMSIS-CORE
R_SYSTEM
Drivers exclusive to Renesas for clock switching, interrupt control, etc.
Startup
Activation processing from when the MCU is reset to the jump to the Main function
User’s manual
The MCU manual, available from Renesas
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 3 of 129 Mar. 15, 2021
Table of Contents
1. Package Summary .................................................................................................................... 6
1.1 About this document ................................................................................................................................ 6
1.2 About CMSIS ........................................................................................................................................... 6
1.3 Folder Structure ....................................................................................................................................... 8
1.4 Supported Functions ............................................................................................................................... 9
1.5 Package Features ................................................................................................................................. 10
1.6 Operation Confirmation Environment .................................................................................................... 10
2. Setting up the Development Environment ............................................................................... 12
2.1 Overview of the Project in this Package ................................................................................................ 12
2.2 Debug Environment Using EWARM ..................................................................................................... 13
2.3 e2 studio Version ................................................................................................................................... 20
3. Driver Overview ....................................................................................................................... 23
3.1 Three Types of Files Comprising the Drivers ........................................................................................ 23
3.2 Notation of Driver Name ........................................................................................................................ 23
3.3 Storage Location of Driver-related Files ................................................................................................ 24
3.4 Storage Location of Driver Specifications ............................................................................................. 25
3.4.1 Driver Specifications (PDF Format) .................................................................................................... 25
3.4.2 CMSIS-DSP Library Document (Doxygen Format) ............................................................................. 25
4. Components and Drivers ......................................................................................................... 27
4.1 Drivers Provided by Each Component .................................................................................................. 27
4.2 Common Function Drivers ..................................................................................................................... 29
4.2.1 R_CORE Driver ................................................................................................................................... 29
4.2.2 R_SYSTEM Driver .............................................................................................................................. 30
4.2.3 R_PIN Driver ....................................................................................................................................... 30
4.2.4 R_LPM Driver ...................................................................................................................................... 31
4.3 Peripheral Function Drivers ................................................................................................................... 32
4.3.1 Peripheral Function Drivers (CMSIS-Drive) ........................................................................................ 32
4.3.2 Peripheral Function Drivers (Drive HAL) ............................................................................................. 34
4.4 CMSIS-DSP Component ....................................................................................................................... 36
4.4.1 How to Get DSP Library and Import Procedure to Project .................................................................. 36
5. Basic Functions ....................................................................................................................... 44
5.1 Startup Processing ................................................................................................................................ 44
5.1.1 Pin Settings at Operation Start ............................................................................................................ 46
5.1.2 Clock and Power Control Mode Settings at Start of Operation ........................................................... 47
5.2 Control of Undefined Value Propagation Suppression Function ........................................................... 49
5.2.1 Applicable Power Supply Domains ..................................................................................................... 49
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 4 of 129 Mar. 15, 2021
5.2.2 Driver Functions .................................................................................................................................. 49
5.3 Interrupt Control..................................................................................................................................... 51
5.3.1 Interrupt Vector Table and Entry Functions ........................................................................................ 51
5.3.2 Overview of Interrupt Handling of Peripheral Functions ..................................................................... 52
5.3.3 IRQ Number Allocation ........................................................................................................................ 52
5.3.4 Editing r_system_cfg.h ........................................................................................................................ 54
5.3.5 Processing Related to Interrupts in User Application .......................................................................... 55
5.4 Clock Settings ........................................................................................................................................ 57
5.4.1 Clock Definitions .................................................................................................................................. 57
5.4.2 Driver Functions .................................................................................................................................. 58
5.5 Pin Settings ........................................................................................................................................... 59
5.5.1 Editing pin.c File in Initial Settings ....................................................................................................... 59
5.5.2 Pin Settings in User Application .......................................................................................................... 59
5.5.3 R_Pin Driver Functions ....................................................................................................................... 60
5.5.4 Edit R_PIN Driver Function ................................................................................................................. 61
5.6 Program RAM Placement ...................................................................................................................... 62
5.6.1 RAM Placement Method Using RAM Placement Section ................................................................... 63
5.6.2 Method of RAM Placement Using Forced Inline Expansion ............................................................... 68
6. Creating a User Program ......................................................................................................... 69
6.1 Preparation for User Program Creation ................................................................................................ 69
6.1.1 Preparation for Startup Processing ..................................................................................................... 71
6.1.2 Preparation of Common Function Drivers ........................................................................................... 73
6.1.3 Preparation of Peripheral Function Drivers ......................................................................................... 77
6.2 User Program Creation ......................................................................................................................... 77
6.2.1 Initial Settings ...................................................................................................................................... 79
6.2.2 Control of Peripheral Functions ........................................................................................................... 81
6.2.3 Control of Pins ..................................................................................................................................... 88
6.2.4 Controlling Interrupts ........................................................................................................................... 89
6.3 User Program Creation Example .......................................................................................................... 90
6.3.1 Example of Using a Peripheral Function Driver (USART Communication by SCI) ............................ 90
6.3.2 Example When Peripheral Function Driver is not Used (AGT Asynchronous General-purpose Timer
Application) .......................................................................................................................................... 96
7. Creating a Project .................................................................................................................. 100
7.1 EWARM Version.................................................................................................................................. 100
7.1.1 Setting Target Processor ................................................................................................................... 101
7.1.2 Linker File Setting .............................................................................................................................. 102
7.1.3 Compiler Include Path Settings ......................................................................................................... 103
7.2 e2 studio Version ................................................................................................................................. 104
7.2.1 Setting Toolchain ............................................................................................................................... 104
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 5 of 129 Mar. 15, 2021
7.2.2 Linker File Settings ............................................................................................................................ 105
7.2.3 Include Path Settings ........................................................................................................................ 106
8. Using Debugger for Downloading .......................................................................................... 107
8.1 EWARM Version.................................................................................................................................. 107
8.1.1 J-Link ................................................................................................................................................. 107
8.1.2 I-Jet .................................................................................................................................................... 109
8.2 e2 studio Version ................................................................................................................................. 110
8.2.1 J-Link ................................................................................................................................................. 110
8.3 Securing MTB Region for Debugger ................................................................................................... 114
8.4 Settings when Using Low Power Consumption Mode ........................................................................ 115
8.5 Prohibition of Software Break Setting in the Built-in Flash Memory Area ........................................... 116
8.6 Precautions when Setting a Software Break in the Built-in Flash Memory ......................................... 117
9. Appendix ................................................................................................................................ 118
9.1 List of Interrupts Used by Peripheral Function Drivers........................................................................ 118
9.2 Reference Information: Using printf Function in Operation Confirmation Environment ...................... 119
10. Troubleshooting ..................................................................................................................... 121
10.1 Q: A build error occurs ...................................................................................................................... 121
10.2 Q: When a driver function is executed, a HardFault Error occurs .................................................... 121
10.3 Q: A driver function is being executed, but the peripheral function does not run ............................. 121
10.4 Q: The return value of a driver function is normal, but the expected input or output from a peripheral
function pin cannot be confirmed ........................................................................................................ 122
10.5 Q: Writing to a peripheral function related register was performed, but does not take effect .......... 122
10.6 Q: Writing to clock and power consumption reduction function related registers was performed, but
does not take effect ............................................................................................................................. 122
10.7 Q: The debugger cannot be used to download to the target board .................................................. 123
10.8 Q: The debugger is connected but it does not work ......................................................................... 123
10.9 Q: An interrupt does not occur. ........................................................................................................... 123
11. Notes on Migrating a Program between RE01 Group ........................................................... 124
11.1 Mode Transition Example .................................................................................................................... 124
11.1.1 Transition example 1: Transitioning between boost mode and low leak current mode .................... 125
11.1.2 Transition example 2: Transitioning between normal mode and software standby mode ................ 126
11.1.3 Transition example 3: Transitioning between high-speed mode and low-speed mode .................... 127
12. Reference Documents ........................................................................................................... 128
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 6 of 129 Mar. 15, 2021

1. Package Summary

1.1 About this document

1.2 About CMSIS

This package includes the components outlined in red in Figure 1-1.
Figure 1-1 CMSIS Overview
CMSIS Software Pack
Microcontroller
Application Code
CMSIS-DSP
CMSIS-RTOS
CMSIS-Driver
Driver HAL
RTOS Kernel
CMSIS-CORE
Processor core and peripheral access
CMSIS-SVD CMSIS-DAP
Cortex
®
CPU Core
Core
Peripherals
Other
Peripherals
CoreSight
TM
debug logic
CMSIS : Cortex® Microcontroller Software Interface Standard SVD : System View Description DAP : Debug Access Port
Middleware
: Components included in this package
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 7 of 129 Mar. 15, 2021
The components included in the package are shown below.
Table 1-1 Bundled Components
Component
Description
Note
Startup processing (Processing from MCU reset release to execution of main function. Code is provided by Renesas.)
Components of these headers are provided by Arm®.
Driver files conforming to Arm® CMSIS standard (code and some expansion headers are provided by Renesas.)
DSP library (Code and libraries are provided by Arm®.)
Renesas-specific drivers (peripheral function driver not standardized by CMSIS-Driver) (HAL: Hardware Abstraction Layer)
Peripheral function register information (SVD: System View Description)
Debugger connection information (DAP: Debug Access Port)
Driver HAL
CMSIS-SVD
CMSIS-CORE
CMSIS-Driver
CMSIS-DAP
CMSIS-DSP
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 8 of 129 Mar. 15, 2021

1.3 Folder Structure

The folder structure for this package is indicated in Figure 1-2.
Figure 1-2 CMSIS Driver Package Folder Structure for RE01B Group
RE01B_1500KB_DFP
CMSIS
Core
││└
Include
Driver
││└
Include
DSP_Lib
Include
Device
CMSIS_Driver
││├
Include
││└
Src
Config
………………│
Driver
││├
Include
││├
Lib
││└
Src
pin.c
……………
Pin settings file
pin.h
……………
Pin settings header file
RE01B_1500KB.h
………
startup_RE01B_1500KB.c
system_RE01B_1500KB.c
system_RE01B_1500KB.h
SVD
RE01B_1500KB.svd
Documents (SVD format)
Doxygen
Driver Specification
Getting_Started
License
main.c
config
RE01B_1500KB.icf
Flash Debug
project.dep
project.ewd
project.ewp
project.ewt
project.eww
RE01B_1500KB_DFP HardwareDebug.launch
Renesas original drivers
Documents
Cortex®-M0+ CPU
related files
provided by Arm®
Driver header files
Files that need to be edited by the user
Component
Project files
User application (including startup code)
For EWARM
(IAR compiler)
Register definition file
・ Startup processing ・ Interrupt vector table
Driver files
Register information
Driver compliant with CMSIS standard (including some Renesas-specific extended functions)
Configuration definition file
Driver files
provided by Renesas
Driver HAL
CMSIS-Driver
CMSIS-CORE
App Code
CMSIS-SVD
CMSIS-CORE
CMSIS-Driver
CMSIS-DSP
:
CMSIS-CORE
CMSIS-Driver
Driver HAL
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 9 of 129 Mar. 15, 2021

1.4 Supported Functions

Details on peripheral functions built into the device are provided in the "User's Manual: Hardware" for each target device.
Table 1-2 CMSIS-CORE Support Functions
Type
Driver Name
Support Function
Related Hardware Function
Common function driver
R_CORE
Interrupt vector table
Interrupt controller unit (ICU)
Startup processing
Clock generation circuit Power consumption reduction function
Table 1-3 CMSIS-Driver Support Functions
Type
Driver Name
Support Function
Related Hardware Function
Peripheral function driver
R_SPI
SPI serial communication
Serial peripheral interface (SPI)
R_I2C
I2C serial communication
I2C bus interface (RIIC)
R_USART
UART serial communication
Serial communication interface (SCIg, SCIi)
Table 1-4 Driver HAL Support Functions
Type
Driver Name
Support Function
Related Hardware Function
Peripheral function driver
R_SYSTEM
Clock setting
Clock generation circuit
Power control mode
Power consumption reduction function
Option setting
Option setting memory
Interrupt control
Interrupt controller unit (ICU), NVIC*
Register write protection
Register write protection
RAM expansion of programs
(handled in software)
Hardware resource locking
(handled in software)
R_LPM
I/O power supply domain control
Power consumption reduction function
Power consumption reduction functions
Module stopping
Built-in flash memory power
shutoff, etc.
R_PIN
Pin setting
Multifunction pin controller
R_ADC
14-bit A/D conversion
14-bit A/D converter
R_DMAC
DMA transfer
DMA controller (DMAC)
R_DTC
DTC transfer
Data transfer controller (DTC)
R_FLASH
On-chip flash memory
Flash memory
R_GDT
2D graphic data
2D graphic data conversion circuit (GDT)
R_SMIP
Serial MIP LCD
(handled in software)
R_BLE
BLE5.0 communication
Bluetooth low energy (BLE
*: Refer to the chapter on NVIC in the Cortex-M0+ Technical Reference Manual (ARM DDI 0484C).
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 10 of 129 Mar. 15, 2021

1.5 Package Features

Driver function change using the configuration definition file
Drivers in the package come with a configuration definition file (header file). By editing the definition values in the configuration file according to the operating environment, the user can change the operating conditions of the driver without changing the driver code itself.
For details, see chapter 3, Overview of Drivers.
Startup processing
The package provides startup processing after reset release until the main function is executed.
For details, see section 5.1, Startup Processing.
I/O power domain undefined value propagation suppression function
This device has multiple I/O power supply domains. After reset release, the undefined value propagation suppression function is effective for all IO power domains, with some exceptions. Disable the undefined value propagation suppression function of the IO power domain that supplies power.
For details, see section 5.2, Control of Undefined Value Propagation Suppression .
Program placement in RAM
Power consumption of the device can be reduced by shutting off the supply of power to the built-in flash memory. When running a program expanded in RAM after shutting off the supply of power to the built-in flash memory, it is necessary to place the desired program in RAM.
For details, see section 5.6,.Program RAM Placement.

1.6 Operation Confirmation Environment

The operation confirmation environment of the package is shown below.
Table 1-5 Operation Confirmation Environment(When using IAR Compiler)
Item
Description
Vendor
MCU
RE01B Group R7F0E01BD2DNB (LQFN64)
Renesas
Target board
EB-RE01B
TESSERA TECHNOLOGY
Integrated development environment (IDE)
EWARM V8.50.5 or later (IAR Embedded Workbench® for Arm®)
IAR Systems
Compiler
IAR V8.5 or later
IAR Systems
Debugger I-Jet
IAR Systems
J-Link
SEGGER
A patch may need to be installed depending on the version of EWARM. If necessary, install the patch by
referring to 2.2 Debug Environment Using EWARM.
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 11 of 129 Mar. 15, 2021
Table 1-6 Operation Confirmation Environment(When using GCC Compiler)
Item
Description
Vendor
MCU
RE01B Group R7F0E01BD2DNB (LQFN64)
Renesas
Target board
EB-RE01B
TESSERA TECHNOLOGY
Integrated development environment (IDE)
e2 studio 2021-01or later
Renesas
Compiler
GCC V.6 GNU 6-2017-q2-update
-
Debugger
J-Link
SEGGER
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 12 of 129 Mar. 15, 2021

2. Setting up the Development Environment

This chapter describes the procedure for running the project provided by the package, using the TESSERA
TECHNOLOGY EB-RE01B and SEGGER J-Link debugger as an example.

2.1 Overview of the Project in this Package

The outline of the operation flow of the sample program (main.c) included in the project of the package is
shown below. Chapters 3 to 5 explain to how to use each driver, beginning from startup.
Figure 2-1 Program Operation Flow
App Code
App Code
CMSIS-CORE
Reset_Handler function
C run time
Initialize RAM
Initialize system
(SystemInit function)
Execute user program
(main function)
End
Entry function after reset release
*1: Executed by _iar_program_start function
for IAR
(*1)
SystemInit function
Pin setting at start of operation
(BoardInit function)
Clock and power control mode
setting at start of operation
End
CMSIS-CORE
*2: R_LPM_IOPowerSupplyModeSet function
main function
Copy a program to RAM
(R_SYS_CodeCopy function)
Disable undefined value
propagation suppression
function for I/O power supply
domain (*2)
Initialize common function
drivers
(R_SYS_Initialize function)
(R_LPM_Initialize function)
User program included
in this package
startup_RE01B_1500KB.c
system_RE01B_1500KB.c
main.c
main.c
(*1)
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 13 of 129 Mar. 15, 2021

2.2 Debug Environment Using EWARM

for details.
Start up the project.
Figure 2-2 Project Startup File
Check if your EWARM is compatible with RE01B. If you cannot select the RE01B device, you need
to install the patch
Figure 2-3 Displaying Option Screen
config
RE01B_1500KB.icf
Flash Debug
project.dep
project.ewd
project.ewp
project.ewt
project.eww
RE01B_1500KB_DFP HardwareDebug.launch
Linker file
For EWARM
(IAR compiler)
Executable file (double-click to launch EWARM)
Select “Project” ”Options”
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 14 of 129 Mar. 15, 2021
Confirm that R7F0E01BD2DNB is displayed according to the following.
Device: Renesas RE0 RE01B_1500KB R7F0E01BD2DNB
(r20an0596) from the URL below and install it according to the attached document.
Patch download : https://www.renesas.com/products/microcontrollers-microprocessors/re-cortex-m-ultra-low-power-sotb-
mcus/software-tools
Figure 2-4 Example of Target Processor Setting
Click here and select the target device from the menu
Select
“General Options” and "Target” tab
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 15 of 129 Mar. 15, 2021
Compile (Project Rebuild All).
Figure 2-5 Compile Menu
Execute "Rebuild All"
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 16 of 129 Mar. 15, 2021
Select the debugger and set the options (Project Option, Category: Debugger).
Figure 2-6 Debugger Selection
Figure 2-7 Debugger Download Options
Select J-Link/J-Trace
Uncheck "Use flash loader"
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 17 of 129 Mar. 15, 2021
Set the J-Link/J-Trace Option settings (Category: J-Link/J-Trace).
Figure 2-8 J-Link/J-Trace Setup Options
Figure 2-9 J-Link/J-Trace Connection Options
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 18 of 129 Mar. 15, 2021
Connect the board and debugger.
Figure 2-10 Example of Connection Between Board and Debugger
USB Cable
J-Link Debugger
EB-RE01B
Emulator Connector
NOTE: Set the power supply, jumper, etc. in advance according to the documentation of the evaluation board.
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 19 of 129 Mar. 15, 2021
Download and start up the debugger.
Figure 2-11 Debugger Startup Menu
Once in Debug Mode, use the menu on the Debug tab to control program execution.
Figure 2-12 Program Execution Control (in Debug Mode)
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 20 of 129 Mar. 15, 2021

2.3 e2 studio Version

This section describes the method for running a project included with this package. The following is an example of settings when using the Evaluation Kit board.
Start up the e2 studio
Figure 2-13 e2 studio Startup File
Perform import of a project.
Figure 2-14 Project Import Procedure
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 21 of 129 Mar. 15, 2021
Perform compiling.
Figure 2-15 Compiler Menu
Set J-Link.
Figure 2-16 Procedure for J-Link Settings
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 22 of 129 Mar. 15, 2021
Connection with the board
Figure 2-17 Connection example
Download and start up the debugger
Figure 2-18 Debugger Startup Menu
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 23 of 129 Mar. 15, 2021

3. Driver Overview

This chapter provides an overview of the drivers included in the package.

3.1 Three Types of Files Comprising the Drivers

The drivers included in the package consist of three types of related files: the source file of the driver itself,
the include header, and the configuration definition file (with some exceptions).
Table 3-1 Driver Related Files
Filename
Description
r_***_api.c
Driver source code
r_***_api.h
Include header for defining necessary when using the driver
The user must include this file when using the driver.
r_***_cfg.h
Configuration definition file defining operating conditions for the driver
The user can edit the definition values in this file according to the operating environment.
(Driver operating conditions can be changed without modifying the driver code.)
The user need not include this file when using the driver.
The configuration definition header file (r_core_cfg.h) for the R_CORE driver is used in
startup processing and by the R_SYSTEM driver.
NOTE: In filenames, "***" represents the driver function name.

3.2 Notation of Driver Name

In this document, driver names written in uppercase letters (for example, R_ADC) are generic terms for
drivers that consist of three types of related files.
Figure 3-1 Driver Configuration Example
Include by user
Call driver function
Include in
driver
r_xxx_api.h: Header file
r_xxx_api.c: Driver source file
r_xxx_cfg.h: Configuration definition file
User
Application
App Code
Common function drivers
R_SYSTEM: Interrupt control function R_PIN: Pin setting function R_LPM: Module stop function, etc.
Driver HAL
Driver HAL
CMSIS-Driver
R_XXX Driver (Peripheral function XXX)
Example: "R_ADC driver" is composed of the following files.
r_adc_api.h: Header filer_adc_cfg.h: Configuration definition filer_adc_api.c: Driver source file
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 24 of 129 Mar. 15, 2021

3.3 Storage Location of Driver-related Files

The storage locations of driver-related files are shown below. Details are described in chapter 4.
Figure 3-2 Storage Locations of Driver-related Files
The Config folder that stores the configuration definition file is shared by all of the components.
Figure 3-3 Configuration Definition Files in the Config Folder
RE01B_1500KB_DFP
CMSIS
Core
││└
Include
Driver
││└
Include
DSP_Lib
Include
Device
CMSIS_Driver
││├
Include
││└
Src
Config
……………
Configuration definition files (⇒ see another figure)
Driver
││├
Include
││├
Lib
││└
Src
pin.c
…………………│├
pin.h
…………………│├
RE01B_1500KB.h
…………│
startup_RE01B_1500KB.c
system_RE01B_1500KB.c
system_RE01B_1500KB.h
Register definition file
Drivers compliant with CMSIS standard
Peripheral function drivers
・ Driver compliant with CMSIS
standard (including some Renesas-specific extended functions)
Renesas original drivers
・ Peripheral function driver ・ Common function driver
・ Startup processing ・ Interrupt vector table
Component
Cortex®-M0+ CPU
related files
provided by Arm®
Pin setting header file
Pin setting file
Driver files
provided by Renesas
CMSIS-CORE
CMSIS-Driver
CMSIS-CORE
Driver HAL
CMSIS-Driver
CMSIS-DSP
RE01B_1500KB_DFP
CMSIS
Device
CMSIS_Driver
Config
││├
r_core_cfg.h
││├
r_system_cfg.h
││├
r_lpm_cfg.h
││├
r_spi_cfg.h
││├
r_i2c_cfg.h
││├
r_usart_cfg.h
││├
r_adc_cfg.h
││├
r_ble_cfg.h
││├
r_dmac_cfg.h
││├
r_dtc_cfg.h
││├
r_flash_cfg.h
││├
r_gdt_cfg.h
││└
r_smip_cfg.h
Driver
* The order of the files has been changed for explanation.
Driver files
provided by
Renesas
Component
Peripheral function drivers Common function drivers
CMSIS-Driver
CMSIS-CORE
Driver HAL
Driver HAL
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 25 of 129 Mar. 15, 2021

3.4 Storage Location of Driver Specifications

Figure 3-4 Storage Location of Driver Specifications

3.4.1 Driver Specifications (PDF Format)

Specifications for common function drivers and peripheral function drivers are provided in PDF format. These
can be found in the Driver Specification folder within the Documents folder.

3.4.2 CMSIS-DSP Library Document (Doxygen Format)

Arm CMSIS-DSP library documentation is provided in Doxygen format. Documents are stored in the Doxygen folder under Documents. In this package, Doxygen-related files are stored compressed, so please unzip them before using them.
The procedure for displaying the DSP library specifications is shown in Figure 3-5.
RE01B_1500KB_DFP
CMSIS
Device
SVD
Documents
Doxygen
Driver Specification
Getting_Started
License
main.c
Component
CMSIS-DSP Library documents (Doxygen format)
Getting started guide
(this book)
Documents
Driver specifications (PDF format)
CMSIS-CORE
CMSIS-Driver
Driver HAL
CMSIS-DSP
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 26 of 129 Mar. 15, 2021
Figure 3-5 Displaying CMSIS-DSP Library Specifications (Doxygen Format)
RE01B_1500KB_DFP
CMSIS
Device
SVD├Documents
│├
Doxygen
││ └
Doxygen_Please_Unzip_here.zip
│├
Driver Specification
│├
Getting_Started
│└
License
main.c
Doxygen
CMSIS_Documentation
│├
index.html
│├
Core
│├
Core_A
│├
DAP
│├
Driver
│├
DSP
│├
General
│├
NN
│├
Pack
│├
RTOS
│├
RTOS2
│├
SVD
│└
Zone
Vendor_Documentation
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 27 of 129 Mar. 15, 2021

4. Components and Drivers

4.1 Drivers Provided by Each Component

There are two kinds of drivers included in the package: common function drivers and peripheral function drivers. The relationship between components and drivers is as follows.
Common function drivers
Common function drivers are provided by two components: CMSIS-CORE and Driver HAL. The common function driver provides functions such as interrupt management, including reset, startup processing (clock setting, program RAM allocation, etc.), clock and power management, and interrupt and pin settings for peripheral functions.
Peripheral function drivers
Peripheral function drivers are provided by two components: CMSIS-Driver and Driver HAL. Using these drivers simplifies the operation of peripheral functions by the user application.
Table 4-1 Components and Drivers
Category
Component
Driver
Driver Overview
Common Function Drivers
R_CORE
Interrupt vector table, startup processing R_SYSTEM
Clock setting, interrupt setting, program RAM expansion
R_PIN
Pin settings
R_LPM
IO power domain undefined value propagation suppression function, setting the low power consumption mode
Peripheral Function Drivers
R_SPI
SPI serial communication
R-I2C
I2C serial communication (with Renesas-specific extensions)
R_USART
USART serial communication (with Renesas-specific extensions)
R_ADC
14-bit AD conversion
R_DMAC
DMA transfer
R_DTC
DTC transfer
R_FLASH
Built-in flash memory
R_GDT
2D graphics data conversion circuit (GDT)
R_SMIP
Serial MIP LCD
R_BLE
BLE5.0 communication
CMSIS-Driver
CMSIS-CORE
Driver HAL
Driver HAL
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 28 of 129 Mar. 15, 2021
The operation overview of the common function drivers and peripheral function drivers is shown below.
Figure 4-1 Operation Overview of Common Function Driver and Peripheral Function Driver
Peripheral function drivers
When the peripheral function driver is not used, the user directly executes the common function driver function
Driver HAL
Peripheral function drivers
(R_ADC, R_DMAC, R_DTC,
R_FLASH, R_GDT,
R_SMIP, R_BLE)
Driver HAL
Peripheral function drivers
(R_I2C, R_SPI, R_USAR)
CMSIS-Driver
User Application
App Code
CMSIS-CORE
Common function drivers
R_SYSTEM driver R_PIN driver R_LPM driver
R_CORE driver
Interrupt vector table
Startup processing
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 29 of 129 Mar. 15, 2021

4.2 Common Function Drivers

4.2.1 R_CORE Driver

R_CORE is a driver provided by the CMSIS-CORE component. The outline of the R_CORE driver is shown below.
Table 4-2 Overview of R_CORE driver
Driver Name
Function
Description
R_CORE
Interrupt vector table
An interrupt vector table is provided that manages entry function addresses when reset release or an IRQ or other interrupt occurs.
(For details, see section 5.3, Interrupt Control.)
Startup processing
The entry function called after reset release performs startup processing before executing the main function.
In this package, in addition to startup defined in CMSIS-CORE, initial settings for the operation clock and power control mode are made according to the settings in r_core_cfg.h.
(For details, see section 5.1, Startup Processing.)
The R_CORE driver has a configuration definition file (r_core_cfg.h) in the Config folder, and the user can edit the definition values according to the operating environment. The files related to the R_CORE driver are shown below.
Table 4-1 Files Related to R_CORE Driver
Driver Name
Related Files
Overview of Related Files
R_CORE
startup_RE01B_1500KB.c
R_CORE Startup source file
system_RE01B_1500KB.c
R_CORE System initialization source file
system_RE01B_1500KB.h
R_CORE System initialization header file
r_core_cfg.h
R_CORE Configuration definition file
Figure 4-2 Files Related to R_CORE Driver
RE01B_1500KB_DFP
CMSIS
Core
││└
Include
Driver
DSP_Lib
Device
CMSIS_Driver
Config
││├
r_core_cfg.h
││├
Driver
pin.c
pin.h
RE01B_1500KB.h
startup_RE01B_1500KB.c
system_RE01B_1500KB.c
system_RE01B_1500KB.h
Startup processing
Component
Driver header files
Common function driver
Cortex®-M0+ CPU
related files
provided by Arm®
Driver files
provided by Renesas
Configuration definition file
CMSIS-CORE
RE01B Group Getting Started Guide to Development Using CMSIS Package
R01AN5310EJ0100 Rev.1.00 Page 30 of 129 Mar. 15, 2021

4.2.2 R_SYSTEM Driver

R_SYSTEM is a driver provided by the Driver HAL component. The outline of the R_SYSTEM driver is shown below.
Table 4-2 Overview of R_SYSTEM Driver
Driver Name
Function Overview
R_SYSTEM
Clock settings
Provide functions to set the clock.
(For details, refer to 5.4 Clock Setting)
Interrupt settings
Provide functions and definition files for interrupt control.
(For details, Refer to 5.3 Interrupt Control)
Program expansion in RAM area
Provides a function to copy the program assigned to the RAM section to the RAM area.
For details on program RAM allocation, refer to section 5.6, Program RAM Placement.
The R_SYSTEM driver has a configuration definition file in the Config folder, and the user can edit the definition values according to the operating environment. The files related to the R_SYSTEM driver are shown below. Some functions of the R_SYSTEM driver refer to the configuration file (r_core_cfg.h) of the R_CORE driver.
Table 4-3 Files Related to R_SYSTEM Driver
Driver Name
Related Files
Overview of Related Files
R_SYSTEM
r_system_api.c
R_SYSTEM driver source file
r_system_api.h
R_SYSTEM driver header file
r_system_cfg.h
R_SYSTEM configuration definition file

4.2.3 R_PIN Driver

R_PIN is a driver provided by the Driver HAL component. The outline of the R_PIN driver is shown below.
Table 4-4 Overview of R_PIN Driver
Driver Name
Function Overview
R_PIN
Pin settings
Functions for controlling the pins used for peripheral functions are provided.
(For details, refer to section 5.5, Pin Settings)
Table 4-5 Files Related to R_PIN Driver
Driver Name
Related Files
Overview of Related Files
R_PIN pin.c
Pin setting file
pin.h
Pin setting header file
Loading...
+ 101 hidden pages