R01US0078ED0213
Jun 10, 2019
www.renesas.com
User´s Manual
32
RH850 Family
Code Flash Library, Type T01
Installer: RENESAS_FCL_RH850_T01_V2.xx (xx>=10)
All information contained in these materials, including products and product specifications,
represents information on the product at the time of publication and is subject to change by
Renesas Electronics Corp. without notice. Please review the latest information published by
Renesas Electronics Corp. through various means, including the Renesas Electronics Corp.
website (http://www.renesas.com).
RENESAS MCU RH850 Family
Notice
1. Descriptions of circuits, software and other related information in this document are provided only to illustrate the operati
on of
semiconductor products and application examples. You are fully responsible for the incorporation or any other use of the circuits,
software, and information in the design of your product or system. Renesas Electronics disclaims any and all liability for any losses and
damages incurred by you or third parties arising from the use of these circuits, software, or information.
2. Renesas Electronics hereby expressly disclaims any warranties against and liability for infringement or any other claims involving patents,
copyrights, or other intellectual property rights of third parties, by or arising from the use of Renesas Electronics products or technical
information described in this document, including but not limited to, the product data, drawings, charts, programs, algorithms, and
application examples.
3. No license, express, implied or otherwise, is granted hereby under any patents, copyrights or other intellectual property rights of Renesas
Electronics or others.
4. You shall not alter, modify, copy, or reverse engineer any Renesas Electronics product, whether in whole or in part. Renesas Electronics
disclaims any and all liability for any losses or damages incurred by you or third parties arising from such alteration, modification,
copying or reverse engineering.
5. Renesas Electronics products are classified according to the following two quality grades: “Standard” and “High Quality”. The intended
applications for each Renesas Electronics product depends on the product’s quality grade, as indicated below.
“Standard”: Computers; office equipment; communications equipment; test and measurement equipment; audio and visual equipment;
home electronic appliances; machine tools; personal electronic equipment; industrial robots; etc.
“High Quality”: Transportation equipment (automobiles, trains, ships, etc.); traffic control (traffic lights); large-scale communication
equipment; key financial terminal systems; safety control equipment; etc.
Unless expressly designated as a high reliability product or a product for harsh environments in a Renesas Electronics data sheet or other
Renesas Electronics document, Renesas Electronics products are not intended or authorized for use in products or systems that may pose a
direct threat to human life or bodily injury (artificial life support devices or systems; surgical implantations; etc.), or may cause serious
property damage (space system; undersea repeaters; nuclear power control systems; aircraft control systems; key plant systems; military
equipment; etc.). Renesas Electronics disclaims any and all liability for any damages or losses incurred by you or any third parties arising
from the use of any Renesas Electronics product that is inconsistent with any Renesas Electronics data sheet, user’s manual or other
Renesas Electronics document.
6. When using Renesas Electronics products, refer to the latest product information (data sheets, user’s manuals, application notes, “General
Notes for Handling and Using Semiconductor Devices” in the reliability handbook, etc.), and ensure that usage conditions are within the
ranges specified by Renesas Electronics with respect to maximum ratings, operating power supply voltage range, heat dissipation
characteristics, installation, etc. Renesas Electronics disclaims any and all liability for any malfunctions, failure or accident arising out of
the use of Renesas Electronics products outside of such specified ranges.
7. Although Renesas Electronics endeavors to improve the quality and reliability of Renesas Electronics products, semiconductor products
have specific characteristics, such as the occurrence of failure at a certain rate and malfunctions under certain use conditions. Unless
designated as a high reliability product or a product for harsh environments in a Renesas Electronics data sheet or other Renesas
Electronics document, Renesas Electronics products are not subject to radiation resistance design. You are responsible for implementing
safety measures to guard against the possibility of bodily injury, injury or damage caused by fire, and/or danger to the public in the event
of a failure or malfunction of Renesas Electronics products, such as safety design for hardware and software, including but not limited to
redundancy, fire control and malfunction prevention, appropriate treatment for aging degradation or any other appropriate measures.
Because the evaluation of microcomputer software alone is very difficult and impractical, you are responsible for evaluating the safety of
the final products or systems manufactured by you.
8. Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each
Renesas Electronics product. You are responsible for carefully and sufficiently investigating applicable laws and regulations that regulate
the inclusion or use of controlled substances, including without limitation, the EU RoHS Directive, and using Renesas Electronics
products in compliance with all these applicable laws and regulations. Renesas Electronics disclaims any and all liability for damages or
losses occurring as a result of your noncompliance with applicable laws and regulations.
9. Renesas Electronics products and technologies shall not be used for or incorporated into any products or systems whose manufacture, use,
or sale is prohibited under any applicable domestic or foreign laws or regulations. You shall comply with any applicable export control
laws and regulations promulgated and administered by the governments of any countries asserting jurisdiction over the parties or
transactions.
10. It is the responsibility of the buyer or distributor of Renesas Electronics products, or any other party who distributes, disposes of, or
otherwise sells or transfers the product to a third party, to notify such third party in advance of the contents and conditions set forth in this
document.
11. This document shall not be reprinted, reproduced or duplicated in any form, in whole or in part, without prior written consent of Renesas
Electronics.
12. Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or
Renesas Electronics products.
(Note 1) “Renesas Electronics” as used in this document means Renesas Electronics Corporation and also includes its directly or indirectly
controlled subsidiaries.
(Note 2) “Renesas Electronics product(s)” means any product developed or manufactured by or for Renesas Electronics.
(Rev.4.0-1 November 2017)
How to use this document
(1) Purpose and Target Readers
This manual is designed to provide the user with an understanding of the functions and characteristics of
the Self-Programming Library. It is intended for users designing application systems incorporating the
library. A basic knowledge of embedded systems is necessary in order to use this manual. The manual
comprises an overview of the library, API description, usage notes and cautions.
Particular attention should be paid to the precautionary notes when using the manual. These notes occur
within the body of the text, at the end of each section, and in the Cautions section.
The revision history summarizes the locations of revisions and additions. It does not list all revisions.
Refer to the text of the manual for details.
(2) List of Abbreviations and Acronyms
Abbreviation Full form
API Application Programming Interface
Code Flash
Embedded Flash where the application code or
constant data is stored.
Data Flash
Embedded Flash where mainly the data of the
EEPROM emulation are stored.
Dual operation
Dual operation is the capability to access flash memory
during reprogramming another flash memory range.
Between different Code Flash macros dual operation
depends on the device implementation
ECC Error Correction Code
Flash
Electrically erasable and programmable nonvolatile
memory. Different to ROM, this type of memory can be
re-programmed several times.
Flash area Area of Flash consists of several coherent Flash blocks
Flash block
A flash block is the smallest erasable unit of the flash
memory.
FCL Code Flash Library (Code Flash access layer)
FDL Data Flash Library (Data Flash access layer)
OPB Option bytes used to define device behavior at startup
OTP One Time Programmable
RAM
“Random access memory” - volatile memory with
random access
ROM
“Read only memory” - nonvolatile
memory. The content
of that memory cannot be changed during normal
operation.
Self-programming
Capability to reprogram the embedded flash without
external programming tool only via control code running
on the microcontroller.
Serial programming
The onboard programming mode is used to program
the device with an external programmer tool.
User area (or user memory)
Code flash area that is available for usual user
program. This is where most of the user code resides.
Abbreviation
Full form
User boot area (or extended user memory)
Code flash area designed for storing a bootloader
application.
All trademarks and registered trademarks are the property of their respective owners.
Table of Contents
Chapter 1 Introduction ......................................................................... 7
1.1 Flash Infrastructure ......................................................................................... 7
1.1.1 Dual Operation ......................................................................................... 8
1.1.2 Flash Granularity ..................................................................................... 8
Chapter 2 Architecture ......................................................................... 9
2.1 Library representation ................................................................................... 10
Chapter 3 FCL Functional Specifications ......................................... 11
3.1 Code execution in RAM ................................................................................. 11
3.2 Operating modes ............................................................................................ 11
3.3 Request oriented operation .......................................................................... 13
3.4 Suspend / Resume mechanism .................................................................... 13
3.5 Cancel mechanism ......................................................................................... 15
3.6 Loop supervision ........................................................................................... 15
3.7 Internal error ................................................................................................... 15
Chapter 4 User Interface (API) ........................................................... 17
4.1 Library compile-time configuration .............................................................. 17
4.2 Data types ....................................................................................................... 20
4.2.1 Simple type definitions .......................................................................... 20
4.2.2 r_fcl_command_t ................................................................................... 21
4.2.3 r_fcl_status_t ......................................................................................... 23
4.2.4 r_fcl_request_t ....................................................................................... 25
4.2.5 r_fcl_descriptor_t .................................................................................. 26
4.3 Functions ........................................................................................................ 27
4.3.1 Initialization ............................................................................................ 27
4.3.2 Operation ................................................................................................ 30
4.4 Library commands ......................................................................................... 40
4.4.1 R_FCL_CMD_PREPARE_ENV .............................................................. 41
4.4.2 R_FCL_CMD_ERASE ............................................................................. 43
4.4.3 R_FCL_CMD_WRITE.............................................................................. 45
4.4.4 R_FCL_CMD_SET_LOCKBIT ................................................................ 47
4.4.5 R_FCL_CMD_GET_LOCKBIT ................................................................ 48
4.4.6 R_FCL_CMD_ENABLE_LOCKBITS ...................................................... 50
4.4.7 R_FCL_CMD_DISABLE_LOCKBITS ..................................................... 50
4.4.8 R_FCL_CMD_SET_OTP ......................................................................... 51
4.4.9 R_FCL_CMD_GET_OTP ........................................................................ 53
4.4.10 R_FCL_CMD_SET_OPB ...................................................................... 54