1 - Fls Integration Manual

Integration Manual

For

Fls

VERSION: 3

DATE: 05/08/2017

Prepared By:

Software Group,

Nexteer Automotive,

Saginaw, MI, USA

Location: The official version of this document is stored in the Nexteer Configuration Management System.

Revision History

Sl. No.DescriptionAuthorVersionDate
1Initial versionRijvi Ahmed103/03/17
2Updated for callout function mappingRijvi Ahmed205/05/2017
3Updates for compiler settingsLucas Wendling305/08/2017

Table of Contents

1 Abbrevations And Acronyms 4

2 References 5

3 Dependencies 6

3.1 SWCs 6

3.2 Global Functions(Non RTE) to be provided to Integration Project 6

4 Configuration REQUIREMeNTS 7

4.1 Build Time Config 7

4.2 Configuration Files to be provided by Integration Project 7

4.3 Da Vinci Parameter Configuration Changes 7

4.4 DaVinci Interrupt Configuration Changes 7

4.5 Manual Configuration Changes 7

5 Integration DATAFLOW REQUIREMENTS 8

5.1 Required Global Data Inputs 8

5.2 Required Global Data Outputs 8

5.3 Specific Include Path present 8

6 Runnable Scheduling 9

7 Memory Map REQUIREMENTS 10

7.1 Mapping 10

7.2 Usage 10

7.3 Non RTE NvM Blocks 10

7.4 RTE NvM Blocks 10

8 Compiler Settings 11

8.1 Preprocessor MACRO 11

8.2 Optimization Settings 11

9 Appendix 12

Abbrevations And Acronyms

AbbreviationDescription

References

This section lists the title & version of all the documents that are referred for development of this document

Sr. No.TitleVersion

Dependencies

SWCs

ModuleRequired Feature

Note : Referencing the external components should be avoided in most cases. Only in unavoidable circumstance external components should be referred. Developer should track the references.

Global Functions(Non RTE) to be provided to Integration Project

API usage and scheduling of BSW components expected to be captured at a project architectural level and is beyond the scope of this document. Third party documentation can be referenced as needed.

Configuration REQUIREMeNTS

Configuration of BSW components expected to be captured at a project architectural level and is beyond the scope of this document. Third party documentation can be referenced as needed.

Build Time Config

ModulesNotes

Configuration Files to be provided by Integration Project

N/A

Da Vinci Parameter Configuration Changes

ParameterNotesSWC

DaVinci Interrupt Configuration Changes

ISR NameNotes

Manual Configuration Changes

ConstantNotesSWC

Integration DATAFLOW REQUIREMENTS

Required Global Data Inputs

Required Global Data Outputs

Specific Include Path present

Yes

Runnable Scheduling

API usage and scheduling of BSW components expected to be captured at a project architectural level and is beyond the scope of this document. Third party documentation can be referenced as needed.

InitScheduling RequirementsTrigger
RunnableScheduling RequirementsTrigger

.

Memory Map REQUIREMENTS

Mapping

Memory SectionContentsNotes

* Each …START_SEC… constant is terminated by a …STOP_SEC… constant as specified in the AUTOSAR Memory Mapping requirements.

  1. Fls MCAL driver requires some source code to reside in Private RAM area, for which the following changes are required to be added in the linker command (i.e. dr7f701311.ld) file. This changes will allow copying of the code from FLASH to RAM by start up code.

/* Put the following under SECTIONS definition (the “.” must be pointing to code flash) */

.ROM.FLS_PRIVATE_CODE_RAM ROM(.FLS_PRIVATE_CODE_RAM) :{}>.

/* Put the following under Internal RAM definition area (the “.” must be pointing to RAM) */

.FLS_PRIVATE_CODE_RAM align(4) :>.

  1. In the MemMap.h file add the following:

#ifdef FLS_START_SEC_PRIVATERAM_CODE

#undef FLS_START_SEC_PRIVATERAM_CODE

#pragma ghs section text=".FLS_PRIVATE_CODE_RAM"

#undef MEMMAP_ERROR /* PRQA S 0841 */ /* MD_MSR_19.6 */

#endif

#ifdef FLS_STOP_SEC_PRIVATERAM_CODE

#undef FLS_STOP_SEC_PRIVATERAM_CODE

#pragma ghs section text=default

#undef MEMMAP_ERROR

#endif

Note: Execution from RAM only happens in Fls_Init function and it’s recommended to run this function before OS set the memory protection since execution from RAM is typically disabled by the MPU.

If Fls_Init runs after MPU are configured a special memory protection area would need to be configured to allow execution from RAM and the function in the Fls Private code Ram need to be placed in that area.

An example linker file and MemMap file are attached that show the above updates that can be used for reference.

  1. Callout function Fls_CallSwitchBFlashErrorNotification() need to be mapped in the PRIVATERAM_CODE area (see point 2 for memmap statement). It need to be ensured that this callout function never returns to caller and never execute functions that are mapped in the code flash memory. Reset the part and/or endless loop is recommended action.

Usage

FeatureRAMROM

NvM Blocks

Compiler Settings

The MCAL related files require specific compiler toolchain settings to be used to match what the MCAL was developed and tested to. This is the following:

-c -Osize -g -cpu=rh850g3m -gsize -prepare_dispose -inline_prologue -sda=all -Wundef -no_callt -reserve_r2 --short_enum --prototype_errors --diag_error 193 -dual_debug -large_sda --no_commons -shorten_loads -shorten_moves -Wshadow -nofloatio -ignore_callt_state_in_interrupts -delete

This component’s .gpj file has been adapted to provide these options for the static files of this component. NOTE: The dynamic, generated files from this component need to be compiled with these options as well, and therefore the integration project will need to be adapted to provide these settings to the generated files in the integration project.

The following snippet can be adapted/added to the a batch file which creates the generate.gpj project for integration project usage:

for %%F in (../generate/<MCAL_Component>/src/*.c) do (

ECHO ..\generate/<MCAL_Component>/src\%%F >> generate.gpj

ECHO # MCAL BUILD OPTIONS # >> generate.gpj

ECHO -c >> generate.gpj

ECHO -Osize >> generate.gpj

ECHO -g >> generate.gpj

ECHO -cpu=rh850g3m >> generate.gpj

ECHO -gsize >> generate.gpj

ECHO -prepare_dispose >> generate.gpj

ECHO -inline_prologue >> generate.gpj

ECHO -sda=all >> generate.gpj

ECHO -Wundef >> generate.gpj

ECHO -no_callt >> generate.gpj

ECHO -reserve_r2 >> generate.gpj

ECHO --short_enum >> generate.gpj

ECHO --prototype_errors >> generate.gpj

ECHO --diag_error 193 >> generate.gpj

ECHO -dual_debug >> generate.gpj

ECHO -large_sda >> generate.gpj

ECHO --no_commons >> generate.gpj

ECHO -shorten_loads >> generate.gpj

ECHO -shorten_moves >> generate.gpj

ECHO -Wshadow >> generate.gpj

ECHO -nofloatio >> generate.gpj

ECHO -ignore_callt_state_in_interrupts >> generate.gpj

ECHO -delete >> generate.gpj

)

Preprocessor MACRO

Optimization Settings

Appendix

<This section is for appendix>

2 - Fls Peer Review Checklists


Overview

Summary Sheet
Synergy Project
Integration Manual


Sheet 1: Summary Sheet
























Rev 1.28-Jun-15

Peer Review Summary Sheet


























Synergy Project Name:


kzshz2: Intended Use: Identify which component is being reviewed. This should be the Module Short Name from Synergy Rationale: Required for traceability. It will help to ensure this form is not attaced to the the wrong change request. Fls
Revision / Baseline:


kzshz2: Intended Use: Identify which Synergy revision of this component is being reviewed Rationale: Required for traceability. It will help to ensure this form is not attaced to the the wrong change request. Fls_Renesas_Ar4.0.3_1.0.5_1

























Change Owner:


kzshz2: Intended Use: Identify the developer who made the change(s) Rationale: A change request may have more than one resolver, this will help identify who made what change. Change owner identification may be required by indusrty standards. Lucas Wendling
Work CR ID:


EA4#11416





























kzshz2: Intended Use: Intended to identify at a high level to the reviewers which areas of the component have been changed. Rationale: This will be good information to know when ensuring appropriate reviews have been completed. Modified File Types:















































































































































































kzshz2: Intended Use: Identify who where the reviewers, what they reviewed, and if the reviewed changes have been approved to release the code for testing. Comments here should be at a highlevel, the specific comments should be present on the specific review form sheet. Rationale: Since this Form will be attached to the Change Request it will confirm the approval and provides feedback in case of audits. ADD DR Level Move reviewer and approval to individual checklist form Review Checklist Summary:






















































Reviewed:































N/AMDD


N/ASource Code


N/APolySpace









































YesIntegration Manual


N/ADavinci Files








































































Comments:

3rd Party BSW component. Only reviewed 3rd party files for correctness to delivery and any Nexteer created






source files and documentation. Reviewed changes for compiler setting needs.



















































































General Guidelines:
- The reviews shall be performed over the portions of the component that were modified as a result of the Change Request.
- New components should include FDD Owner and Integrator as apart of the Group Review Board (Source Code, Integration Manual, and Davinci Files)
- Enter any rework required into the comment field and select No. When the rework is complete, review again using this same review sheet and select Yes. Add date and additional comment stating that the rework is completed.
- To review a component with multiple source code files use the "Add Source" button to create a Source code tab for each source file.
- .h file should be reviewed with the source file as part of the source file.





















Sheet 2: Synergy Project

Peer Review Meeting Log (Component Synergy Project Review)



















































Quality Check Items:




































Rationale is required for all answers of No










New baseline version name from Summary Sheet follows








Yes
Comments:

Follows convention created for
naming convention











BSW components
























Project contains necessary subprojects








N/A
Comments:










































Project contains the correct version of subprojects








N/A
Comments:










































Design subproject is correct version








N/A
Comments:











































General Notes / Comments:



























































LN: Intended Use: Identify who were the reviewers and if the reviewed changes have been approved. Rationale: Since this Form will be attached to the Change Request it will confirm the approval and provides feedback in case of audits. KMC: Group Review Level removed in Rev 4.0 since the design review is not checked in until approved, so it would always be DR4. Review Board:


























Change Owner:

Lucas Wendling


Review Date :

05/08/17
































Lead Peer Reviewer:


Rijvi Ahmed


Approved by Reviewer(s):



Yes































Other Reviewer(s):










































































Sheet 3: Integration Manual






















Rev 1.28-Jun-15
Peer Review Meeting Log (Integration Manual Review)


























Integration Manual Name:



kzshz2: Intended Use: Identify which file is being reviewed Rationale: Required for traceability. It will help to ensure this sheet is not attached to the wrong design review form. Fls Integration Manual.doc

Integration Manual Revision:



kzshz2: Intended Use: Identify which version of the integration manual has been reviewed. Rationale: Required for traceability between the MDD and review. Auditors will likely require this. 3





























Quality Check Items:




































Rationale is required for all answers of No










Synergy version matches header








Yes
Comments:










































Latest template used








Yes
Comments:










































Change log contains detailed description of changes








Yes
Comments:










































Changes Highlighted (for Integrator)








Yes
Comments:











































General Notes / Comments:























Integration manual only contains information relevant beyond what a standard BSW integration would required.


































LN: Intended Use: Identify who were the reviewers and if the reviewed changes have been approved. Rationale: Since this Form will be attached to the Change Request it will confirm the approval and provides feedback in case of audits. KMC: Group Review Level removed in Rev 4.0 since the design review is not checked in until approved, so it would always be DR4. Review Board:


























Change Owner:

Lucas Wendling


Review Date :

05/08/17
































Lead Peer Reviewer:


Rijvi Ahmed


Approved by Reviewer(s):



Yes































Other Reviewer(s):









































































3 - R20UT3710EJ0102-AUTOSAR

AUTOSAR MCAL  R4.0  User's Manual

5 - R20UT3710EJ0102-AUTOSARs




AUTOSAR MCAL R4.0.3 
User's Manual 
FLS Driver Component Ver.1.0.5 
Embedded User's Manual 
Target Device: 
RH850/P1x 
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). 
www.renesas.com 
Rev.1.02 May 2017 

 
 
 
 
 
 
 
 
 
 
 
2 

 
 
Notice 
1. 
Descriptions of circuits, software and other related information in this document are provided only to illustrate the operation 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 disputes 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, drawing, chart, program, algorithm, 
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 otherwise misappropriate 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, copy or otherwise misappropriation of Renesas Electronics products. 
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; and 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. 
Renesas Electronics products are neither intended nor 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 damages 
(space and 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 third parties arising from the use of any 
Renesas Electronics product for which the product is not intended by Renesas Electronics. 
6. 
When using the 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 
radiation characteristics, installation, etc. Renesas Electronics disclaims any and all liability for any malfunctions or failure or accident 
arising out of the use of Renesas Electronics products beyond 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. Further, 
Renesas Electronics products are not subject to radiation resistance design. Please ensure to implement safety measures to guard them 
against the possibility of bodily injury, injury or damage caused by fire, and social damage in the event of 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 by your own responsibility as 
warranty for your products/system. Because the evaluation of microcomputer software alone is very difficult and not practical, please 
evaluate 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. Please investigate applicable laws and regulations that regulate the inclusion or use of controlled 
substances, including without limitation, the EU RoHS Directive carefully and sufficiently and use 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 not use Renesas Electronics products 
or technologies for (1) any purpose relating to the development, design, manufacture, use, stockpiling, etc., of weapons of mass 
destruction, such as nuclear weapons, chemical weapons, or biological weapons, or missiles (including unmanned aerial vehicles 
(UAVs)) for delivering such weapons, (2) any purpose relating to the development, design, manufacture, or use of conventional 
weapons, or (3) any other purpose of disturbing international peace and security, and you shall not sell, export, lease, transfer, or 
release Renesas Electronics products or technologies to any third party whether directly or indirectly with knowledge or reason to know 
that the third party or any other party will engage in the activities described above. When exporting, selling, transferring, etc., Renesas 
Electronics products or technologies, you shall comply with any applicable export control laws and regulations promulgated and 
administered by the governments of the countries asserting jurisdiction over the parties or transactions. 
10.  Please acknowledge and agree that you shall bear all the losses and damages which are incurred from the misuse or violation of the 
terms and conditions described in this document, including this notice, and hold Renesas Electronics harmless, if such misuse or 
violation results from your resale or making Renesas Electronics products available any third party. 
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 majority-
owned subsidiaries. 
(Note 2)   "Renesas Electronics product(s)" means any product developed or manufactured by or for Renesas Electronics. 
3 

 
 


 
Abbreviations and Acronyms 
 
 
 
Abbreviation / Acronym 
Description 
 ANSI 
 American National Standards Institute 
 ADC 
 Analog to Digital Converter 
 API 
 Application Programming Interface 
 AUTOSAR 
 AUTomotive Open System ARchitecture 
 BSW 
 Basic SoftWare 
 BSWMDT 
 Basic Software Module Description Template 
 BUS 
 Bidirectional Universal Switch 
 CPU 
 Central Processing Unit 
 CAN 
 Controller Area Network 
 DET/Det 
 Development Error Tracer 
 DEM/Dem 
 Diagnostic Event Manager 
 DIO 
 Digital Input Output 
 DMA 
 Direct Memory Access 
 DED 
 Double bit Error Detection 
 EEPROM 
 Electrically Erasable Programmable Read Only Memory 
 ECU 
 Electronic Control Unit 
 ECC 
 Error Correction Code 
 FACI 
 Flash Application Command Interface 
 FCU 
 Flash Control Unit 
 FLS 
 FLaSh Driver 
 GPT 
 General Purpose Timer 
 GNU 
 GNU’s Not Unix 
 HW 
 HardWare 
 ID/Id 
 Identifier 
 IO 
 InOut 
 ICU 
 Input Capture Unit 
 I/O 
 Input/Output 
 ISR 
 Interrupt Service Routine 
 KB 
 Kilo Byte 
 LIN 
 Local Interconnect Network 
 MB 
 Mega Byte 
 MHz 
 Mega Hertz 
 MCU 
 Micro Controller Unit 
 MCAL 
 Microcontroller Abstraction Layer 
 NA 
 Not Applicable 
 OS 
 Operating System 
 PDF 
 Parameter definition file 
 PWM 
 Pulse Width Modulation 
 RAM 
 Random Access Memory 
5 

 
Abbreviation / Acronym 
Description 
 ROM 
 Read Only Memory 
 R/W/RW 
 Read/Write/Read and Write 
 RTE 
 Run Time Environment 
 SCHM/SchM 
 Scheduler Manager 
 SCI 
 Serial Communications Interface 
 SPI 
 Serial Peripheral Interface 
 SED 
 Single bit Error Detection 
 SW 
 SoftWare 
 WDT 
 Watch Dog Timer 
 
 
 
Definitions 
 
 
 
Term 
Represented by 
Sl. No. 
Serial Number 
 
 
 
 
 
 


 
Table of Contents 
 
 
Chapter 1  Introduction....................................................................... 11 
1.1 
Document Overview ........................................................................................................... 13 
Chapter 2  Reference Documents ...................................................... 15 
Chapter 3  Integration and Build Process ......................................... 17 
3.1. 
FLS Driver Component Make file ...................................................................................... 17 
3.1.1. 
Folder Structure ................................................................................................. 17 
Chapter 4  Forethoughts .................................................................... 19 
4.1. 
General ................................................................................................................................. 19 
4.2. 
Preconditions ...................................................................................................................... 22 
4.3. 
Data Consistency ................................................................................................................ 25 
4.4. 
Deviation List ...................................................................................................................... 27 
4.5. 
User mode and supervisor mode ...................................................................................... 28 
Chapter 5  Architecture Details .......................................................... 29 
Chapter 6  Registers Details ............................................................... 35 
Chapter 7  Interaction between the User and FLS Driver Component 
 

  .......................................................................................... 39 
7.1. 
Services Provided by FLS Driver Component to the User ............................................. 39 
Chapter 8  FLS Driver Component Header and Source File 
Description .......................................................................................... 41
 

Chapter 9  Generation Tool Guide ..................................................... 45 
Chapter 10  Application Programming Interface ............................... 47 
10.1. 
Imported Types ................................................................................................................... 47 
10.1.1. 
Standard Types .................................................................................................. 47 
10.1.2. 
Other Module Types ........................................................................................... 47 
10.2. 
Type Definitions .................................................................................................................. 47 
10.2.1 
Fls_ConfigType .................................................................................................. 47 
10.2.2 
Fls_AddressType ............................................................................................... 48 
10.2.3 
Fls_LengthType .................................................................................................. 48 
10.3. 
Function Definitions ........................................................................................................... 48 
10.3.1. 
Fls_Init ................................................................................................................. 49 
10.3.2. 
Fls_Erase ............................................................................................................ 49 
10.3.3. 
Fls_Write ............................................................................................................. 50 
10.3.4. 
Fls_Cancel .......................................................................................................... 51 
7 

 
10.3.5. 
Fls_GetStatus ..................................................................................................... 51 
10.3.6. 
Fls_GetJobResult ............................................................................................... 52 
10.3.7. 
Fls_MainFunction ............................................................................................... 52 
10.3.8. 
Fls_Read ............................................................................................................. 53 
10.3.9. 
Fls_Compare....................................................................................................... 53 
10.3.10.  Fls_SetMode ....................................................................................................... 54 
10.3.11.  Fls_GetVersionInfo ............................................................................................ 54 
10.3.12.  Fls_ReadImmediate ........................................................................................... 55 
10.3.13.  Fls_BlankCheck ................................................................................................. 55 
10.3.14.  Fls_Suspend ....................................................................................................... 56 
10.3.15.  Fls_Resume ........................................................................................................ 57 
10.3.16.  Fls_CallSwitchBFlashErrorNotification ........................................................... 57 
Chapter 11  Development and Production Errors ............................. 59 
11.1 
FLS Driver Component Development Errors ................................................................... 59 
11.2 
FLS Driver Component Production Errors ....................................................................... 60 
Chapter 12  Memory Organization ...................................................... 63 
Chapter 13  P1M Specific Information ................................................ 65 
13.1. 
Interaction between the User and FLS Driver Component ............................................. 65 
13.1.1. 
Translation header File ...................................................................................... 65 
13.1.2. 
Services Provided by FLS Driver Component to the User ............................ 65 
13.1.3. 
Parameter Definition File ................................................................................... 66 
13.1.4. 
ISR Functions for FLS module .......................................................................... 66 
13.1.5. 
Data Flash Address Space ................................................................................ 66 
13.2. 
Sample Application............................................................................................................. 66 
13.2.1. 
Sample Application Structure ........................................................................... 66 
13.2.2. 
Building Sample Application ............................................................................ 68 
13.3. 
Memory and Throughput ................................................................................................... 70 
13.3.1. 
ROM/RAM Usage ................................................................................................ 70 
13.3.2. 
Stack Depth......................................................................................................... 71 
13.3.3. 
Throughput Details ............................................................................................ 71 
Chapter 14  Release Details ................................................................ 75 
 


 
List of Figures 
 
Figure 1-1 
System Overview of FLS Driver Component in AUTOSAR MCAL Layer ............ 11 
Figure 1-2 
System Overview of AUTOSAR Architecture ...................................................... 12 
Figure 5-1 
FLS Driver Component Architecture .................................................................... 29 
Figure 5-2 
Component Overview of FLS Driver Component ................................................. 30 
Figure 12-1 
FLS Driver Component Memory Organization ..................................................... 63 
Figure 13-1 
Overview of FLS Driver Sample Application ........................................................ 67 
 
 
List of Tables 
 
Table 4-1                 FLS Driver Protected Resources List ................................................................... 25 
Table 4-2                 FLS Driver Component Deviation List .................................................................. 27 
Table 4-3                 User mode and Supervisor mode details ............................................................. 28 
Table 6-1                 Register Details .................................................................................................... 35 
Table 8-1                 Description of the FLS Driver Component Files ................................................... 42 
Table 10-1               Fls_ConfigType .................................................................................................... 47 
Table 10-2               Fls_AddressType ................................................................................................. 48 
Table 10-3               Fls_LengthType .................................................................................................... 48 
Table 10-4               API Provided by FLS Driver Component .............................................................. 48 
Table 11-1               DET Errors of FLS Driver Component ................................................................. 59 
Table 11-2               DEM Errors of FLS Driver Component ................................................................. 60 
Table 13-1               PDF information for P1M ...................................................................................... 66 
Table 13-2               Interrupt Functions for FLS Module ...................................................................... 66 
Table 13-3               ROM/RAM Details with DET ................................................................................ 70 
Table 13-4               ROM/RAM Details without DET ........................................................................... 70 
Table 13-5               Stack Depth Table ................................................................................................ 71 
Table 13-6               Throughput Details of the APIs ............................................................................ 71 
 
 
 


 
10 

 
 
Introduction                                                                                                                             Chapter 1 
 
Chapter 1 
Introduction 
 
 
The purpose of this document is to describe the information related to FLS 
Driver Component for Renesas P1x microcontrollers. 
 
This  document  shall  be  used  as  reference  by  the  users  of  FLS  Driver 
Component. The system overview of complete AUTOSAR architecture is 
shown in the below Figure: 
 
 
 
 
Microcontroller Drivers 
Memory Drivers 
Communication Drivers 
I/O Drivers 
 
 
 
In
Dr
I
E
n
te
 
x
W
t
t
i
r
e
v
e
r
SP
n
 
a
r
 
GP
MC
n
e
r
a
F
tc
C
R
a
r
n
l

le
P
F
 
C
A
h
 l
 
a
EEP
H
L
I
D
C
 
L
 
T
U
ore
A
x
W
D
  F
l
I
AN
I
S
do
 
 
 
M
l
 
a
N
R
U
O
M
C
 
a
Fl
n
D
D
 
ay
 
g
 
s
D
 
D
 
r
r
T
T
R
d
 
D
 
 
 D
h
a
D
D
D
r
i
 
le
r
 
r
r
i
v
D
iv
e
e
 
sh
OM
iv
r
D
i
r
ri
v
i
D
r
i
v
i
v
 
e
r
e
s
s
D
e
v
v
v
e
ri
e
r
i
 
v
r
t
t
ri
 
er
er
e
r
 
 
 
r
r
er
v
r
r
 
v
 
e
D
i
 
 
 
v
 
e
 
 
er
 
r
er
r
 
r
 
 
iv
 
er
 
 
 
 
 
 

E
E
P
Micro- 
F
M
x
L
G
W
Unit
C
E
o
t
L
SPI
S
C
I
P
A
I
C
D
.
P
l
w
C
D
 
A
M
P
N
W
o
C
A
D
B
T
T
c
er

Controller 
SH
R
 
U
I
 
U
 
I
o
N
M
C
O
 
k
 
 
 

 
 
 
 r
 
 
 
 
 
S
 
 
 
 
 
Figure 1-1  System Overview of FLS Driver Component in AUTOSAR MCAL Layer 
 
The FLS Driver Component is part of BSW which is accessible by RTE. This 
RTE  is  a  middle  ware  layer  providing  communication  services  for  the 
application software and thereby it is possible to map the application software 
components between different ECUs. 
 
The  RTE  provides  the  encapsulation  of  Hardware  channels  and  basic 
services  to the  Application  Software  Components.  So  it  is  possible  to  map 
the Application Software-Components between different ECUs. 
 
The Basic Software Modules are located below the RTE. The Basic Software 
itself  is  divided  into  the  subgroups:  System  Services,  Memory, 
Communication and IO Hardware-Abstraction. The Complex Drivers are also 
located  below  the  RTE.  Among  others,  the  Operating  System  (OS),  the 
Watchdog manager and the Diagnostic services are located  in the System 
Services  subgroup.  The  Memory  subgroup  contains  modules  to  provide 
access to the non-volatile memories, namely Flash and EEPROM. Here the 
flash operation will be handled by flash driver. 
 
On  board  Device  Abstraction  provides  an  interface  to  physical  values  for 
AUTOSAR software components. It abstracts  the physical origin  of signals 
(their paths to the hardware FLSs) and normalizes the signals with respect to 
their  physical  appearance.  The  microcontroller  driver  provides  services  for 
basic  microcontroller  initialization,  power  down  functionality,  reset  and 
microcontroller specific functions required from the upper layers. 
11 

 
 
  Chapter 1                                                                                                                             Introduction 
 
Application Layer 
 
 
AUTOSAR  RTE 
 
 
 
System  Services 
 
 
On board Device Abstraction 
  
 
FLS Driver 
 
 
Microcontroller 
 
 
 
Figure 1-2  System Overview of AUTOSAR Architecture 

 
The FLS application software components are located at the top and can gain 
access to the rest of the ECU and also to other ECUs only through the RTE. 
This  RTE  is  a  middleware  layer  providing  communication  services  for  the 
application software and thereby it is possible to map the application software 
components between different ECUs. 
 
This FLS Software Module is located below the RTE. The FLS Component 
APIs are directly invoked by the application or RTE. The FLS Component is 
responsible for erase/write/read/compare data on the data flash memory. 
 
The FLS component perform the activities like accessing and programming 
the on-chip data flash hardware. 
 
The FLS Component layer comprises of API for erase/write data to on-chip 
data  flash  memory  of  the  device.  The  FLS  Component  conforms  to  the 
AUTOSAR  standard  and  is  implemented  mapping  to  the  AUTOSAR  FLS 
Software Specification. 
 
The  functional  parameters  of  FLS  software  components  are  statically 
configurable to fit as far as possible to the real needs of each ECU. 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12 

 
 
Introduction 
Chapter 1 
 
1.1 
Document Overview 
 
 
The document has been segmented for easy reference. The table below 
provides user with an overview of the contents of each section: 
 
 
 
Section 
Contents 
Section1 (Introduction) 
This section provides an introduction and overview of FLS Driver 
Component. 
Section 2 (Reference Documents)  This section lists the documents referred for developing this document. 
Section 3 (Integration and Build 
This section explains the folder structure, Make file structure for FLS 
Process) 
Driver  Component.  This  section  also  explains  about  the  Make  file 
descriptions,  Integration  of  FLS  Driver  Component  with  other 
components, building the FLS Driver Component along with a sample 
application. 
Section 4 (Forethoughts) 
This section provides brief information about the FLS Driver Component, 
the  preconditions  that  should  be  known  to  the  user  before  it  is  used, 
diagnostic  channel,  limit  check  feature,  sample  and  hold  feature, 
conversion  time  and  stabilization  time,  DMA  and  ISR  operations,  data 
consistency details, deviation list and user mode and supervisor mode. 
Section 5 (Architecture Details) 
This section describes the layered architectural details of the FLS Driver 
Component. 
Section 6 (Registers Details) 
This section describes the register details of FLS Driver Component. 
Section 7 (Interaction between 
This section describes interaction of the FLS Driver Component with the 
The User And FLS Driver 
upper layers. 
Component) 
Section 8 (FLS Driver Component  This  section  provides  information  about  the  FLS  Driver  Component 
Header And Source File 
source files is mentioned. This section also contains the brief note on the 
Description) 
tool generated output file. 
Section 9 (Generation Tool Guide)  This section provides information on the FLS Driver Component Code 
Generation Tool. 
Section 10 (Application 
This section explains all the APIs provided by the FLS Driver 
Programming Interface) 
Component. 
Section 11 (Development And 
This section lists the DET and DEM errors. 
Production Errors) 
Section 12 (Memory 
This section provides the typical memory organization, which must be 
Organization) 
met for proper functioning of component. 
Section 13 (P1M Specific 
This section provides the P1M Specific Information. 
Information) 
Section 14 (Release Details) 
This section provides release details with version name and base 
version. 
 
 
 
 
 
 
 
 
 
 
 
 
13 

 
 
  Chapter 1                                                                                                                             Introduction 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14 

Reference Documents 
Chapter 2 
 
Chapter 2 
Reference Documents 
 
Sl. No. 
Title 
Version 
1.   
AUTOSAR_SWS_FlashDriver.pdf 
3.2.0 
 
 
2.   
r01uh0436ej0130_rh850p1x.pdf 
 1.30 
 
3.   
AUTOSAR_SWS_CompilerAbstraction.pdf 
 3.2.0 
 
 
 
4.   
AUTOSAR_SWS_MemoryMapping.pdf 
 1.4.0 
5.   
AUTOSAR_SWS_PlatformTypes.pdf 
  2.5.0 
6.   
AUTOSAR BUGZILLA (http://www.autosar.org/bugzilla) 
    - 
Note: AUTOSAR BUGZILLA is a database, which contains concerns raised 
against information present in AUTOSAR Specifications. 
 
 
 
15 

  Chapter 2                                                                                                             Reference Documents 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16 

Integration and Build Process 
Chapter 3                                                                                                                                                                                     
 
 
Chapter 3 
Integration and Build Process 
 
 
In this section the folder structure of the FLS Driver Component is explained. 
Description of the Make files along with samples is provided in this section. 
 
Remark  The details about the C Source and Header files that are generated by the 
FLS Driver Generation Tool are mentioned in the  
                 “R20UT3711EJ0101-AUTOSAR.pdf”. 
 
 
3.1. 
FLS Driver Component Make file 
 
The Make file provided with the FLS Driver Component consists of the GNU 
Make  compatible  script  to  build  the  FLS  Driver  Component  in  case  of  any 
change in the configuration. This can be used in the upper level Make file (of 
the application) to link and build the final application executable. 
 
 
3.1.1. Folder Structure 
The files are organized in the following folders: 
 
Remark  Trailing slash ‘\’ at the end indicates a folder 
 
X1X\common_platform\modules\fls\src 
                                                              \Fls.c 
                     \Fls_Internal.c 
                     \Fls_Ram.c 
        \Fls_Version.c 
        \Fls_Private_Fcu.c 
            \Fls_Irq.c 
 
X1X\common_platform\modules\fls\include 
                                        
                   \Fls.h 
                            \Fls_Debug.h 
                            \Fls_Internal.h 
                            \Fls_Private_Fcu.h 
                            \Fls_PBTypes.h 
                            \Fls_Ram.h 
                            \Fls_Types.h 
                            \Fls_Version.h 
                            \Fls_Irq.h 
                            \Fls_RegWrite.h 
 
 
X1X\P1x\modules\fls\sample_application\<SubVariant>\make\ghs 
\App_FLS_<SubVariant>_Sample.mak 
 
                                         X1X\P1x\modules\fls\sample_application\<SubVariant>\obj\<compiler> 
(Note: For example, compiler can be ghs.) 
 
X1X\common_platform\modules\fls\generator\Fls_X1x.dll 
tools/RUCG/RUCG.exe 
 
 
X1X\P1x\common_family\generator\Global_Application_P1x.trxml 
17 

Chapter 3      
 
Integration and Build Process                                                                                                                                                                            
 
\Sample_Application_P1x.trxml 
\P1x_translation.h 
 
X1X\P1x\modules\fls\generator 
\R403_FLS_P1x_BSWMDT.arxml 
 
X1X\P1x\modules\fls\user_manual 
(User manuals will be available in this folder) 
 
Notes:  
1.  <Compiler> can be ghs. 
 
2.  <Device_name> can be 701304, 701305, 701310, 701311, 701312, 701313, 
701314, 701315, 701318, 701319, 701320, 701321, 701322 or 701323. 
                                          
3.  <SubVariant> can be P1M. 
 
4.  <AUTOSAR_version> can be 4.0.3. 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18 

 Forethoughts  
Chapter 4                                                                                                                           
 
 
 
Chapter 4 
Forethoughts 
4.1. 
General 
Following information will aid the user to use the FLS Driver Component 
software efficiently: 
 
FLS General  
• 
The FLS Driver Component supports Data Flash access only. Code Flash 
access is out of scope. User application shall not program Code Flash in 
the  application  mode.  Code  Flash  shall  only  be  programmed  in  safe 
environment in the boot mode. 
• 
The  start-up  code  is  ECU  specific.  FLS  Driver  Component  does  not 
implement the start-up code. 
• 
Example  code  mentioned  in  this  document  shall  be  taken  only  as  a 
reference for implementation. 
• 
All  development  errors  will  be  reported  to  DET  by  using  the  API 
Det_ReportError provided by DET. 
• 
All  production  errors  will  be  reported  to  DEM  by  using  the  API 
Dem_ReportErrorStatus provided by DEM. 
• 
The FLS Driver Component developed supports only on-chip ROM and no 
external devices are considered. Hence the parameters related to external 
devices are ignored by the Generation Tool. 
• 
The FLS Driver Component does not provide functionalities for setting of 
protection flags, boot cluster size, swapping of boot block and flashing of 
boot  block  and  they  are  out  of  scope  for  FLS  Driver  Component 
implementations. 
• 
Maximum value of ‘FlsMaxReadNormalMode’ parameter specifies the size 
of a temporary buffer in RAM which is used when Fls_ReadImmediate and 
Fls_Compare APIs are called.  The resulting RAM consumption has to be 
considered. 
• 
The length of the data that has to be programmed on to the flash should be 
in multiples of flash page. The FLS Driver Component does not pad bytes 
if the length is not in multiples of flash page. It is the responsibility of the 
application to pad bytes such that the length of the data is in multiples of 
flash page. 
• 
Erase,  Write,  Read  and  Blank  check  jobs  are  initiated  within  the 
corresponding  APIs  itself.  Fls_MainFunction  API  shall  act  as  a  checker 
function and it shall check whether the job is completed and initiate the next 
round of job cycle if the job is not completed. 
• 
The  normal  write  verification  using  the  direct  memory  read  access  is 
performed when DET is enabled. 
• 
The  FLS  Driver  Component  can  invoke  user  configurable  call-back 
notification  functions.  However,  the  implementation  of  the  call  back 
functions is the responsibility of the upper layer. 
• 
The parameter ‘FlsCallCycle’ shall be used for timeout implementation. The 
Erase,  Write  and  BlankCheck  timeout  count  values  shall  be  generated 
based  on  FlsCallCycle  and  hardware  specific  atomic  operations’  time 
(‘FlsEraseTime’,  ‘FlsWriteTime’  and  ‘FlsBlankCheckTime’).  To  report 
timeout,  ‘FlsTimeOutMonitoring’  parameter  needs  to  be  configured  as 
TRUE’. In case if the parameter ‘FlsDevErrorDetect’ is also enabled, time 
out  DET  shall  be  reported.  The  ‘FlsCallCycle’  parameter  shall  be 
configured by the user correctly.  Incorrect value may  lead to reporting  of 
timeout DET by Fls_MainFunction. 
• 
There are two possible errors that can be detected by ECC are Single-bit 
errors  (SED)  and  Double-bit  errors  (DED).  The  ECC  error  notification 
feature is incorporated in Read functionality only. So whenever the read is 
19 

Chapter 4                                                                                                                          Forethoughts                                                                                                                             
 
initiated this feature will be enabled always and only notifying to the upper 
layer happens via configurable notification functions. The configuration of 
single  bit  and  double  bit  error  notification  function  parameters  are  user 
selectable. The error notification functions for both single bit and double bit 
ECC error report are configurable with parameters from configuration. 
The parameters are: 
FlsEccSedNotification:  This  parameter  mapped  to  Single-bit  error  (SED) 
notification routine provided by some upper layer module. 
FlsEccDedNotification: This parameter mapped to Double-bit error (DED) 
notification routine provided by some upper layer module. The Double bit 
error is reported to DEM in addition to notification functions. 
• 
The  file  Interrupt_VectorTable.c  provided  is  just  a  Demo  and  not  all 
interrupts  will  be  mapped  in  this  file.  So  the  user  has  to  update  the 
Interrupt_VectorTable.c as per his configuration. 
• 
The accesses to HW registers is possible only in the low level driver layer. 
The user shall never write or read directly from any register, but shall use 
the AUTOSAR standard API provided by the MCAL.  
• 
FlsTimeOutCountValue:  This  parameter  specifies  the  time  out  count 
required  for  erase,  write  and  blank  check  operations  during  interrupt 
mode.Incorrect  configuration  of  this  parameter  shall  lead  to  erroneous 
operations of FLS Driver. 
• 
FlsLoopCount: This parameter is used to avoid the risk of endless loops in 
FLS driver. The loop count can be minimum 32 to maximum 255. 
• 
The configurations provided for fast mode write operation is ignored by the 
Generation Tool and only configurations for normal mode operations and 
fast mode read operation are accepted. 
• 
Fls_SetMode API sets the flash driver operation mode (FAST Mode/SLOW 
Mode) for read operation. This API allows the user to read more number of 
bytes  during  run  time  if  in  case  the  default  mode  is  configured  as 
‘MEMIF_MODE_FAST’.  Fls_SetMode  API  is  not  applicable  for 
Erase/Write/Blank  Check  operations,  because  underlying  hardware  does 
not support it. 
 
FLS Initialization  
• 
Fls_Init API shall enable the flash memory erase/write protection settings if 
it is supported by hardware. Before the flash operation protection shall be 
disabled and after the completion of job, protection shall be again enabled. 
• 
During activation of flash environment (in Fls_Init), the access to Code flash 
is not possible. Hence the user should ensure that all the application and 
supporting  components  code  that  needs  to  be  executed  during  flash 
operation need to locate in RAM. 
• 
The  device  supports  servicing  of  interrupts  during  self-programming. 
During  activation  of  flash  environment  (in  Fls_Init),  the  interrupt  vector 
address  in  the  flash  will  not  be  available.  The  interrupt  vectors  can  be 
relocated  to  RAM  during  flash  programming.  For  details  please  refer 
Exception  Handling  Address  Switching  Function  in  the  according  device 
CPU user manual. 
 
FLS Schedule operation 
• 
The FLS Driver Component’s job processing function (Fls_MainFunction) 
is a polled function. 
• 
In a single cycle of Fls_MainFunction API, the maximum number of bytes 
processed  for  the  fast  read  command  and  normal  read  depends  on  the 
configuration of parameters ‘FlsMaxReadNormalMode’ (if default mode is 
MEMIF_MODE_SLOW)  and  ‘FlsMaxReadFastMode’  (if  default  mode  is 
MEMIF_MODE_FAST). 
20 

 Forethoughts  
Chapter 4                                                                                                                           
 
 
 
• 
In  a  single  cycle  of  Fls_MainFunction  call,  FLS  driver  performs  write 
operation  for  4  bytes,  or  blank  check  operation  for  4  bytes,  or  erase 
operation for 64 bytes. 
 
FLS Erase Operation 
• 
The Fls_Erase API computes the sectors that need to be erased based on 
the provided target address and length. When DET is enabled the error will 
be reported if the length of the bytes to be erased is not in multiples of flash 
sector size. 
 
FLS Read Operation 
• 
Data Flash Memory Read Cycle Setting Register (EEPRDCYCL) is used 
to specify the number of wait cycles to be inserted when reading the data 
in  the  data  flash.  The  initial  value  of  the  register  is  taken  by  default.  If 
required  user  application  shall  set  this  register  as  per  P1M  device  user 
manual. 
• 
Blank Check operation is done implicitly when performing Read operation 
FLS Blank Check Operation 
• 
The processing of blank check operation is applicable for Data flash only. 
 
FLS Fast Read (Read Immediate) Operation 
• 
The functional behavior of FLS driver when calling Fls_ReadImmediate API 
will  be  the  same  as  calling  Fls_Read  API  except  that  blank  check  is 
excluded. 
• 
Blank check is time consuming and is not mandatory for reading an already 
programmed flash area. Fls_ReadImmediate API can be used to perform 
fast read operation without blank check when the user is sure that the area 
to be read is already written with content. 
Suspend and Resume operation 
• 
Fls_Suspend API is used to suspend an ongoing flash operation in order 
to do other flash operations. Only erase and write operations are suspend 
able. 
• 
Fls_Resume  can  only  be  used  to  resume  a  suspended  flash  operation. 
Only erase and write operations are resume able. 
• 
It is not always possible to suspend.  
   E.g.: Any operation ► suspend ► suspend – is not possible. 
                                                     Write or Erase ► suspend ► Erase operation – is not possible 
                                                     Write operation ► suspend ► other Write operation – is not possible 
      Any operation ► suspend ► other operation ► suspend–isn’t possible 
 
FLS Timeout Monitoring 
• 
The  configuration  parameter  FlsTimeoutMonitoring  in  the  FlsGeneral 
container  can  be  used  to  enable/disable  the  timeout supervision  for  FLS 
driver independent of DET settings. 
• 
Only when FlsTimeoutMonitoring is set to TRUE and DET is switched ON, 
a  DET  error  FLS_E_TIMEOUT  will  be  reported  in  case  of  detection  of  a 
timeout error. 
• 
In order to perform timeout monitoring/supervision on flash operations, the 
following  configuration  parameters  should  be  used  properly  according  to 
use-cases. 
  In  the  polling  mode  of  FLS,  the  parameter  FlsCallCycle  shall  be 
configured to specify the cycle time of calls of the FLS main function (in 
21 

Chapter 4                                                                                                                           Forethoughts                                                                                                                             
 
seconds). The timeout count values are calculated internally based on 
the CPU frequency for the respective flash operations, i.e., erase, write, 
blank check, etc.  
  In  the  interrupt  mode  of  FLS,  the  parameter  FlsTimeOutCountValue 
shall be configured to directly specify the timeout count value required 
for erase, write and blank check operations. 
  Fls_MainFunction is crucial for timeout supervision. The call frequency 
of  Fls_MainFunction  shall  be  handled  properly  in  the  upper  layer 
software to be in line with the FLS module configuration. 
Note: since read, read immediate, compare operations are not supported 
in FLS interrupt mode, only the parameter FlsCallCycle is used to calculate 
timeout count values for them irrespective of interrupt or polling mode. For 
write,  erase,  blank  check  operations,  FlsCallCycle  is  used  in  the  polling 
mode of FLS, while FlsTimeOutCountValue is used in the interrupt mode 
of FLS.  
In FlsGeneral container the configuration parameter FlsLoopCount is used 
to avoid the risk of endless loops in the FLS driver. FlsLoopCount is always 
used  in  the  implementation,  hence  it  is  not  dependent  on  the  parameter 
FlsTimeoutMonitoring 
 
4.2. 
Preconditions 
Following preconditions have to be adhered by the user, for proper 
functioning of the FLS Driver Component: 
 
FLS General  
• 
The  user  should  ensure  that  FLS  Driver  Component  API  requests  are 
invoked  in  the  correct  and  expected  sequence  and  with  correct  input 
arguments. 
• 
Correct frequency configuration is essential for Flash programming quality 
and  stability.  Wrong  configuration  could  lead  to  loss  of  data  retention  or 
Flash operation fail. The limits for CPU frequency are device dependent. 
Please refer to the respective device user manuals for correct range. If the 
CPU  frequency  is  a  fractional  value,  round  up  the  value  to  the  nearest 
integer. Do not change power mode (voltage or CPU clock) while FLS is 
performing a Data Flash operation.  If power mode must change the user 
can wait until operations are no longer busy or cancel the ongoing operation 
and reinitialize the FLS module with proper CPU frequency value. 
• 
In case of Flash modification operation (Erase/Write) interruption due to 
e.g. power failure, reset etc., the electrical conditions of the affected Flash 
range (Flash block on erase, Flash write unit on Write) get undefined. It is 
impossible  to  give  a  statement  on  the  read  value  after  the  interruption. 
Thus, the resulting read value is not reliable; the electrical margin for the 
specified  data  retention  may  not  be  given.  In  such  case,  erase  and  re-
write the affected Flash block(s) to ensure data integrity and retention. 
• 
It is not possible to modify the Code Flash in parallel to a modification of 
the Data Flash or vice versa due to shared hardware resources. 
• 
Data  Flash  blocks  are  aligned  to  64  bytes  and  Data  Flash  words  are 
aligned  to  4  bytes.  RH850  devices  also  add  alignment  restrictions  for 
types  larger  than  8  bits.  Please  refer  to  device  hardware  manual  for 
details. 
• 
Validation of input parameters is done only when the static configuration 
parameter  FLS_DEV_ERROR_DETECT  is  enabled.  Application  should 
ensure that the right parameters are passed while invoking the APIs when 
FLS_DEV_ERROR_DETECT is disabled. 
• 
A mismatch in the version numbers will result in compilation error. Ensure 
that the correct versions of the header and the source files are used. 
• 
The  files  Fls_Cfg.h,  Fls_Cbk.h  and  Fls_PBcfg.c  generated  using  FLS 
Generation  Tool  have  to  be  linked  along  with  FLS  Driver  Component 
22 

 Forethoughts  
Chapter 4                                                                                                                           
 
 
 
source files. 
• 
Values for production code Event Ids should be assigned externally by the 
configuration of the DEM. 
• 
Calling FLS functions, especially Cancel/Suspend/Resume/MainFunction 
APIs by a higher priority ISR must be prevented by upper layer to avoid 
possible re-entrancy issue. 
• 
Interrupt mode supports Erase, Write, and Blank Check operations only. 
• 
Cancel  and  suspend/resume  operations  are  not  allowed  in  case  of  two 
instances of FLS Driver Component as the effect is not evaluated. 
• 
All functions are not re-entrant. So, re-entrant calls of any not re-entrant 
function must be avoided. 
• 
User  have  the  responsibility  to  enable  or  disable  the  critical  protection 
using the parameter FlsCriticalSectionProtection. By enabling parameter 
FlsCriticalSectionProtection,  Microcontroller  HW  registers  which  suffer 
from concurrent access by multiple tasks are protected. 
• 
To  use  the  FLS  driver,  the  FCU  firmware  shall  be  stored  and  executed 
from  in  FCURAM.  And  the  software  that  reads  the  FCU  firmware  area 
shall be placed in internal RAM. 
• 
Due  to  these  preconditions,  the  following  four  private  functions  used  in 
Fls_Init() shall be placed in internal RAM at link time using linker derivative 
in order to perform FLS driver initialization properly. 
Fls_FcuCopytoRam()   -  
size 118 Bytes, 
Fls_FcuSwitchBFlash()  -  
size 46 Bytes, 
Fls_FcuClearCache()   -  
size 76 Bytes, 
Fls_FcuGetFWParam()  -  
size 46 Bytes. 
For the integration, the FLS driver code comes under the memory sections 
FLS_START_SEC_PRIVATERAM_CODE 

FLS_STOP_SEC_PRIVATERAM_CODE shall be placed in internal RAM 
for the execution. 
Please refer to the FLS sample application linker script for more details. 
• 
As  the  atomic  time-out  monitoring  in  POLLING  mode  depends 
FlsCallCycle parameter, which is the schedule time of Fls_MainFunction 
call, the user should take care the configuration of that parameter as per 
the intended cycle time of Fls_MainFunction. i.e: If there are any scenarios 
where  Fls_MainFunction  may  be  called  with  different  cycle  time  in  the 
same application, the user shall configure FlsCallCycle with the least cycle 
time, otherwise it may hit early time-out error. 
 
FLS Initialization 
• 
Fls_Init function temporarily disables Code Flash. During this time, since 
the  Code  Flash  is  not  available,  the  FLS  code  shall  be  executed  from 
internal RAM. Please ensure that: (1) User application code execution is 
done  from  other  locations  than  Code  Flash  (e.g.  internal  RAM).    (2)  No 
access  to  Code  Flash  is  allowed,  e.g.  by  jump  to  interrupt/exception 
functions, direct Code Flash read/execution from the CPU, DMA accesses 
to Code Flash. 
• 
The  FLS  Driver  Component  needs  to  be  initialized  by  calling  Fls_Init 
before calling any other Fls functions. 
• 
Fls_Init shall do verification of ECC control registers, so as to ensure ECC 
1-bit error detection and correction, ECC 2-bit error detection are enabled 
for  data  flash  before  initialization  of  FCU.  If  the  user  configurable  ECC 
check for FACI is enabled and if the verification of FACI ECC register fails, 
DEM error FLS_E_ECC_FAILED shall be reported. 
• 
Fls_Init function temporarily disables Code Flash in order to copy the FCU 
firmware and initialize FCU properly.  Afterwards, Code Flash  will be re-
enabled. When failure occurs during re-enabling Code Flash, a call-back 
function  is  invoked  to  notify  the  upper  layer  software.  This  call-back 
function Fls_CallSwitchBFlashErrorNotification() is declared in "Fls.h" as 
23 

Chapter 4                                                                                                                          Forethoughts                                                                                                                             
 
user  interface,  and  shall  be  implemented  in  the  upper  layer  software. 
Countermeasures  (e.g.  hardware  reset)  against  such  failure  shall  be 
considered  in  the  call-back  function  implementation.  And  this  function 
Fls_CallSwitchBFlashErrorNotification() must be properly mapped in RAM 
and executed out of RAM in case of failure. 
 
FLS Schedule operation 
• 
The Fls_MainFunction should be invoked regularly by the Basic 
Scheduler. Though not specified by AUTOSAR, calling 
Fls_MainFunction by polling mechanism is also possible. Ensure that the 
FLS Driver Component is initialized before enabling the invocation of this 
scheduled function to avoid reporting of a DET error when enabled. 
 
FLS Write Operation 
• 
Due  to  RV40  Flash  technology,  hardware  will  implicitly  reject  the  write 
operation  if  the  target  Flash  cells  are  not  blank  (a  kind  of  "overwriting 
guard"). Writing to non-blank Flash cells will result in write error. 
• 
Writing  the  same  area  more  than  once  is  prohibited.  To  write again  the 
flash  memory  area  where  data  has  already  been  written  to,  user  shall 
erase the corresponding area in advance. 
 
FLS Read Operation 
• 
Data  Flash  on  RH850  devices  is  made  with  differential  cells  for  storage. 
This  means  that  reading  erased  but  non-programmed  Data  Flash  areas 
directly (bypassing FLS) will produce undefined data with a tendency to the 
previously  written  data,  and  it  will  most  probably  cause  ECC  error 
exceptions. To avoid this exceptions, use FLS read APIs. 
• 
Fls_ReadImmediate  API  should  not  be  used  to  read  blank  cells.  User 
application shall handle  the  errors associated  with blank cell read  using 
Fls_ReadImmediate API. 
 
FLS Blank Check Operation 
• 
A blank check pass does not confirm that it is possible to write to this word 
(4 Bytes). Also partly written/erased words may have a blank check pass 
but  write  is  not allowed  under  this  condition.  A  blank  check fail  does  not 
confirm a stable read value. Even though parts of a word are at least partly 
written, random read data are still possible, so are ECC error indications 
for single error corrections and double error detection. 
• 
Due to the above shown limitations the information which can be given by 
Fls_BlankCheck, either passing or failing,  is limited. It cannot  be used to 
determine  the  current  state  of  a  flash  cell  in  a  meaning  full  way  without 
additional  information  obtained  by  other  means.  The  blank  check  should 
only be used to confirm or check some flow status but should not be used 
to determine if a flash cell can be read or written. FLS055 from AUTOSAR 
Specification of Flash Driver are not fulfilled here because blank check itself 
is  not  able  to  identify  erasure  state  of  flash  cell  which  is  ready  for  write 
operation.  Please  refer  to  application  note  document  "RV40F  DataFlash 
Usage" for more details about blank check and usage hints 
 
FLS Cancel Operation 
• 
If  a  cancel  request  is  accepted,  during  an  on-going  write  or  erase 
operation  and  a  previous  operation  is  already  suspended,  then  both 
operations will be cancelled. 
 
24 

 Forethoughts  
Chapter 4                                                                                                                           
 
 
 
 
FLS Suspend operation 
• 
Suspend operation shall not be performed in between atomic operations 
of  the  job.  i.e.,  in  between  64  bytes  of  erase  and  4  bytes  of  write, 
suspension  is  not  possible.  The  job  can  be  suspended  only  after 
completion of one atomic operation. 
• 
When an erase job is suspended, calling a write job at the same address 
of that of erase job and then resuming the previously suspended erase job 
shall report DET indicating failure of erase verification. 
 
 
4.3. 
Data Consistency 
To  support  FLS  the  reentrancy  and  interrupt  services,  the  FLS  Software 
component will ensure the data consistency while accessing their own RAM 
storage or hardware registers 
The  FLS  module  will  use  below  macro  for  respective  higher  and  lower 
version. 
 
 
#define FLS_ENTER_CRITICAL_SECTION (Exclusive_Area) 
SchM_Enter_Fls_##Exclusive_Area () 
 
#define FLS_EXIT_CRITICAL_SECTION (Exclusive_Area) 
SchM_Exit_Fls_##Exclusive_Area () 
 
 
The following exclusive areas along with scheduler services are used to 
provide data integrity and register protection for shared resources: 
  FLS_DRIVERSTATE_DATA_PROTECTION 
  FLS_REGISTER_PROTECTION 
  FLS_CODE_FLASH_DISABLED  
 
Note:  The data buffer provided by the application will not be validated 
for data consistency.  It  would be the responsibility of the application to 
ensure  consistency  of  the  flash  data  during  flash  read  and  write 
operations. 
 
Table 4-1                 FLS Driver Protected Resources List 
API Name 
Exclusive Area Type 
Protected 
Resources
 
HW Registers: 
Fls_Init 
FLS_REGISTER_PROTECTION 
FRAMMCR 
FCURAME 
FPCKAR 
Firmware storage 
FLS_CODE_FLASH_DISABLED 
area switching is 
protected 
HW Registers: 
Fls_Erase 
FLS_REGISTER_PROTECTION 
FSADDR 
FEADDR 
IMR 
Driver state data is 
FLS_DRIVERSTATE_DATA_PROTECTION 
protected 
25 

Chapter 4                                                                                                                          Forethoughts                                                                                                                             
 
API Name 
Exclusive Area Type 
Protected 
Resources
 
HW Registers: 
Fls_Write 
FLS_REGISTER_PROTECTION 
FSADDR 
FEADDR 
IMR 
Driver state data is 
FLS_DRIVERSTATE_DATA_PROTECTION 
protected 
HW Registers: 
Fls_MainFunction 
FLS_REGISTER_PROTECTION 
DFERSTC 
DFERSTR 
DFERRINT 
IMR 
Driver state data is 
FLS_DRIVERSTATE_DATA_PROTECTION 
protected 
HW Registers: 
Fls_Resume 
FLS_REGISTER_PROTECTION 
DFERSTC 
DFERSTR 
DFERRINT 
IMR 
Driver state data is 
Fls_Read 
FLS_DRIVERSTATE_DATA_PROTECTION 
protected 
Driver state data is 
Fls_Compare 
FLS_DRIVERSTATE_DATA_PROTECTION 
protected during 
compare operation 
HW Registers: 
Fls_Cancel 
FLS_REGISTER_PROTECTION 
IMR 
Driver state data is 
FLS_DRIVERSTATE_DATA_PROTECTION 
protected during 
cancel operation 
HW registers: 
Fls_BlankCheck 
FLS_REGISTER_PROTECTION 
IMR 
Driver state data is 
FLS_DRIVERSTATE_DATA_PROTECTION 
protected during 
blank check 
operation 
Driver state data is 
Fls_ReadImmediate 
FLS_DRIVERSTATE_DATA_PROTECTION 
protected during 
read immediate 
operation 
IMR 
FLS_FLENDNM_ISR 
FLS_REGISTER_PROTECTION 
                              Note: The highest measured duration of a critical section is 128.537 micro seconds, 
measured for Fls_Init API.  
 
 
 
 
 
 
 
 
 
26 

 Forethoughts  
Chapter 4                                                                                                                           
 
 
 
 
 
 
4.4. 
Deviation List 
                             Table 4-2                 FLS Driver Component Deviation List 
 

 
 
Sl. No.                                  Description 
AUTOSAR 
Bugzilla 
1. 
The  fast  mode  parameter  ‘FlsMaxWriteFastMode’  of  the 

container  ‘FlsConfigSet is unused. 
2. 
The parameters ‘FlsAcLoadOnJobStart’ and 

‘FlsUseInterrupts’ of the container ‘FlsGeneral’ is unused. 
3. 
The flash access routines are not placed into a separate 

C-module like 'Fls_ac.c'. 
4. 
FLS140 and FLS141 are not fulfilled, because the FLS 

module does not load the flash access code for erase/write 
operation to the location in RAM on job start. 
5. 
The parameters ‘FlsProtection’, FlsAcWrite’ and ‘FlsAcErase’  - 
of the container ‘FlsConfigSet’ are unused. 
6. 
The parameters ‘FlsAcLocationErase’, ‘FlsAcLocationWrite’,  - 
‘FlsAcSizeErase’ and ‘FlsAcSizeWrite’ of the container 
‘FlsPublishedInformation’ are unused. 
7. 
The component will support only the on-chip flash memory. 

External flash is not in the scope of this implementation. 
8. 
FLS272,  FLS359,  FLS360  and  FLS361  from  AUTOSAR  - 
Specification  of  Flash  Driver  are  not  fulfilled  here 
because timeout  monitoring  can  be  configured  independent 
of DET setting. However only when both timeout monitoring 
and DET are enabled, FLS_E_TIMEOUT will be reported in 
case of detected timeout error. 
9. 
The  timeout  monitoring  can  be  configured  independent  of  - 
DET setting in FLS. FLS272FLS359FLS360FLS361 can 
only be fulfilled, when both timeout monitoring and DET are 
enabled,  i.e.,  FLS_E_TIMEOUT  will  be  reported  for  the 
respective flash operations in case of detected timeout error. 
10. 
FLS201_Conf from AUTOSAR Specification of Flash Driver  - 
is  not  fulfilled  here  because  FlsSectorList  is  limited  to  one 
sector with fixed sector size. User shall not configure multiple 
sectors. Since data flash is a monolithic on-chip NV memory 
with  homogeneous  block  size,  it  is  not  required  to  have 
multiple sectors with the same sector sizes. Important is that 
FLS driver shall support possible usage of "user pool" (private 
data flash area that cannot be accessed by FLS driver). This 
can 
be 
done 
by 
proper 
configuration 
of 
FlsSectorStartaddress and FlsNumberOfSectors. 
 
 
 
 
 
 
 
27 

Chapter 4                                                                                                                           Forethoughts                                                                                                                             
 
 
 
4.5. 
User mode and supervisor mode  
The below table specifies the APIs which can run in user mode, supervisor        
mode or both modes 
                            Table 4-3                 User mode and Supervisor mode details 
 

Sl. No  API Name 
User 
Supervisor   Known limitation in User mode 
Mode 
Mode 



The Fls_Init is failing in User mode. 
This  is  because  inside  Fls_Init 
function  STSR  instruction  (to  store 
contents of system register) is called 
for  storing  contents  of  ICCTRL 
Fls_Init 
(instruction cache control) to system 
register. Since the ICCTRL have the 
access 
permission 
in 
only 
supervisor  mode,  Fls_Init  fails  in 
user mode. 

Fls_Read 




Fls_SetMode 




Fls_Write 




Fls_Cancel 




Fls_GetStatus 




Fls_GetJobResult 




Fls_Erase 




Fls_Compare 



10 
Fls_GetVersionInfo 



11 
Fls_MainFunction 



12 
Fls_BlankCheck 



13 
Fls_ReadImmediate 



14 
Fls_Suspend 



15 
Fls_Resume 



          Note: Implementation of critical section is not dependent on MCAL. Hence critical 
section is not considered to the entries for user mode in the above table. 
 
 
28 

 Architecture Details 
Chapter 5 
 
 Chapter 5 
Architecture Details 
The FLS Software architecture is shown in the following figure. The FLS user 
shall directly use the APIs to configure and execute the FLS conversions: 
 
 
Application Layer 
 
 
AUTOSAR  RTE 
 
 
 
System  Services 
 
 
  On board Device Abstraction 
  
 
FLS Driver 
 
 
Microcontroller 
 
 
 
Figure 5-1  FLS Driver Component Architecture 
 
The basic architecture of the FLS Driver Component is illustrated in the 
following Figure: 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29 

  Chapter 5                                                                                                               Architecture Details                                                                                                                             
 
 
Application Layer 
 
 
 
 
Fls_SetMode 
Fls_GetVersion
Fls_Read 
Fls_Compare 
Fls_GetJobResult 
Fls_Write 
 
Info 
Fls_GetStatus 
Fls_Cancel 
 
 
 
Fls_Res
 
Fls_Sus
Fls_Init 
Fls_Bla
Fls_Rea
Fls_Erase 
ume 
Fls_MainFun
pend 
nkChec
dImmed
 
ction 
Sets 

iate 
Flash 
  Driver’s 
  Operatio
Returns 
Compare 
Fls_Initiate
Fls_Process
bytes in 
  n Mode 
version 
WriteJob () 
Read () 
buffer with 
Returns 
Fls_Proces
informat
flash 
the status/r 
 
sCancel () 
ion 
memory 
esult 
 
 
 
Fls_Initi
Perfor
Fls_Init
Resumes 
ateBlan
 
Suspend
Fls_Fcu
Performs the 
ms fast 
iateEra
previously 
on-
Init () 
kCheckJ
job processing 
read 
seJob () 
 
suspended 
going 
ob () 
of erase,                
operati
job 
 
flash job 
write, read and 
on. 
compare jobs. 
 
 
 
FLS Driver Layer 
 
 
 
Microcontroller 
 
 
 

Figure 5-2  Component Overview of FLS Driver Component 
 
The internal architecture of FLS Driver Component is shown in the above figure. 
The  FLS  Driver  Component  Software  Component  provides  services  for  the 
following processes: 
 
The FLS Driver Component is divided into the following sub modules based on 
the functionality required: 
 
• 
Initialization 
• 
Erasing the flash memory 
• 
Writing to the flash memory 
• 
Reading the flash memory 
• 
Fast Read to the application memory without performing blank check 
• 
Validating contents of flash memory 
• 
Cancellation of Request 
• 
Reading result and status information 
• 
Module version information 
• 
Blank check of flash memory 
• 
Job Processing 
• 
Fls_Suspend suspends the on-going job. 
• 
Fls_Resume performs the resume of previous suspended job. 
 
30 

 Architecture Details 
Chapter 5 
 
Initialization 
 
The  initialization  sub-module  provides  the  service  for  initialization  of  the  flash   
driver  and  initializes  the  global  variables  used  by  the  FLS  Component.  FCU 
initialization  API  initializes  FCU  Global  Variable  Structure  and  prepares  the 
environment. After that firmware code is copied to the RAM and FACI frequency 
is set. The function also resets the FCU and initialize the hardware registers to 
default values. 
 
The API related to this sub-module is Fls_Init. 
 
Flash Memory Erasing Module 
 
This sub-module provides the service for erasing the blocks of the flash memory.  
The request will be processed by the job processing function Fls_MainFunction. 
The  First  round  of  erase  operation  is  initiated  from  within  the  API  itself.  
Fls_MainFunction  is  then  called  to  erase  the  remaining  requested  data  flash 
memory blocks. The job is processed till the requested numbers of blocks are 
erased in the flash memory. Blank Check shall be done to ensure that the blocks 
are completely erased. 
The API related to this sub-module is Fls_Erase. 
 
Flash Memory Reading Module 
 
This  sub-module  provides  the  service  for  reading  the  contents  of  the  flash 
memory.  The  request  will  be  processed  by  the  job  processing  function 
Fls_MainFunction. 
In  this  job  processing  function,  blank  check  for  the  specified  words  shall  be 
performed first. If the cell is blank, then the application buffer shall be filled with 
the value specified by the parameter ‘FlsErasedValue’. If the cell is not  blank, 
then reading of the specified words from the Flash memory shall be performed. 
This sub-module reads the specified number of words from consecutive Flash 
addresses  starting  at  the  specified  address  and  writes  it  into  a  buffer.  Read 
operation  shall  be  initiated  within  the  sub-module  itself.  Single  cycle  of 
Fls_MainFunction  shall  read  the  maximum  number  of  bytes  configured 
depending  on  the  parameters  ‘FlsMaxReadNormalMode’  (if  default  mode  is 
MEMIF_MODE_SLOW)  and  ‘FlsMaxReadFastMode’  (if  default  mode  is 
MEMIF_MODE_FAST). The job is processed till the requested bytes of length 
are copied into the application buffer. 
The API related to this sub-module is Fls_Read. 
 
Flash Memory Writing Module 
 
This sub-module provides the service for writing to the flash memory. 
 
The  request  shall  be  processed  by  the  job  processing  function 
Fls_MainFunction. The First round of write operation is initiated from within the 
API itself. In this job processing function, the writing of specified number of data 
bytes from buffer to flash  memory shall be performed. The function  writes the 
specified number of words from buffer to consecutive Flash addresses starting 
at the specified address. Single cycle of Fls_MainFunction shall write 4 bytes of 
31 

Chapter 5                                                                                                                Architecture Details 
 
data from target buffer to flash addresses. The job is processed till the requested 
number of bytes is written to the flash memory 
The API related to this sub-module is Fls_Write. 
 
Flash Memory Contents Validating Module 
 
 
This  sub-module  provides  the  service  for  comparing  the  contents  of  the  flash 
memory with the application buffer.  
The  request  shall  be  processed  by  the  job  processing  function 
Fls_MainFunction. 
 
This sub-module shall read the defined number of words in flash and store it in 
the temporary buffer. Then actual data in application buffer shall be compared 
with data  in  temporary  buffer.  Here  data  shall  be  compared  in  terms  of  bytes. 
Single  cycle  of  Fls_MainFunction  shall  read  the  data  from  the  flash  memory 
depending  on  configuration  of  parameter  ‘FlsMaxReadNormalMode’  for  data 
flash.  The  job  is  processed  till  the  requested  number  of  bytes  are  read  and 
compared with the application buffer. 
 
The API related to this sub-module is Fls_Compare. 
 
Request Set Mode Module 
 
This sub-module sets the flash driver operation mode. 
 
The API related to this sub-module is Fls_SetMode. 
 
Request Cancellation Module 
 
This  sub-module  provides  the  service  for  cancelling  an  on-going  memory 
request.  
 
After  aborting  the  current  on-going  memory  operations  this  sub-  module 
prepares  internal  variables  to  accept  the  next  Read/Write/Erase/  Compare 
command.  The  cancel  request  will  be  synchronous  and  a  new  job  can  be 
requested  immediately  after  the  return  from  this  function.  A  suspended  job  is 
also cancelled. 
 
The API related to this sub-module is Fls_Cancel. 
 
Result Reading and Status Information Providing Module 
 
This  sub-module  provides  the  services  for  getting  the  current  status  of  the 
module  or  results  of  the  initiated  job  request  or  the  response  to  previously 
issued command and return the current status of the current job execution. 
 
The APIs related to this sub-module are Fls_GetStatus, Fls_GetJobResult. 
 
Software Component Version Info Module 
 
This module provides API for reading Module Id, Vendor Id and vendor specific 
version numbers. 
 
The API related to this sub-module is Fls_GetVersionInfo. 
 
 
 
 

32 
 

 Architecture Details 
Chapter 5 
 
Job Processing Module 
 
The  command  requests  are  always  processed  by  the  main  function  that  is 
invoked cyclically by the scheduler. This function will perform the status check 
while processing the flash operations requests. This API derives the internal 
driver status. Completion of the flash operation needs to be checked in order 
to continue the reprogramming flow. A Time-out feature is available with the 
help of time-out counter operation in this API. 
 
The API related to this sub-module is Fls_MainFunction. 
 
Flash Memory Blank Check Module 
 
This  sub-module  provides  the  service  for  performing  blank  check  of  the  flash 
memory words. The request shall be processed by the job processing function 
Fls_MainFunction.  This  function  is  invoked  to  perform  the  blank  check  of  the 
single  word.  The  job  is  processed  till  the  requested  numbers  of  words  are 
performed with the blank check in the flash memory. 
The API related to this sub-module is Fls_BlankCheck. 
 
Flash Memory Fast Read Module 
 
This  sub-module  provides  the  service  for  reading  the  contents  of  the  flash 
memory.  The  request  shall  be  processed  by  the  job  processing  function 
Fls_MainFunction.  This  function  reads  the  specified  number  of  words  from 
consecutive Flash addresses starting at the specified address and writes it into 
a buffer. Single cycle of Fls_MainFunction, shall read the data from the data flash 
memory. The data from flash memory (source address) is read to the data buffer 
(Target address) of application without performing blank check before read. The 
job is processed till the requested bytes of length are copied into the application 
buffer.  
The API related to this sub-module is Fls_ReadImmediate. 
 
Job Suspend Module 
 
This sub-module provides the service of suspending the on-going job. The driver 
goes  into  idle  state  after  the  job  is  suspended.  Fls_Suspend  is  asynchronous 
API. Fls_Suspend shall reject any unacceptable request of suspension such as 
issuing suspend request for operations other than erase and write and if no on-
going job is present.  
 
The API related to this sub-module is Fls_Suspend. 
 
Job Resume Module 
 
This sub-module provides the service for performing the resume of the previous 
suspended  job.  Fls_Resume  is  synchronous  API.  Fls_Resume  acknowledges 
the resume request and it returns immediately. 
 
The API related to this sub-module is Fls_Resume. 
 
 
 
 
 
33 

Chapter 5                                                                                                                Architecture Details 
 
 
 
 
 
 
 
 
 
34 
 

Registers Details 
Chapter 6 
 
 Chapter 6 
Registers Details 
This section describes the register details of FLS Driver Component. 
 
Table 6-1                 Register Details 
 
Register 
Register 
 
Config 
Registers 
Access 
Access 
Macro/Variable 
API Name 
Parame
Used 
8/16/32 
R/W/RW 
ter 
bits 
 
Fls_Init 
FSADDR 
32 
RW 

LulStartAddr 
FLS_FCU_ADDR_REG_RESET 
FEADDR 
32 
RW 

LulEndAddr 
FLS_FCU_ADDR_REG_RESET 
FSTATR 
32 


LulRegValue 
LulReturnValue 
FENTRYR 
16 
RW 

LddMode 
FLS_FCU_REGBIT_FENTRY_KEY 
LusModeRegVal 
FASTAT 

RW 

FLS_FCU_REGBIT_FASTAT_CMDL

FCURAME 
16 
RW 

FLS_FCU_REGBIT_FCURAME_FC
RME 
FLS_FCU_REGBIT_FCURAME_KEY 
FLS_FCU_REGBIT_FCURAME_RE
SET 
FLS_FCU_REGBIT_FCURAME_FRA
MTRAN 
FPCKAR 
16 
RW 

FLS_FCU_REGBIT_FPCKAR_KEY 
LusFaciFreq 
FRTEINT 

RW 

FLS_FACI_FRTEINT_RESET_VAL 
FCUFAREA 

RW 

LucModeVal 
ICCTRL 
32 
RW 

FLS_FCU_SYSTEM_REGISTER_IC
CTRL 
CDBCR 
32 
RW 

FLS_FCU_SYSTEM_REGISTER_CD
BCR 
DFECCCTL 
16 
RW 

FLS_DFECCCTL_RESET_VAL 
DFERRINT 

RW 

FLS_ DFERRINT _RESET_VAL 
DFTSTCTL 
16 
RW 

FLS_  DFTSTCTL _RESET_VAL 
FHVE3 
32 
RW 

FLS_FLASH_PROTECTION_OFF 
FLS_FLASH_PROTECTION_ON 
FHVE15 
32 
RW 

FLS_FLASH_PROTECTION_OFF 
FLS_FLASH_PROTECTION_ON 
35 

Chapter 6                                                                                                                       Registers Details 
 
 
Registe
Register 
 

Access 
Macro/Variable 
Registers 
Config 
API Name 
Access 
R/W/RW 
Used 
Parameter 
8/16/32 
 
bits 
Fls_Erase, 
FSADDR 
32 
RW 

LulCurrentStartAddr 
Fls_MainFunction, 
FLS_FCU_ADDR_REG_RESET 
Fls_Resume 
LulStartAddr 
FEADDR 
32 
RW 

LulCurrentEndAddr 
FLS_FCU_ADDR_REG_RESET  
LulEndAddr 
FSTATR 
32 


LulRegValue LulReturnValue 
FENTRYR 
16 
RW 

LddMode 
FLS_FCU_REGBIT_FENTRY_KEY 
LusModeRegVal 
ICFLENDNM  16 
RW 

LusRegvalue 
IMRn 
16 
RW 

pFlEndImrAddress, 
usFlEndImrMask 
FHVE3 
32 
RW 

FLS_FLASH_PROTECTION_OFF 
FLS_FLASH_PROTECTION_ON 
FHVE15 
32 
RW 

FLS_FLASH_PROTECTION_OFF 
FLS_FLASH_PROTECTION_ON 
Fls_Write, 
FSADDR 
32 
RW 

LulCurrentStartAddr 
Fls_MainFunction, 
FLS_FCU_ADDR_REG_RESET 
Fls_Resume 
FEADDR 
32 
RW 

LulCurrentStartAddr +                                           
FLS_FCU_WRITE_SIZE) - 
FLS_FCU_ONE 
FLS_FCU_ADDR_REG_RESET 
FSTATR 
32 


LulRegValue 
LulReturnValue 
FENTRYR 
16 
RW 

LddMode 
FLS_FCU_REGBIT_FENTRY_KEY 
LusModeRegVal 
ICFLENDNM  16 
RW 

LusRegvalue 
IMRn 
16 
RW 

pFlEndImrAddress, 
usFlEndImrMask 
FHVE3 
32 
RW 

FLS_FLASH_PROTECTION_OFF 
FLS_FLASH_PROTECTION_ON 
FHVE15 
32 
RW 

FLS_FLASH_PROTECTION_OFF 
FLS_FLASH_PROTECTION_ON 
Fls_Cancel 
FENTRYR 
16 
RW 

LddMode 
FLS_FCU_REGBIT_FENTRY_KEY 
LusModeRegVal 
FASTAT 

RW 

FLS_FCU_REGBIT_FASTAT_CMDLK 
FSTATR 
32 


LulReturnValue 
ICFLENDNM  16 
RW 

LusRegvalue 
IMRn 
16 
RW 

pFlEndImrAddress, 
usFlEndImrMask 
36 
 

Registers Details 
Chapter 6 
 
 
 
Registe
Register 
 

Access 
Config 
Macro/Variable 
Registers 
API Name 
Access 
R/W/RW 
Parame
Used 
8/16/32 
 
ter 
bits 
Fls_Read, 
FSADDR 
32 
RW 

LulStartAddr 
Fls_MainFunction, 
FLS_FCU_ADDR_REG_RESET  
Fls_Resume 
FEADDR 
32 
RW 

LulEndAddr 
FLS_FCU_ADDR_REG_RESET  
DFERSTC 



FLS_FCU_REGBIT_DFERSTC_ER
RCLR 
DFERRINT 

RW 

LucRegValue 
FLS_FCU_REGVAL_DFERRINT_N
OINT 
DFERSTR 



LulErrorRegValue 
FSTATR 
32 


LulReturnValue 
LulRegValue 
ICFLENDNM 
16 
RW 

LusRegvalue 
FBCSTAT 



LulRegValue 
FENTRYR 
16 
RW 

LddMode 
FLS_FCU_REGBIT_FENTRY_KEY 
LusModeRegVal 
Fls_ReadImmedia
DFERSTC 



FLS_FCU_REGBIT_DFERSTC_ER
te, 
RCLR 
Fls_MainFunction 
DFERRINT 

RW 

LucDFERRInt 
 
FLS_FCU_REGVAL_DFERRINT_N
 
OINT 
 
DFERSTR 



LulDFERStatus 
Fls_Compare, 
DFERSTC 



FLS_FCU_REGBIT_DFERSTC_ER
Fls_MainFunction 
RCLR 
DFERRINT 

RW 

LucRegValue 
FLS_FCU_REGVAL_DFERRINT_N
OINT 
DFERSTR 



LulErrorRegValue 
ICFLENDNM 
16 
RW 

LusRegvalue 
Fls_BlankCheck, 
FSADDR 
32 
RW 

LulStartAddr 
Fls_MainFunction 
Fls_Resume 
FEADDR 
32 
RW 

LulEndAddr 
 
FSTATR 
32 


LulReturnValue 
 
LulRegValue 
 
 
FBCSTAT 



LulRegValue 
 
FENTRYR 
16 
RW 

LddMode 
 
FLS_FCU_REGBIT_FENTRY_KEY 
 
LusModeRegVal 
 
ICFLENDNM 
16 
RW 

LusRegvalue 
IMRn 
16 
RW 

pFlEndImrAddress, 
usFlEndImrMask 
FHVE3 
32 
RW 

FLS_FLASH_PROTECTION_OFF 
FLS_FLASH_PROTECTION_ON 
FHVE15 
32 
RW 

FLS_FLASH_PROTECTION_OFF 
FLS_FLASH_PROTECTION_ON 
 
37 

Chapter 6                                                                                                                       Registers Details 
 
 
Register 
Register 
 
Registers 
Access 
Access 
Config 
Macro/Variable 
API Name 
Used 
8/16/32 
R/W/RW 
Parameter 
bits 
 
Fls_GetStatus 





Fls_GetJobResult 





Fls_Suspend 





Fls_GetVersionInfo 





 
38 
 

Interaction between the User and FLS Driver Component 
Chapter 7 
 
 
 Chapter 7  Interaction between the User and FLS 
Driver Component 
 
The  details  of  the  services  supported  by  the  FLS  Driver  Component  to  the    
upper layers users and the mapping of the channels to the hardware units is 
provided in the following sections: 
 
7.1. 
Services Provided by FLS Driver Component to the 
User 

 
The FLS Driver Component provides the following functions to upper layers: 
 
• 
Writing contents to data flash memory 
• 
Erase flash memory sectors 
• 
Read flash contents to the application memory 
• 
Fast Read to the application memory without performing blank check 
• 
Validate flash contents comparing with the application memory 
• 
Cancel the on-going erase, write, read or compare requests. 
• 
Read the result of the last job 
• 
Blank check of flash memory 
• 
Read the status of the FLS Driver Component. 
• 
Fls_Suspend suspends the on-going job. 
• 
Fls_Resume performs the resume of previous suspended job. 
 
 
 
 
 
 Caution: 
 
• 
If other software components in BSW are accessing data flash or FACI 
registers, then the synchronization between FLS and other software 
components shall be handled by user application to ensure data 
consistency. 
 
• 
Please pay attention that many FLS APIs are non-reentrant. This means it 
is not allowed to call a non-reentrant API function from a different program 
context (e.g. interrupt service routines, other threads) while another or the 
same non-reentrant API function is already running. 
In particular, when calling Fls_MainFunction, user application shall avoid 
collision with other non-reentrant FLS APIs.
39 

Chapter 7                                                Interaction between the User and FLS Driver Component 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40 
 

  FLS Driver Component Header and Source File Description 
Chapter 8 
 
Chapter 8  FLS Driver Component Header and Source 
File Description 
 
This section explains the FLS Driver Component’s C Source and C Header files. 
These files have to be included in the project application while integrating with 
other modules. 
 
The C header file generated by FLS Driver Code Generation Tool:  
 
• 
Fls_Cbk.h 
• 
Fls_Cfg.h 
 
                                         The C source file generated by FLS Driver Code Generation Tool:  
 
• 
Fls_PBcfg.c 
 
The FLS Driver Component C header files: 
• 
Fls.h 
• 
Fls_Debug.h 
• 
Fls_Internal.h 
• 
Fls_Types.h 
• 
Fls_PBTypes.h 
• 
Fls_Version.h 
• 
Fls_Ram.h 
• 
Fls_Private_Fcu.h 
• 
Fls_Irq.h 
• 
Fls_RegWrite.h 
 
The FLS Driver Component source files: 
• 
Fls.c 
• 
Fls_Internal.c 
• 
Fls_Ram.c 
• 
Fls_Private_Fcu.c 
• 
Fls_Version.c 
• 
Fls_Irq.c 
 
The Stub C header files: 
• 
Compiler.h 
• 
Compiler_Cfg.h 
• 
MemMap.h 
• 
Platform_Types.h 
• 
rh850_Types.h 
• 
Dem.h 
• 
Dem_Cfg.h 
• 
Det.h 
• 
MemIf.h 
• 
MemIf_Types.h 
• 
Os.h 
• 
Rte.h 
• 
Std_Types.h 
• 
SchM_Fls.h 
 
 
The description of the FLS Driver Component files is provided in the table 
below: 
 
 
                                            
 

41 

Chapter 8                                             FLS Driver Component Header and Source File Description 
 
 
 
                       Table 8-1                 Description of the FLS Driver Component Files 
 
File 
Details 
Fls_Cfg.h 
This file is generated by the Renesas Unified Code Generator Tool for 
various FLS Driver Component pre-compile time parameters.  The macros 
and the parameters generated will vary with respect to the configuration in 
the input ECU Configuration description file. This file also contains the 
handles for Fls Pin configuration set. 
Fls_Cbk.h 
This file contains declarations of notification functions to be used by the 
application. The notification function name can be configured. 
Fls_PBcfg.c 
This file contains post-build configuration data. The structures 
related to FLS Initialization are provided in this file. Data structures 
will vary with respect to parameters configured. 
Fls.h 
This file provides extern declarations for all the FLS Driver Component APIs. 
This file provides service Ids of APIs, DET Error codes and type definitions 
for FLS Software initialization structure. This header file shall be included in 
other modules to use the features of FLS Driver Component. 
Fls_Debug.h 
This file provides Provision of global variables for debugging purpose. 
Fls_Internal.h 
This file contains the declarations of the internally used functions. 
Fls_Types.h 
This file contains the common macro definitions and the data types 
required internally by the FLS software component. 
Fls_Ram.h 
This file contains the extern declarations for the global variables that are 
defined in Fls_Ram.c file and the version information of the file. 
Fls_Version.h 
This file contains the macros of AUTOSAR version numbers of all modules 
that are interfaced to FLS. 
Fls_Irq.h 
This file contains the external declaration for the interrupt functions used 
by FLS Driver Module. 
Fls_Private_Fcu.h 
This file contains API Declarations of Flash Control Unit specific functions 
 
Fls_RegWrite.h 
This file is to have macro definitions for the registers write and verification. 
Fls.c 
This file contains the implementation of all APIs. 
Fls_Ram.c 
This file contains the global variables used by FLS Driver Component. 
Fls_Private_Fcu.c 
This file contains FCU related API implementations 
Fls_Internal.c 
This file contains the definition of the internal functions that access the 
hardware registers. 
Fls_Version.c 
This file contains the code for checking version of all modules that are 
interfaced to FLS. 
Fls_Irq.c 
This file contains the implementation of all the interrupt functions used by 
FLS Driver Module. 
Compiler.h 
Provides compiler specific (non-ANSI) keywords. All mappings of keywords, 
which  are  not  standardized,  and/or  compiler  specific  are  placed  and 
organized in this compiler specific header. 
Compiler_Cfg.h 
This file contains the memory and pointer classes. 
MemMap.h 
This file allows to map variables, constants and code of modules to 
individual memory sections. Memory mapping can be modified as per ECU 
specific needs. 
42 
 

  FLS Driver Component Header and Source File Description 
Chapter 8 
 
File 
Details 
Platform_Types.h 
This file provides provision for defining platform and compiler dependent 
types. 
Fls_PBTypes.h 
This file contains the type definitions of post build parameters. It also 
contains the macros used by the FLS Driver Component. 
rh850_Types.h 
This file provides macros to perform supervisor mode (SV) write enabled 
Register ICxxx and IMR register writing using OR/AND/Direct operation. 
Dem.h 
This file is a stub for DEM Component. 
Dem_Cfg.h 
This is a stub file used for defining dem event parameters used in the 
configuration. 
Det.h 
This file is a stub for DET Component. 
MemIf.h 
This file is a stub for MEMIF Module. 
MemIf_Types.h 
This file is a stub for MemIf component. 
Os.h 
This file is a stub for Os Component. 
Rte.h 
This file is a stub for Rte Component. 
Std_Types.h 
This file is a stub file which contains the standard type definitions. 
SchM_Fls.h 
This file is a stub file which is used to get the support of critical section 
protection. 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43 

Chapter 8                                             FLS Driver Component Header and Source File Description 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44 
 

Generation Tool Guide 
Chapter 9 
 
Chapter 9 
Generation Tool Guide 
For information on the FLS Driver Code Generation Tool, please refer 
“R20UT3711EJ0101-AUTOSAR.pdf” document. 
45 

Chapter 9                                                                                                                              Generation Tool Guide 
 
46 
 

 Application Programming Interface 
Chapter 10 
 
Chapter 10  Application Programming Interface 
This section explains the Data types and APIs provided by the FLS Driver 
Component to the Upper layers. 
 
10.1.  Imported Types 
 
This section explains the Data types imported by the FLS Driver Component 
and lists its dependency on other modules. 
 
10.1.1.  Standard Types 
In this section all types included from the Std_Types.h are listed: 
• 
Std_ReturnType 
• 
Std_VersionInfoType 
 
10.1.2.  Other Module Types 
In this section all types included from the Dem.h and MemIf_Types.h are listed. 
• 
Dem_EventIdType 
• 
Dem_EventStatusType 
• 
Memif_JobResultType 
• 
Memif_StatusType 
• 
MemIf_ModeType 
 
10.2. 
Type Definitions 
 
This section explains the type definitions of FLS Driver Component according 
to AUTOSAR Specification 
 
10.2.1  Fls_ConfigType 
 
                         Table 10-1               Fls_ConfigType 
 
Name: 
Fls_ConfigType 
Type: 
Structure 
 
Type 
Name 
Explanation 
 
 
unit32 
ulStartOfDbToc 
Database start value 
 
 
void* 
pJobEndNotificationPointer 
Pointer to job end 
 
callback notification 
 
 
void* 
pJobErrorNotificationPointer 
Pointer to job error 
 
callback notification 
 
void* 
pEccSEDNotificationPointer 
Pointer to ECC SED 
 
callback notification 
 
 
void* 
pEccDEDNotificationPointer 
Pointer to ECC DED 
 
callback notification 
 
uint32 
ulFlsSlowModeMaxReadBytes  Maximum number of 
 
Read bytes in Normal 
 
Mode 
 
uint32 
ulFlsFastModeMaxReadBytes 
Maximum number of 
 
Read bytes in fast 
 
Mode 
 
47 

Chapter 10                                                                                   Application Programming Interface 
 
 
uint16* 
pFlEndImrAddress 
Address for error 
 
IMR registers 
 
 
uint16 
usFlEndImrMask 
Mask for IMR 
 
register 
 
volatile Fls_FACIRegType 
pFACIRegPtr 
Base Address for 
 
FACI Registers 
  
volatile Fls_ECCRegType 
pECCRegPtr 
Base Address for 
 Element: 
ECC Registers 
MemIfModeType 
ddDefaultMode 
Default Mode value 
 
Structure to hold the flash driver configuration set. The contents of the initialisation data 
Description: 
structure are specific to the flash memory hardware  
 
 
 
10.2.2  Fls_AddressType 
 
 
                        Table 10-2               Fls_AddressType 
 
Name: 
Fls_AddressType 
Type: 
uint 
 Range: 
Size depends on target platform and flash 
 
8/16/32 bits 
device.  
 
 
  Description: 
Used as address offset from the configured flash base address to access a certain 
Range: 
flash memory area.  
 
 
10.2.3  Fls_LengthType 
 
                         Table 10-3               Fls_LengthType 
 
 
Name: 
Fls_LengthType 
Type: 
uint 
 Range: 
Shall be the same type as 
 
Fls_AddressType because of arithmetic 
 
Same as Fls_AddressType 
operations. Size depends on target 
 
platform and flash device.  
 
 
 Description: 
Specifies the number of bytes to read/write/erase/compare.  
 
 
 
 
10.3. 
Function Definitions 
 
                             Table 10-4               API Provided by FLS Driver Component 
 
 
Sl. No 
API’s name 
 
1. 
Fls_Init 
2. 
Fls_Erase 
3. 
Fls_Write 
4. 
Fls_Cancel 
5. 
Fls_GetStatus 
6. 
Fls_GetJobResult 
48 
 

 Application Programming Interface 
Chapter 10 
 
 
Sl. No 
API’s name 
 
7. 
Fls_Read 
8. 
Fls_Compare 
9. 
Fls_SetMode 
10. 
Fls_GetVersionInfo 
11. 
Fls_MainFunction 
12. 
Fls_BlankCheck 
13. 
Fls_ReadImmediate 
14. 
Fls_Suspend 
15. 
Fls_Resume 
 
10.3.1. 
Fls_Init 
 
Name: 
Fls_Init 
 
FUNC(void, FLS_PUBLIC_CODE) Fls_Init(P2CONST(Fls_ConfigType, 
 Prototype:  
AUTOMATIC, FLS_APPL_CONST) ConfigPtr) 
 
  Service ID: 
0x00 
Prototype: 
Sync/Async: 
Synchronous 
Reentrancy: 
Non-Reentrant 
 
Type 
Parameter 
Value/Range 
Parameters In: 
Fls_ConfigType 
ConfigPtr 
NA 
  Parameters InOut: 
None 
NA 
NA 
Parameters out: 
None 
NA 
NA 
 
Type 
Possible Return Values 
Return Value: 
void 
NA 
Description: 
This service performs initialization of the FLS Driver component. 
Configuration 
 None 
Dependency: 
Preconditions: 
None 
 
10.3.2. 
Fls_Erase 
 
Name: 
Fls_Erase 
 
FUNC(Std_ReturnType, FLS_PUBLIC_CODE) Fls_Erase (Fls_AddressType 
  
TargetAddress, Fls_LengthType Length) 
 Prototype:  
  Service ID: 
0x01 
 
Protot
Sync y
/A pe
sy : 
nc: 
Asynchronous 
Reentrancy: 
Non-Reentrant 
 
Type 
Parameter 
Value/Range 
 
Parameters In: 
49 

Chapter 10                                                                                   Application Programming Interface 
 
Parameters In: 
Fls_AddressType 
TargetAddress  Target address in flash memory. This 
address offset will be added to the flash 
memory base address.  
Min.: 0  
Max.: FLS_SIZE - 1  
Fls_LengthType 
Length 
Number of bytes to erase  
Min.: 1  
Max.: FLS_SIZE - TargetAddress 
 Parameters InOut: 
None 
NA 
NA 
Parameters out: 
None 
NA 
NA 
 
Type 
Possible Return Values 
Return Value: 
Std_ReturnType 
E_OK: If Erase command has been accepted. 
E_NOT_OK: If Erase command has not been accepted. 
Description: 
This API will erase the one or more complete flash sectors.  
Configuration 
None 
Dependency: 
Preconditions: 
None 
 
10.3.3. 
Fls_Write 
 
Name: 
Fls_Write 
 
FUNC(Std_ReturnType, FLS_PUBLIC_CODE) Fls_Write(Fls_AddressType 
 
TargetAddress,P2CONST(uint8, AUTOMATIC, FLS_APPL_CONST) 
 
SourceAddressPtr, Fls_LengthType Length) 
Prototype: 
Service ID: 
0x02 
Sync/Async: 
Asynchronous 
Reentrancy: 
Non-Reentrant 
 
Type 
Parameter 
Value/Range 
 
Fls_AddressType  TargetAddress 
Target address in flash memory. This address 
Parameters In: 
offset will be added to the flash memory base 
address.  
Min.: 0  
Max.: FLS_SIZE - 1 
 uint8 
SourceAddressPtr 
Pointer to source data buffer 
Fls_LengthType 
Length 
Number of bytes to write  
Min.: 1  
Max.: FLS_SIZE - TargetAddress 
Parameters InOut: 
None 
NA 
NA 
Parameters out: 
None 
NA 
NA 
 
Type 
Possible Return Values 
Return Value: 
Std_ReturnType 
E_OK: write command has been accepted  
E_NOT_OK: write command has not been accepted 
Description: 
Writes one or more complete flash pages 
Configuration 
None 
Dependency: 
50 
 

 Application Programming Interface 
Chapter 10 
 
Preconditions: 
None 
 
10.3.4. 
Fls_Cancel 
 
Name: 
Fls_Cancel 
Prototype:  
FUNC(void, FLS_PUBLIC_CODE) Fls_Cancel(void) 
 
  Service ID: 
0x03 
  Sync/Async: 
synchronous 
Prototype: 
Reentrancy: 
Non-Reentrant 
 
Type 
Parameter 
Value/Range 
 
None 
NA 
NA 
Parameters In: 
Parameters InOut: 
None 
NA 
NA 
Parameters out: 
None 
NA 
NA 
 
Type 
Possible Return Values 
Return Value: 
None 
NA 
Description: 
Cancel an ongoing flash read, write, erase or compare job. 
Configuration 
None 
Dependency: 
Preconditions: 
None 
 
10.3.5. 
Fls_GetStatus 
 
Name: 
Fls_GetStatus 
 Prototype:  
FUNC(MemIf_StatusType, FLS_PUBLIC_CODE) Fls_GetStatus(void) 
 
  Service ID: 
0x04 
Prototype: 
Sync/Async: 
synchronous 
Reentrancy: 
Reentrant 
 
Type 
Parameter 
Value/Range 
 
None 
NA 
NA 
Parameters In: 
Parameters InOut: 
None 
NA 
NA 
Parameters out: 
None 
NA 
NA 
 
Type 
Possible Return Values 
Return Value: 
MemIf_StatusType  Type definition for MEMIF status types   
MEMIF_UNINIT,  
MEMIF_IDLE, 
MEMIF_BUSY, 
MEMIF_BUSY_INTERNAL. 
Description: 
Return the FLS module state synchronously 
Configuration 
None 
Dependency: 
Preconditions: 
None 
 
51 

Chapter 10                                                                                   Application Programming Interface 
 
10.3.6. 
Fls_GetJobResult 
 
Name: 
Fls_GetJobResult 
Prototype:  
FUNC(MemIf_JobResultType, FLS_PUBLIC_CODE) Fls_GetJobResult(void) 
 
  Service ID: 
0x05 
  Sync/Async: 
synchronous 
Prototype: 
Reentrancy: 
Reentrant 
 
Type 
Parameter 
Value/Range 
 
None 
NA 
NA 
Parameters In: 
Parameters InOut: 
None 
NA 
NA 
Parameters out: 
None 
NA 
NA 
 
Type 
Possible Return Values 
Return Value: 
MemIf_JobResultType  Type definition for MEMIF job result types 
  MEMIF_JOB_OK, 
  MEMIF_JOB_FAILED, 
  MEMIF_JOB_PENDING, 
  MEMIF_JOB_CANCELED, 
  MEMIF_BLOCK_INCONSISTENT, 
  MEMIF_BLOCK_INVALID 
Description: 
Return the result of the last job synchronously 
Configuration 
None 
Dependency: 
Preconditions: 
None 
 
10.3.7. 
Fls_MainFunction 
 
Name: 
Fls_MainFunction 
  Prototype:  
FUNC(void, FLS_PUBLIC_CODE) Fls_MainFunction(void) 
  Service ID: 
0x06 
 
Protot
Timin y
g pe
:  : 
FIXED_CYCLIC 
Sync/Async: 
NA 
Reentrancy: 
NA 
 
Type 
Parameter 
Value/Range 
 
None 
NA 
NA 
Parameters In: 
Parameters InOut: 
None 
NA 
NA 
Parameters out: 
None 
NA 
NA 
 
Type 
Possible Return Values 
Return Value: 
None 
NA 
Description: 
Performs the processing of jobs. 
Configuration 
None 
Dependency: 
Preconditions: 
None 
 
52 
 

 Application Programming Interface 
Chapter 10 
 
10.3.8. 
Fls_Read 
 
Name: 
Fls_Read 
 
FUNC(Std_ReturnType, FLS_PUBLIC_CODE) Fls_Read(Fls_AddressType 
 
SourceAddress, P2VAR(uint8, AUTOMATIC, FLS_APPL_CONST) 
 
TargetAddressPtr, Fls_LengthType Length) 
Prototype: 
Service ID: 
0x07 
Sync/Async: 
Asynchronous 
Reentrancy: 
Non-Reentrant 
 
Type 
Parameter 
Value/Range 
 
Fls_AddressType  SourceAddress 
Source address in flash memory. This 
Parameters In: 
address offset will be added to the flash 
memory base address.  
Min.: 0  
Max.: FLS_SIZE - 1 
Fls_LengthType 
Length 
Number of bytes to read  
Min.: 1  
Max.: FLS_SIZE - TargetAddress 
Parameters InOut:  None 
NA 
NA 
Parameters out: 
uint8 
TargetAddressPtr 
Pointer to target data buffer 
 
Type 
Possible Return Values 
Return Value: 
Std_ReturnType 
E_OK: read command has been accepted  
E_NOT_OK: read command has not been accepted 
Description: 
Read from flash memory 
Configuration 
None 
Dependency: 
Preconditions: 
None 
 
10.3.9. 
Fls_Compare 
 
Name: 
Fls_Compare 
 
FUNC(Std_ReturnType, FLS_PUBLIC_CODE) Fls_Compare (Fls_AddressType 
 
SourceAddress, P2CONST(uint8, AUTOMATIC, FLS_APPL_CONST) 
 
TargetAddressPtr, Fls_LengthType Length) 
Prototype: 
Service ID: 
0x08 
Sync/Async: 
Asynchronous 
Reentrancy: 
Non-Reentrant 
 
Type 
Parameter 
Value/Range 
 
Fls_AddressType  SourceAddress 
Source address in flash memory. This 
Parameters In: 
address offset will be added to the flash 
memory base address.  
Min.: 0  
Max.: FLS_SIZE - 1 
Fls_LengthType 
Length 
Number of bytes to compare  
Min.: 1  
Max.: FLS_SIZE - SourceAddress 
uint8 
TargetAddressPtr 
Pointer to target data buffer 
53 

Chapter 10                                                                                   Application Programming Interface 
 
Parameters InOut:  None 
NA 
NA 
Parameters out: 
None 
NA 
NA 
 
Type 
Possible Return Values 
Return Value: 
Std_ReturnType 
E_OK: compare command has been accepted  
E_NOT_OK: compare command has not been accepted 
Description: 
Compares the contents of an area of flash memory with that of an application data 
buffer. 
Configuration 
None 
Dependency: 
Preconditions: 
None 
 
10.3.10. 
Fls_SetMode 
 
Name: 
Fls_SetMode 
  Prototype:  
FUNC(void, FLS_PUBLIC_CODE) Fls_SetMode(MemIf_ModeType LenMode) 
 
  Service ID: 
0x09 
 
Protot
Sync y
/A pe
sy : 
nc: 
Synchronous 
Reentrancy: 
Non-Reentrant 
 
Type 
Parameter  Value/Range 
 
MemIf_ModeType  Mode 
MEMIF_MODE_SLOW: Slow read access / normal 
Parameters In: 
SPI access.  
MEMIF_MODE_FAST: Fast read access / SPI burst 
access. 
Parameters InOut:  None 
NA 
NA 
Parameters out: 
None 
NA 
NA 
 
Type 
Possible Return Values 
Return Value: 
None 
NA 
Description: 
Sets the flash driver’s operation mode. 
Configuration 
None 
Dependency: 
Preconditions: 
None 
 
10.3.11. 
Fls_GetVersionInfo 
 
Name: 
Fls_GetVersionInfo 
 
FUNC(void, FLS_PUBLIC_CODE) Fls_GetVersionInfo 
 Prototype:  
(P2VAR(Std_VersionInfoType, AUTOMATIC, FLS_APPL_DATA) versioninfo) 
 
  Service ID: 
0x10 
Prototype: 
Sync/Async: 
Synchronous 
Reentrancy: 
Reentrant 
 
Type 
Parameter 
Value/Range 
 
None 
NA 
NA 
Parameters In: 
Parameters InOut:  None 
NA 
NA 
54 
 

 Application Programming Interface 
Chapter 10 
 
Parameters out: 
Std_VersionInfoType 
VersioninfoPtr 
Pointer to where to store the version 
information of this module. 
 
Type 
Possible Return Values 
Return Value: 
None 
NA 
Description: 
Returns the version information of this module. 
Configuration 
None 
Dependency: 
Preconditions: 
None 
 
10.3.12. 
Fls_ReadImmediate 
 
Name: 
Fls_ReadImmediate 
 
FUNC(Std_ReturnType, FLS_PUBLIC_CODE) Fls_ReadImmediate 
 
(Fls_AddressType SourceAddress, P2VAR(uint8, AUTOMATIC, 
 Prototype: 
FLS_APPL_CONST) TargetAddressPtr, Fls_LengthType Length) 
Service ID: 
0x11 
Sync/Async: 
Asynchronous 
Reentrancy: 
Non-Reentrant 
 
Type 
Parameter 
Value/Range 
 
Fls_AddressType  SourceAddress 
Source address in flash memory. This address 
Parameters In: 
offset will be added to the flash memory base 
address.  
Min.: 0  
Max.: FLS_SIZE - 1 
Fls_LengthType 
Length 
Number of bytes to read  
Min.: 1  
Max.: FLS_SIZE - TargetAddress 
Parameters InOut:  None 
NA 
NA 
Parameters out: 
uint8 
TargetAddressPtr  Pointer to target data buffer 
 
Type 
Possible Return Values 
Return Value: 
Std_ReturnType 
E_OK: read command has been accepted  
E_NOT_OK: read command has not been accepted 
Description: 
Performs the reading of the flash memory. The data from flash memory (source address) 
is read to the data buffer (Target address) of application without performing blank check 
before read. 
Configuration 
None 
Dependency: 
Preconditions: 
None 
 
10.3.13. 
Fls_BlankCheck 
 
Name: 
Fls_BlankCheck 
 
FUNC(Std_ReturnType, FLS_PUBLIC_CODE) Fls_BlankCheck 
  
(Fls_AddressType TargetAddress, Fls_LengthType Length) 
  Prototype:  
  Service ID: 
0x12 
 
Prototype: 
55 

Chapter 10                                                                                   Application Programming Interface 
 
Sync/Async: 
Asynchronous 
Reentrancy: 
Non-Reentrant 
 
Type 
Parameter 
Value/Range 
 
Fls_AddressType  TargetAddress 
Target address in flash memory. This address 
Parameters In: 
offset will be added to the flash memory base 
address.  
Min.: 0  
Max.: FLS_SIZE - 1 
Fls_LengthType 
Length 
Number of bytes to be blank checked   
Min.: 1  
Max.: FLS_SIZE - TargetAddress 
Parameters InOut:  None 
NA 
NA 
Parameters out: 
None 
NA 
NA 
 
Type 
Possible Return Values 
Return Value: 
Std_ReturnType 
E_OK: Blank check command has been accepted  
E_NOT_OK: Blank check command has not been accepted 
Description: 
Performs the blank check of flash Memory 
Configuration 
None 
Dependency: 
Preconditions: 
None 
 
10.3.14. 
Fls_Suspend 
 
Name: 
Fls_Suspend 
 Prototype:  
FUNC(Std_ReturnType , FLS_PUBLIC_CODE) Fls_Suspend(void) 
 
  Service ID: 
0x13 
 
Protot
Sync y
/A pe
sy : 
nc: 
Asynchronous 
Reentrancy: 
Non Re-entrant 
 
Type 
Parameter 
Value/Range 
 
None 
NA 
NA 
Parameters In: 
Parameters InOut:  None 
NA 
NA 
Parameters out: 
None 
NA 
NA 
 
Type 
Possible Return Values 
Return Value: 
Std_ReturnType 
E_OK: Suspend job has been accepted  
E_NOT_OK: Suspend job has not been accepted 
Description: 
Performs the suspension of the ongoing job 
Configuration 
None 
Dependency: 
Preconditions: 
None 
 
 
 
56 
 

 Application Programming Interface 
Chapter 10 
 
10.3.15. 
Fls_Resume 
 
Name: 
Fls_Resume 
 Prototype:  
FUNC(void, FLS_PUBLIC_CODE) Fls_Resume(void) 
 
  Service ID: 
0x14 
 
Protot
Sync y
/A pe
sy : 
nc: 
Synchronous 
Reentrancy: 
Non-Reentrant 
 
Type 
Parameter 
Value/Range 
 
None 
NA 
NA 
Parameters In: 
Parameters InOut:  None 
NA 
NA 
Parameters out: 
None 
NA 
NA 
 
Type 
Possible Return Values 
Return Value: 
None 
NA 
Description: 
  Resumes the suspended job 
Configuration 
None 
Dependency: 
Preconditions: 
None 
 
10.3.16. 
Fls_CallSwitchBFlashErrorNotification 
 
Name: 
Fls_CallSwitchBFlashErrorNotification 
 Prototype:  
void Fls_CallSwitchBFlashErrorNotification(void) 
 
  Service ID: 
NA 
 
Protot
Sync y
/A pe
sy : 
nc: 
Synchronous 
Reentrancy: 
NA 
 
Type 
Parameter 
Value/Range 
 
None 
NA 
NA 
Parameters In: 
Parameters InOut:  None 
NA 
NA 
Parameters out: 
None 
NA 
NA 
 
Type 
Possible Return Values 
Return Value: 
None 
NA 
Description: 
This callback function is invoked when failure occurs while re-enabling of Code Flash 
during FCU initialization procedure. 
Configuration 
None 
Dependency: 
Preconditions: 
None 
 
 
 
 
57 

Chapter 10                                                                                   Application Programming Interface 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58 
 

 Development and Production Errors 
Chapter 11 
 
Chapter 11  Development and Production Errors 
 
 
In  this  section  the  development  errors  that  are  reported  by  the  FLS  Driver 
Component are tabulated. The development errors will be reported only when 
the pre compiler option FlsDevErrorDetect is enabled in the configuration. The 
production code errors are not supported by FLS Driver Component. 
 
 
 
11.1  FLS Driver Component Development Errors 
The following table contains the DET errors that are reported by FLS Driver 
Component. These errors are reported to Development Error Tracer Module 
when  the  FLS  Driver  Component  APIs  are  invoked  with  wrong  input 
parameters or without initialization of the driver. 
 
 

                    Table 11-1               DET Errors of FLS Driver Component 
 
Sl. No. 
1 
Error Code 
FLS_E_UNINIT 
Related API(s) 
Fls_Erase, Fls_Write, Fls_Read, Fls_Compare, Fls_Cancel, 
Fls_GetStatus, Fls_GetJobResult, Fls_MainFunction, Fls_Init, 
Fls_ReadImmediate, Fls_BlankCheck, Fls_Suspend, 
Fls_Resume, Fls_SetMode 
Source of Error 
When the API service is invoked before initialization. 
Sl. No. 
2 
Error Code 
FLS_E_PARAM_ADDRESS 
Related API(s) 
Fls_Erase, Fls_Write, Fls_Read, Fls_Compare, Fls_ReadImmediate, 
Fls_BlankCheck 
Source of Error 
When the API service is invoked with a wrong address. 
Sl. No. 
3 
Error Code 
FLS_E_PARAM_LENGTH 
Related API(s) 
Fls_Erase, Fls_Write, Fls_Read, Fls_Compare, Fls_ReadImmediate, 
Fls_BlankCheck 
Source of Error 
When the API service is invoked with a wrong length. 
Sl. No. 
4 
Error Code 
FLS_E_PARAM_DATA 
Related API(s) 
Fls_Write, Fls_Read, Fls_Compare, Fls_ReadImmediate 
Source of Error 
When the API service is invoked with a NULL buffer address. 
Sl. No. 
5 
Error Code 
FLS_E_BUSY 
Related API(s) 
Fls_Init, Fls_Erase, Fls_Write, Fls_Read, Fls_Compare, 
Fls_SetMode , Fls_ReadImmediate, Fls_BlankCheck 
Source of Error 
When the API service is invoked when the driver is still busy. 
Sl. No. 
 6 
Error Code 
FLS_E_VERIFY_ERASE_FAILED 
Related API(s) 
Fls_MainFunction 
Source of Error 
 When the erase verification fails. 
 
 
59 

Chapter 11                                                                               Development and Production Errors 
 
Sl. No. 
7 
Error Code 
FLS_E_VERIFY_WRITE_FAILED 
Related API(s) 
Fls_MainFunction  
Source of Error 
When the write verification fails. 
Sl. No. 
8 
Error Code 
FLS_E_PARAM_CONFIG 
Related API(s) 
Fls_Init, Fls_SetMode 
Source of Error 
API initialization service invoked with wrong parameter. 
Sl. No. 
9 
Error Code 
FLS_E_TIMEOUT 
Related API(s) 
Fls_MainFunction 
Source of Error 
API service invoked when time out supervision of a write, erase or blank 
check job failed 
Sl. No. 
10 
Error Code 
FLS_E_INVALID_DATABASE 
Related API(s) 
Fls_Init 
Source of Error 
API service Fls_Init called without/with a wrong database is reported 
using following error code 
Sl. No. 
11 
Error Code 
FLS_E_PARAM_POINTER 
Related API(s) 
Fls_GetVersionInfo 
Source of Error 
API service Fls_GetVersionInfo invoked with a null pointer 
 
11.2 
FLS Driver Component Production Errors 
The following table contains the DEM errors that are reported by FLS Driver 
Component. These are the hardware errors reported during runtime. 
 
                      Table 11-2               DEM Errors of FLS Driver Component 
 
Sl. No. 
1 
Error Code 
FLS_E_ERASE_FAILED 
Related API(s) 
Fls_Erase 
Source of Error 
When the Erase API service is invoked and the erase job fails, error will be 
reported  to  DEM  module.  The  Dem  module  shall  provide  the  interface 
Dem_ReportErrorStatus to the BSW modules, to report BSW events which 
are processed. 
Sl. No. 
2 
Error Code 
FLS_E_WRITE_FAILED 
Related API(s) 
Fls_Write 
Source of Error 
When  the  Write  API  service  is  invoked  and  the  erase  job  fails,  error  will  be 
reported  to  DEM  module.  The  Dem  module  shall  provide  the  interface 
Dem_ReportErrorStatus to the BSW modules, to report BSW events which are 
processed. 
Sl. No. 
3 
Error Code 
FLS_E_READ_FAILED 
60 
 

 Development and Production Errors 
Chapter 11 
 
Related API(s) 
Fls_Read 
Source of Error 
When the Read API service is invoked and the internal reading of the data 
flash memory fails, error will be reported to DEM module. The Dem module 
shall provide the interface Dem_ReportErrorStatus to the BSW modules, to 
report BSW events which are processed. 
Sl. No. 
4 
Error Code 
FLS_E_COMPARE_FAILED 
Related API(s) 
Fls_Compare 
Source of Error 
When  the  Compare  API  service  is  invoked  and  when  the  comparison 
between the data in the application buffer and the data flash memory fails, 
error  will  be  reported to  DEM  module.  The  Dem module shall  provide  the 
interface  Dem_ReportErrorStatus  to  the  BSW  modules,  to  report  BSW 
events which are processed. 
Sl. No. 

 
Error Code 
FLS_E_READ_FAILED_DED 
Related API(s) 
Fls_Read, Fls_ReadImmediate, Fls_Compare 
 
Source of Error   When  the  Read/ReadImmediate/Compare  API  service  is  invoked,  if  any 
double bit error is detected, error will be reported to DEM module. The Dem 
module  shall  provide  the  interface  Dem_ReportErrorStatus  to  the  BSW 
modules, to report BSW events which are processed. 
Sl. No. 

Error Code 
FLS_E_REG_WRITE_VERIFY 
Related API(s) 
 Fls_Init,Fls_Erase, Fls_Write, Fls_Read, Fls_Compare, Fls_Cancel, 
Fls_ReadImmediate, Fls_BlankCheck, Fls_Suspend, Fls_Resume 
Source of Error 
If any write operation on the protection register fails, error shall be reported 
to  DEM  module.  The  Dem  module  shall  provide  the  interface 
Dem_ReportErrorStatus to the BSW modules, to report BSW events which 
are processed. 
Sl. No. 

Error Code 
FLS_E_ECC_FAILED 
 
Related API(s) 
Fls_Init 
 
Source of Error 
During  initialization,  FLS  module  shall  read  FRTEINT  register  and  check  if 
any ECC error has occurred. If any errors are there, DEM shall be reported. 
The Dem module shall provide the interface Dem_ReportErrorStatus to the 
BSW modules, to report BSW events which are processed. 
Sl. No. 

Error Code 
FLS_E_HW_FAILURE 
Related API(s) 
Fls_Init, Fls_Erase, Fls_Write, Fls_Cancel, Fls_BlankCheck, Fls_Resume 
Source of Error 
If any failure has occurred due to mode switch or forced stop or clear status 
command processing failure, DEM shall be reported. The Dem module shall 
provide the interface Dem_ReportErrorStatus to the BSW modules, to report 
BSW events which are processed. 
Sl. No. 

Error Code 
FLS_E_INT_INCONSISTENT 
Related API(s) 
FLS_FLENDNM_ISR 
61 

Chapter 11                                                                               Development and Production Errors 
 
Source of Error 
If any failure has occurred due to interrupt inconsistency has been identified 
from  the  unknown  source,  DEM  shall  be  reported.  The  Dem  module  shall 
provide the interface Dem_ReportErrorStatus to the BSW modules, to report 
BSW events which are processed. 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62 
 










 Memory Organization 
Chapter 12 
 
Chapter 12  Memory Organization 
Following picture depicts a typical memory organization, which must be met for 
proper functioning of FLS Driver Component software. 
 
 
 
 
 
ROM Section 
FLS Driver Component 
RAM Section                                            
 
Object Files 
 
 
 
 
 
 
Segment Name: 
 
FLS Driver code related 
Y1
to APIs are placed in this 
 X1
FLS_PRIVATE_CODE_RAM
 
 
 
 
memory.  
 
 
Segment Name: 
 
FLS_PUBLIC_CODE_ROM 
 
 
Segment Name: 
Y2
 
RAM_1BIT 
 
R
 
Segment Name: 
  X2 
A
 
FLS_SAMPLE_CODE_ROM 
M
 
        
E
Segment Name: 
 Y3
K
 
 
NO_INIT_RAM_32BIT 
 
L
 
R
Segment Name: 
F
X3 
A
 
FLS_FAST_CODE_ROM 
E
M
 
 
L
E
Segment Name: 
K
 
 
 Y4
K
NO_INIT_RAM_1BIT 
 
F
 
L
 
L
F
 
E
E
Segment Name: 
K
 
L
FLS_CFG_DATA_UNSPECIFIED 
X4 
A
 
   Segment Name: 
K
F
   NO_INIT_RAM_UNSPECIFIED 
 Y5
F
 
 
L
 
L
K
 
 
E
S
 
 
K
E
A
 
 
L
F
F
 
L
K
 
K
E
S
 
L
E
 
1
L
B
Figure 12-1  FLS Driver Component Memory Organization 
F
I
K

T 
E
R
L
A
1
M
B
_
I
1

T 
B
R
I
A

T 
M
R
_
A
1
M
B
_
I
1

T 
B
R
I
A

T 
M
 
_
R
1
A
B
M
I
63 
_
T 
1
 
B
R
I
A

T 
M
 
_
1


Chapter 12                                                                                                                              Memory Organization 
 
ROM Sections: 
 
FLS_PUBLIC_CODE_ROM  (X1):  This  section  consists  of  FLS  Driver 
Component public APIs that can be located in code memory.  
 
FLS_SAMPLE_CODE_ROM  (X2):  This  section  consists  of  FLS  sample 
application that can be located in code memory.  
 
FLS_FAST_CODE_ROM (X3):  Interrupt  functions  of  FLS  Driver  Component 
code that can be located in code memory. 
 
FLS_CFG_DATA_UNSPECIFIED(X4):  The  const  section  in  the  file 
Fls_PBcfg.c is placed in this memory. 
 
RAM Sections:  
 
FLS_PRIVATE_CODE_RAM  (Y1):  This  section  in  RAM  is  copied  from  ROM 
section (X1) by the GHS start-up routines. 
 
RAM_1BIT (Y2): This section consists of the global RAM variables of 1-bit size 
that  are  initialized  by  start-up  code  and  used  internally  by  FLS  software 
component and other software components. The specific sections of respective 
software components will be merged into this RAM section accordingly. 
 
NO_INIT_RAM_32BIT (Y3): This section consists of the global RAM variables 
of  32-bit size  that  are  used  internally  by  FLS  software  component  and  other 
software components. The specific sections of respective software components 
will be merged into this RAM section accordingly. 
 
NO_INIT_RAM_1BIT (Y4): This section consists of the global RAM variables of 
1-bit  size  that  are  used  internally  by  FLS  software  component  and  other 
software components. The specific sections of respective software components 
will be merged into this RAM section accordingly. 
 
NO_INIT_RAM_UNSPECIFIED (Y5):  This section consists of the global RAM 
variables  that  are  used  internally  by  FLS  software  component  and  other 
software components. The specific sections of respective software components 
will be merged into this RAM section accordingly.
64 
 

 P1M Specific Information                                                                                                   Chapter 13 
 
Chapter 13  P1M Specific Information 
 
P1M supports following devices: 
 
  R7F701304 
  R7F701305 
  R7F701310 
  R7F701311 
  R7F701312 
  R7F701313 
  R7F701314 
  R7F701315 
  R7F701318 
  R7F701319 
  R7F701320 
  R7F701321 
  R7F701322 
  R7F701323 
 
13.1. 
Interaction between the User and FLS Driver 
Component 
The  details  of  the  services  supported  by  the  FLS  Driver  Component  to  the 
upper  layer  users  and  the  mapping  of  the  channels  to  the  hardware  units  is 
provided in the following sections: 
 
13.1.1. Translation header File   
 P1x_translation.h supports following devices: 
  R7F701304 
  R7F701305 
  R7F701310 
  R7F701311 
  R7F701312 
  R7F701313 
  R7F701314 
  R7F701315 
  R7F701318 
  R7F701319 
  R7F701320 
  R7F701321 
  R7F701322 
  R7F701323 
 
 
13.1.2. Services Provided by FLS Driver Component to the User 
 
The FLS Driver Component provides the following functions to upper layers: 
• 
Erase memory sectors 
• 
Read flash contents to the application memory 
65 

Chapter 13                                                                                                                     P1M Specific Information 
 
• 
Fast read immediate to the application memory without blank check. 
• 
Validate flash contents comparing with the application memory 
• 
Cancel the on-going erase, write, read or compare requests. 
• 
Read the result of the last job 
• 
Blank check of flash memory sector. 
• 
Read the status of the FLS Driver Component. 
• 
Suspend the erase and write operation. 
• 
Resume the erase and write operation. 
 
 
13.1.3. Parameter Definition File 
          Table 13-1               PDF information for P1M 
 
PDF files 
Devices 
supported  

701304, 701305, 701310, 701311, 
R403_FLS_P1M_04_05_10_to_15.arxml 
701312, 701313, 701314, 701315 
701318, 701319, 701320, 701321, 
R403_FLS_P1M_18_to_23.arxml 
701322, 701323 
     
13.1.4. ISR Functions for FLS module 
The  table  below provides the  list  of  handler addresses corresponding to  the 
hardware unit ISR(s) in FLS Driver Component. The user should configure the 
ISR functions mentioned below: 
 
          Table 13-2               Interrupt Functions for FLS Module 
 
Interrupt Source 
Name of the ISR Function 
FLENDNM_ISR  
FLS_FLENDNM_ISR 
 
FLS_FLENDNM_CAT2_ISR 
 
 
          Note: The functions with “INTERRUPT “as pilot tag, provides an indication to the compiler that    
the function following this tag is an interrupt function type. The tag name can vary according to  
          the compiler. User should take care of the tag name with respect to compiler used. 
 
13.1.5. Data Flash Address Space 
The Data Flash address space of the RH850/P1x is as below: 
Data Flash Address: 
512-KB device: FF20 0000H to FF20 7FFFH 
1-MB device: FF20 0000H to FF20 7FFFH 
2-MB device: FF20 0000H to FF20 FFFFH 
 
13.2. Sample Application 
13.2.1. Sample Application Structure 
The Sample Application is provided as reference to the user to understand the 
method in which the FLS APIs can be invoked from the application. The Sample 
Application is provided for three use-cases. 
 
66 
 


 P1M Specific Information                                                                                                   Chapter 13 
 
 
 
Figure 13-1  Overview of FLS Driver Sample Application 
 
The Sample Application of the P1M is available in the path 
 
X1X\P1x\modules\fls\sample_application 
 
X1X\P1x\modules\fls\definition\<AUTOSAR_version>\<SubVariant>\  
         \R403_FLS_P1M_04_05_10_to_15.arxml 
         \R403_FLS_P1M_18_to_23.arxml 
 
X1X\P1x\modules\fls\sample_application\<SubVariant>\  
                                                     <AUTOSAR_version>\ 
\src\Fls_PBcfg.c 
\include\Fls_Cfg.h 
\include\Fls_Cbk.h 
 
                                                                    \config\App_FLS_P1M_701304_Sample.arxml 
 
                                                                    \config\App_FLS_P1M_701305_Sample.arxml 
 
                                                                    \config\App_FLS_P1M_701310_Sample.arxml 
 
                                                                    \config\App_FLS_P1M_701311_Sample.arxml 
 
                                                                    \config\App_FLS_P1M_701312_Sample.arxml 
 
                                                                    \config\App_FLS_P1M_701313_Sample.arxml 
 
                                                                    \config\App_FLS_P1M_701314_Sample.arxml 
 
                                                                    \config\App_FLS_P1M_701315_Sample.arxml 
 
                                                                    \config\App_FLS_P1M_701318_Sample.arxml 
 
                                                                    \config\App_FLS_P1M_701319_Sample.arxml 
 
                                                                    \config\App_FLS_P1M_701320_Sample.arxml 
 
                                                                    \config\App_FLS_P1M_701321_Sample.arxml 
 
                                                                    \config\App_FLS_P1M_701322_Sample.arxml 
67 

Chapter 13                                                                                                                     P1M Specific Information 
 
 
                                                                    \config\App_FLS_P1M_701323_Sample.arxml 
 
 
In the Sample Application all the FLS APIs are invoked in the following 
sequence: 
 
•  The API Fls_GetVersionInfo is invoked to get the version Information of FLS 
component with  a  variable of  Std_VersionInfoType type, after the  call  of  this 
API  the  passed  parameter will  get  updated  with  the  FLS  Driver  Component 
version details. 
 
•  The  API  Fls_Init  is  invoked  with  config  pointer.  This  API  performs  the 
initialization of the FLS Driver Component. This API initializes all the elements 
(Global Variables) of Global structure. 
 
•  The API Fls_Erase is invoked to erase one or more complete Flash Sectors. 
 
•  The API Fls_Write is invoked to write the one or more complete flash pages to 
the flash device from the application data buffer 
 
•  The API Fls_Read is invoked to read the requested length of flash memory and 
stores it in the application data buffer. 
 
•  The API Fls_Compare is invoked to compare the contents of an area of flash 
memory with that of an application data buffer. 
 
•  The API Fls_Cancel is invoked to cancel an on-going flash operations like read, 
write, erase or compare job. 
 
•  The API Fls_Getstatus returns the FLS module state synchronously. 
 
•  The API Fls_GetJobResult returns the result of the last job synchronously. 
 
•  The API Fls_Setmode, this API sets the flash driver operation mode. 
 
•  The API Fls_Mainfunction is invoked performs processing of the flash Read, 
Erase, write or compare jobs. It’s a scheduled function. The Fls_Mainfunction 
accepts only read, write, erase or compare job at a time. 
 
•  The API Fls_ReadImmediate is invoked for reading of the flash memory. The 
data  from  flash  memory  (source  address)  is  read  to  the  data  buffer  (Target 
address) of application without performing blank check before read. 
 
•  The API Fls_BlankCheck is invoked to verify whether the memory is properly 
erased before doing a write operation. 
 
Remark  The  API  Fls_MainFunction  needs  to  be  called  in  a  certain  time  interval 
configured using the parameter "FlsCallCycle". Hence, the sample application 
invokes the API ‘Fls_MainFunction’ periodically in a loop with sufficient software 
delay. Calling Fls_MainFunction in the interrupt mode of FLS will not perform 
the substantial Flash operations; it will be executed as dummy function, except 
that the timeout supervision will be performed within the Fls_MainFunction call 
if timeout monitoring is enabled. 
 
13.2.2. Building Sample Application 
13.2.2.1. Configuration Example 
This section contains the typical configuration which is used for measuring 
RAM/ROM consumption, stack depth and throughput details. 
Configuration Details
App_FLS_<SubVariant>_<Device_Name>_Sample.arxml 
 
68 
 

 P1M Specific Information                                                                                                   Chapter 13 
 
13.2.2.2. Debugging the Sample Application 
Remark  GNU Make utility version 3.81 or above must be installed and available in the 
path as defined by the environment user variable “GNUMAKE” to complete the 
build process using the delivered sample files. 
 
Open a Command window and change the current working directory to “make” 
directory present as mentioned in below path: 
“external/X1X/P1x/common_family/make/<compiler>” 
 
Now execute batch file SampleApp.bat with following parameters: 
 
SampleApp.bat fls <AUTOSAR_version> <Device_Name> 
 
After this, the tool output files will be generated with the configuration as 
mentioned is available in the path: 
“X1X\P1x\modules\fls\sample_application\<SubVariant>\<AUTOSAR_version>
\config” 
 
•  After  this,  all  the  object  files,  map  file  and  the  executable  file 
App_FLS_P1M_Sample.out will be available in the output folder 
(“X1X\P1x\modules\fls\sample_application\<SubVariant>\obj\<compiler>”  in 
this case). 
 
•  The executable can be loaded into the debugger and the sample application 
can be executed. 
Remark  Executable files with ‘*.out’ extension can be downloaded into the target 
hardware with the help of Green Hills debugger. 
 
If any configuration changes (only post-build) are made to the ECU 
Configuration Description files 
 
“X1X\P1x\modules\fls\sample_application\<SubVariant>\<AUTOSAR_version>\
config\ App_FLS_P1M_<Device_name>_Sample.arxml” 
 
 
App_FLS_P1M_<Device_name>_Sample.arxml” the database alone can be 
generated by using the following commands. 
                                               make –f App_FLS_<SubVariant>_Sample.mak generate_fls_config 
                                               make –f App_FLS_<SubVariant>_Sample.mak 
                                               App_FLS_<SubVariant>_Sample.s37            
 
• 
After this, a flash able Motorola S-Record file App_FLS_ 
App_FLS_<SubVariant>_Sample.s37_Sample.s37 is available in the 
output folder. 
 
Note:      1<compiler> for example can be “ghs”. 
2. <Device_Name> indicates the device to be compiled, which can be 701304, 
701305, 701310, 701311, 701312, 701313, 701314, 701315, 701318, 
701319, 701320, 701321, 701322 or 701323. 
3. <SubVariant> can be P1M. 
                                        4. <AUTOSAR_version> can be 4.0.3. 
 
 
 
 
 
 
 
 
69 

Chapter 13                                                                                                                     P1M Specific Information 
 
13.3. Memory and Throughput  
13.3.1. 
ROM/RAM Usage 
 
The details of memory usage for the typical configuration, with DET enabled as 
provided  in  Section  13.2.2.1  Configuration  Example  are  provided  in  this 
section. 
                      Table 13-3               ROM/RAM Details with DET 
 
 
Sl. No.  ROM/RAM 
Segment Name 
Size in bytes 
 
for 701318 
 
 
1. 
ROM 
 FLS_PUBLIC_CODE_ROM 
1834 
 
 
 FLS_PRIVATE_CODE_ROM 
5468 
 
 
 
 FLS_FAST_CODE_ROM 
 170 
 
 
 
 
 FLS_CFG_DATA_UNSPECIFIED 
 48 
 
 
 
 
 ROM.FLS_PRIVATE_CODE_RAM 
362 
 
 
2. 
RAM 
 FLS_PRIVATE_CODE_RAM 
362 
 
 
 
 
 NO_INIT_RAM_UNSPECIFIED 
100 
 
 
 
 
 NO_INIT_RAM_32BIT 
516 
 
 
 
 
 RAM_1BIT 

 
 
 
 NO_INIT_RAM_1BIT 

 
 
 
 

 
                      Table 13-4               ROM/RAM Details without DET 
 
 
Sl. No. 
ROM/RAM 
Segment Name 
Size in bytes 
for 701318 

 
1. 
ROM 
 FLS_PUBLIC_CODE_ROM 
1350 
 
 
 
 FLS_PRIVATE_CODE_ROM 
4352 
 
 
 FLS_FAST_CODE_ROM 
 144 
 
 
 
 
 
 FLS_CFG_DATA_UNSPECIFIED 
 48 
 
 
 
 ROM.FLS_PRIVATE_CODE_RAM 
334 
 
 
 
2. 
RAM 
 FLS_PRIVATE_CODE_RAM 
334 
 
 
 
 
 NO_INIT_RAM_UNSPECIFIED 
100 
 
 
 
 
 NO_INIT_RAM_32BIT 
516 
 
 
 
 
 RAM_1BIT 

 
 
 
 
 NO_INIT_RAM_1BIT 

 
 
 
 
70 
 

 P1M Specific Information                                                                                                   Chapter 13 
 
13.3.2. 
Stack Depth 
 
The worst-case stack depth for FLS Driver Component is for the typical 
configuration provided in Section 13.2.2.1 Configuration Example
 
                     Table 13-5               Stack Depth Table 
 
 
 
Sl. No   
Device Name 
Stack Depth (in Bytes) 
 
1. 
R7F701318 
                                       36 
 
 
 
 
 
13.3.3. 
Throughput Details 
 
The  throughput  details  of  the  APIs  for  the  configuration  mentioned  in  the 
Section 13.2.2.1Configuration Example are listed here. The clock frequency 
used to measure the throughput is 160MHz for all APIs. 
 
 
                   Table 13-6               Throughput Details of the APIs 
 
 
 
Throughput 
 
Sl. No.  API Name 
Throughput in 
Remarks 
µ seconds for 
in µ 
701318 
seconds for 
with Interrupt 
701318 with 
OFF 
Interrupt ON 
1. 
 Fls_Init 
415.112 
416.650 

2. 
 Fls_Erase 
3.812 
4.687* 

3. 
 Fls_Write 
3.862 
4.675 

4. 
 Fls_Cancel 
0.237 
0.287 

5. 
 Fls_GetStatus 
0.125 
0.125 

6. 
 Fls_GetJobResult 
0.137 
0.137 

7. 
 Fls_Read 
1.225 
1.562 

8. 
 Fls_Compare 
0.962 
0.862 

9. 
 Fls_GetVersionInfo 
0.15 
0.125 

10. 
 Fls_BlankCheck 
2.862 
3.737* 

11. 
 Fls_SetMode 
0.312 
0.287 
 
12. 
 Fls_ReadImmediate 
1.437 
1.4 

13. 
 Erase Operation 
This  is  the  time 
taken 
for 
the 
5320.237 
5220.937 
complete 
erase 
operation  of  256 
bytes data length. 
71 

Chapter 13                                                                                                                     P1M Specific Information 
 
 
 
Throughput 
 
Sl. No.  API Name 
Throughput in 
Remarks 
µ seconds for 
in µ 
701318 
seconds for 
with Interrupt 
701318 with 
OFF 
Interrupt ON 
14. 
 Write Operation 
This  is  the  time 
taken 
for 
the 
complete 
write 
6525.620 
6543.675 
operation  of  256 
bytes 
data 
length. 
15. 
 Blank Check Operation 
This  is  the  time 
taken 
for 
176.35 
178.887 
performing  blank 
check  operation 
of 256 bytes data 
length. 
16. 
 Read Immediate Operation 
This  is  the  time 
taken 
for 
the 
complete 
fast 
45.375 
48.375 
read operation of 
256  bytes  data 
length 
without 
performing  blank 
check 
before 
read. 
17. 
 Read Operation 
This  is  the  time 
taken 
for 
the 
1498.237 
1501.475 
complete 
read 
operation  of  256 
bytes 
data 
length. 
18. 
 Compare Operation 
This  is  the  time 
taken 
for 
the 
236.712 
239.55 
complete 
compare 
operation  of  256 
bytes data length. 
 
 FLENDNM_ISR operation 
This  is  the  time 
19. 
NA 
4.812 
taken 
for 
the 
complete 
Erase 
of  1  block  data 
length. 
This  is  the  time 
taken 
for 
the 
NA 
4.962 
complete Write of 

word 
data 
length 
20. 
 Fls_Suspend 
Suspend and 
 
Resume 
throughput are 
NA 
0.225 
taken for 
interrupt mode as 
per the 
requirement 
72 
 

 P1M Specific Information                                                                                                   Chapter 13 
 
 
 
Throughput 
 
Sl. No.  API Name 
Throughput in 
Remarks 
µ seconds for 
in µ 
701318 
seconds for 
with Interrupt 
701318 with 
OFF 
Interrupt ON 
21. 
 Fls_Resume 
Suspend and 
 
Resume 
NA 
4.3 
throughput are 
taken for 
interrupt mode as 
per the 
requirement 
 
Fls_MainFunction - for single 
This is the time 
22. 
Read Operation 
1498.237 
NA 
taken for the 
 
complete read 
 
operation of 256 
bytes data length. 
    23. 
Fls_MainFunction - for single 
5.137 
NA 
This is the time 
Erase Atomic Operation 
 
taken for Fls 
scheduler to 
complete the 
single erase 
atomic operation 
24. 
Fls_MainFunction - for single 
3.137 
NA 
This is the time 
Write Atomic Operation 
taken for Fls 
scheduler to 
complete the 
single write 
atomic operation 
 
NOTE: The Throughput time for a Single Fls_Erase and Fls_BlankCheck operation is more 
with Interrupt ON than with Interrupt OFF. 
This is because in Interrupt ON, Throughput time includes the normal operation time along 
with the Interrupt ISR execution time since the interrupt is generated immediately after the 
command processing is complete and is serviced accordingly. 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73 

Chapter 13                                                                                                                     P1M Specific Information 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74 
 

Release Details 
Chapter 14 
 
Chapter 14  Release Details 
 
FLS Driver Software  
 
Version: 1.0.5 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75 

Chapter 14                                                                                                                                          Release Details 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76 
 

 
Revision History 
 
Sl.No.  Description 
Version 
Date 
1. 
Initial Version 
1.0.0 
15-Feb-2016 
2. 
 Following changes are made: 
1.0.1 
24-Mar-2016 
 
1.  Chapter 2 ‘Reference Documents’ updated to correct the device 
manual name and version and corrected version of 
'AUTOSAR_SWS_MemoryMapping.pdf' and 
'AUTOSAR_SWS_CompilerAbstraction.pdf'. 
2.  Updated Chapter 4 ‘ForeThoughts’ to add the precaution about 
accessing hardware register in section 4.1 ‘General’. 
3.  Updated Chapter 6 ‘Register Details’ to add ICFLENDNM register 
wherever applicable and removed register details of Fls_SetFHVE 
function. 
4.  Updated Chapter 5 ‘Architecture Details’, to correct the description of 
Fls_Suspend API. 
5.  Chapter 12 ‘Memory Organization’ has been updated to remove the 
sections FLS_BUFFER_CODE_RAM, 
FLS_USER_BUFFER_CODE_RAM and 
FLS_CFG_DBTOC_UNSPECIFIED and added NOINIT_RAM_32BIT 
and FLS_CFG_DATA_UNSPECIFIED.  
6.  Updated Chapter 13.3 ‘Memory and Throughput’. 
7.  Updated Chapter 14 ‘Release Details’ to correct the driver version. 
3. 
 Following changes are made: 
1.0.2 
16-Jul-2016 
 1.  Added precondition items about critical protection and transient 
hardware faults in chapter 4.2 ‘Precondition’. 
2.  Updated Chapter 14 ‘Release Details’. 
3.  Added a ‘Note’ below the table 'Supervisor mode and User mode 
details'. 
4.  Updated Chapter 13.3 ‘Memory and Throughput’. 
5.  In chapter 8, heading changed to "The Stub C header files:" and 
missing stub files are added. 
6.  Table 4-1 is added to list protected resources in FLS driver 
7.  Section 13.2 reference to .one and .html files are removed 
8.  Note added in section 13.2.1 ISR function. 
9.  Description added for the FLS Driver Component Files. 
10.  Updated Chapter 6 ‘Register Details’ to add IMR register details. 
11.  Merged parameter definition files in sections 13.1.3 and 13.2.1 
12.  Added new header file ‘Fls_RegWrite.h’ in section 3.1.1 and section 
8. 
13.  Updated R-Number 
14.  Chapter 12 is updated for the modification of Memory  sections 
4. 
 Following changes are made: 
1.0.3 
21-Oct-2016 
 
1.  Updated section 4 ‘Forethoughts’ 
 
2.  Updated the table 11-1 ‘Development and Production Errors’ to add  
Fls_SetMode API under DET ‘FLS_E_PARAM_CONFIG’ 
3.  Updated Chapter 13.3 ‘Memory and Throughput’ 
4.  Updated chapter 12 Memory Organization 
5.  Updated section 13.1.2 Services Provided by FLS Driver Component 
to the User 
 
77 

 
Sl.No.  Description 
Version 
Date 
5. 
Following changes are made: 
1.0.4 
17-Feb-2017 
1.  Updated Table for Abbreviations and Acronyms to remove unused 
Abbreviations/ Acronyms. 
 
2.  Updated Chapter 2 Reference Documents. 
3.  Updated section 4.1 ‘General’ to add information about Read, Read 
Immediate, Suspend and Resume operations. 
4.  Updated section 4.2 ‘Preconditions’ to add information about 
BlankCheck operation. 
5.  Updated Chapter 3 and Chapter 9 to rename the FLS Driver 
Generation Tool reference document. 
6.  Updated Section 13.3.1 with ROM/RAM usage values. 
7.  Updated Section 13.3.3 ‘Throughput Details’ to add Note under 
Table 13-6 Throughput Details of the APIs and updated the  
Throughput details. 
8.  Updated section 12 ‘Memory Organization’ to remove unused 
memory segments and their descriptions. 
9.  Updated Chapter 14 for FLS Driver Software version. 
10.  Updated notice, address and copyright information’s. 
11.  Version of R-number is updated at the end of document. 
12.  Updated Section 7.1 to add Cautions. 
13.  Updated Section 10.3 with the details of Fls_Resume API. 
6. 
Following changes are made: 
1.0.5 
04-May-2017 
1.   Updated section 4.2 and section 10.3 with details of newly added   
notification function Fls_CallSwitchBFlashErrorNotification. 
2.  Updated section 13.3 ‘Memory and Throughput’. 
3.  Updated Chapter 14 for FLS Driver Software version. 
4.  Version of R-number is updated at the end of document. 
5.  Updated section name from FLS_START_SEC_PRIVATE_CODE 
and FLS_STOP_SEC_PRIVATE_CODE to  
FLS_START_SEC_PRIVATERAM_CODE and     
FLS_STOP_SEC_PRIVATERAM_CODE respectively in section 4.2. 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
AUTOSAR MCAL R4.0.3 User's Manual 
FLS Driver Component Ver.1.0.5 
Embedded User's Manual 
 
Publication Date: Rev.1.02, May 04, 2017 
 
 
Published by: Renesas Electronics Corporation 
 
 
 
 
 
 



 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
SALES  OFFICES 
 
http://www.renesas.com 
 
Refer  to "http://www.renesas.com/" for the latest  and  detailed  information. 
Renesas Electronics America Inc. 
2801 Scott Boulevard Santa Clara, CA 95050-2549, U.S.A. 
Tel: +1-408-588-6000, Fax: +1-408-588-6130 
Renesas Electronics Canada Limited 
9251 Yonge Street, Suite 8309 Richmond Hill, Ontario Canada L4C 9T3 
Tel: +1-905-237-2004 
Renesas Electronics Europe Limited 
Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, U.K 
Tel: +44-1628-585-100, Fax: +44-1628-585-900 
Renesas Electronics Europe GmbH 
Arcadiastrasse 10, 40472 Düsseldorf, Germany 
Tel: +49-211-6503-0, Fax: +49-211-6503-1327 
Renesas Electronics (China) Co., Ltd. 
Room 1709, Quantum Plaza, No.27 ZhiChunLu Haidian District, Beijing 100191, P.R.China 
Tel: +86-10-8235-1155, Fax: +86-10-8235-7679 
Renesas Electronics (Shanghai) Co., Ltd. 
Unit 301, Tower A, Central Towers, 555 Langao Road, Putuo District, Shanghai, P. R. China 200333 
Tel: +86-21-2226-0888, Fax: +86-21-2226-0999 
Renesas Electronics Hong Kong Limited 
Unit 1601-1611, 16/F., Tower 2, Grand Century Place, 193 Prince Edward Road West, Mongkok, Kowloon, Hong Kong 
Tel: +852-2265-6688, Fax: +852 2886-9022 
Renesas Electronics Taiwan Co., Ltd. 
13F, No. 363, Fu Shing North Road, Taipei 10543, Taiwan 
Tel: +886-2-8175-9600, Fax: +886 2-8175-9670 
Renesas Electronics Singapore Pte. Ltd. 
80 Bendemeer Road, Unit #06-02 Hyflux Innovation Centre, Singapore 339949 
Tel: +65-6213-0200, Fax: +65-6213-0300 
Renesas Electronics Malaysia Sdn.Bhd. 
Unit 1207, Block B, Menara Amcorp, Amcorp Trade Centre, No. 18, Jln Persiaran Barat, 46050 Petaling Jaya, Selangor Darul Ehsan, Malaysia 
Tel: +60-3-7955-9390, Fax: +60-3-7955-9510 
Renesas Electronics India Pvt. Ltd. 
No.777C, 100 Feet Road, HAL II Stage, Indiranagar, Bangalore, India 
Tel: +91-80-67208700, Fax: +91-80-67208777 
Renesas Electronics Korea Co., Ltd. 
12F., 234 Teheran-ro, Gangnam-Gu, Seoul, 135-080, Korea 
Tel: +82-2-558-3737, Fax: +82-2-558-5141 
 
 
 
 
 
© 2006-2017 Renesas  Electronics  Corporation.  All rights reserved. 
Colophon  4.1 
 



AUTOSAR MCAL R4.0.3 
User's Manual 
R20UT3710EJ0102 

Document Outline


6 - R20UT3711EJ0101-AUTOSAR

AUTOSAR MCAL R4.0 User's Manual

8 - R20UT3711EJ0101-AUTOSARs




 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
AUTOSAR MCAL R4.0.3 
User’s Manual 
 
 
 
 
 
FLS Driver Component Ver.1.0.8 
 
 
 
 
 
 
Generation Tool User’s Manual 
 
 
Target Device: 
RH850/P1x 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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). 
 
 
 
 
 
 
 
 
www.renesas.com 
Rev.1.01 Feb 2017 

 
 
2 
 

 
 
 
 
 
 
 
 
 
Notice 
 
1. 
Descriptions of circuits, software and other related information in this document are provided only to illustrate the operation 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 disputes 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, drawing, chart, program, algorithm, 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 otherwise misappropriate 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, copy or 
 
otherwise misappropriation of Renesas Electronics products. 
 
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; and 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. 
 
Renesas Electronics products are neither intended nor 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 damages (space and 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 third parties arising from the use of any Renesas Electronics product for which the 
 
product is not intended by Renesas Electronics. 
 
6. 
When using the 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 radiation characteristics, 
 
installation, etc. Renesas Electronics disclaims any and all liability for any malfunctions or failure or accident arising out of the use of Renesas 
 
Electronics products beyond 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. Further, Renesas 
 
Electronics products are not subject to radiation resistance design. Please ensure to implement safety measures to guard them against the 
 
possibility of bodily injury, injury or damage caused by fire, and social damage in the event of 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 by your own responsibility as warranty for your products/system. 
 
Because the evaluation of microcomputer software alone is very difficult and not practical, please evaluate 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. Please investigate applicable laws and regulations that regulate the inclusion or use of controlled substances, including 
 
without limitation, the EU RoHS Directive carefully and sufficiently and use 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 not use Renesas Electronics products or technologies for (1) 
 
any purpose relating to the development, design, manufacture, use, stockpiling, etc., of weapons of mass destruction, such as nuclear weapons, 
 
chemical weapons, or biological weapons, or missiles (including unmanned aerial vehicles (UAVs)) for delivering such weapons, (2) any purpose 
 
relating to the development, design, manufacture, or use of conventional weapons, or (3) any other purpose of disturbing international peace and 
 
security, and you shall not sell, export, lease, transfer, or release Renesas Electronics products or technologies to any third party whether directly 
or indirectly with knowledge or reason to know that the third party or any other party will engage in the activities described above. When 
 
exporting, selling, transferring, etc., Renesas Electronics products or technologies, you shall comply with any applicable export control laws and 
 
regulations promulgated and administered by the governments of the countries asserting jurisdiction over the parties or transactions. 
 
 
10.  Please acknowledge and agree that you shall bear all the losses and damages which are incurred from the misuse or violation of the terms and 
 
conditions described in this document, including this notice, and hold Renesas Electronics harmless, if such misuse or violation results from your 
 
resale or making Renesas Electronics products available any third party. 
 
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 majority-owned 
 
subsidiaries. 
 
(Note 2)   "Renesas Electronics product(s)" means any product developed or manufactured by or for Renesas Electronics.
 
 
 
 
 
 
3 
 

 
 
4 
 

 
Abbreviations and Acronyms 
 
 
Abbreviation / Acronym 
Description 
API 
Application Programming Interface 
AUTOSAR 
AUTomotive Open System ARchitecture 
BSWMDT 
Basic Software Module Description Template 
DEM/Dem 
Diagnostic Event Manager 
ECU 
Electronic Control Unit 
FACI 
Flash Application Command Interface 
FLS 
FLash Driver 
FCU 
Flash Control Unit 
id 
Identifier 
MCAL 
Microcontroller Abstraction Layer 
MCU 
MicroController Unit 
PDF 
Parameter Definition File 
XML 
eXtensible Mark-up Language 
RUCG 
Renesas Unified Code Generator 
 
 
 
Definitions 
 
 
 
Terminology 
Description 
BSWMDT File 
This file is the template for the Basic Software Module Description. 
Configuration XML File 
This file contains the setting of command line options. 
ECU Configuration Description 
Input file to FLS Driver Generation Tool. It is generated by ECU 
File 
Configuration Editor. 
Sl.No 
Serial Number. 
Translation XML File 
This file contains the translation and device specific header file path. 
 
5 

 
 
6 
 

 
Table of Contents 
 
Chapter 1 
Introduction ........................................................................................... 9 
1.1 
Document Overview .................................................................................................................. 9 
Chapter 2 
Reference ............................................................................................. 11 
2.1 
Reference Documents ............................................................................................................. 11 
2.2 
Trademark Notice .................................................................................................................... 11 
Chapter 3 
FLS Driver Generation Tool Overview ............................................... 13 
Chapter 4 
Input Files ............................................................................................ 15 
Chapter 5 
Output Files ......................................................................................... 17 
Chapter 6 
Precautions .......................................................................................... 19 
Chapter 7 
User Configuration Validation ............................................................ 21 
Chapter 8 
Messages ............................................................................................. 23 
8.1 
Error Messages ........................................................................................................................ 23 
8.2 
Warning Messages .................................................................................................................. 28 
8.3 
Information Messages ............................................................................................................. 28 
Chapter 9 
Notes .................................................................................................... 29 
 
 
 
 
 
7 
 

 
List of Figures 
 
Figure 3-1 
Overview of FLS Driver Generation Tool ....................................................................... 13 
 
 
 
List of Tables 
 
Table 2-1    Reference Documents Description ........................................................................................ 11 
Table 5-1    Output Files Description ......................................................................................................... 17 
Table 8-1    Parameters and Container related to error ERR092004 ........................................................ 23 
Table 8-2    Parameters and Container related to error ERR092007 ........................................................ 24 
Table 8-3    Parameters and Container related to error ERR092012 ........................................................ 25 
Table 8-4    Parameters and Container related to error ERR092015 ........................................................ 25 
Table 8-5    Parameters and Container related to error ERR092017 ........................................................ 25 
Table 8-6    Parameters and Container related to error ERR092018 ........................................................ 26 
Table 8-7    Parameters and Container related to error ERR092019 ........................................................ 26 
Table 8-8    Parameters and Container related to error ERR092028 ........................................................ 27 
 
 
 
 
 
 
8 
 

Introduction                                                                                                                           Chapter 1 
 
Chapter 1 
Introduction 
 
 
The FLS Software component provides the service for initializing the whole 
FLS structure of the microcontroller. 
 
 
The FLS Software Component comprises of two sections as Embedded 
Software and the Generation Tool to achieve scalability and configurability. 
 
 
The document describes the features of the FLS Software Generation Tool. 
FLS Software Generation Tool is a command line tool that extracts 
information from ECU Configuration Description File and generates FLS 
Software C Header files and Source Files (Fls_Cbk.h, Fls_Cfg.h and 
Fls_PBcfg.c). 
 
 
This document contains information on the options, input and output files of 
the FLS Software Generation Tool. In addition, this manual covers a step-
by-step procedure for the usage of tool. 
 
 
 
ECU Configuration Description File contains information about FLS 
configuration. 
 
 
 
1.1 
Document Overview 
 
 
This user manual is organized as given in the table below: 
 
 
Section 
Contents 
Section 1 (Introduction) 
Provides an introduction to the document and explains how information 
is organized in this manual. 
Section 2 (Reference) 
Provides a list of documents referred while developing this document. 
Section 3 (FLS Driver 
Provides the component overview of FLS Driver. 
Generation Tool Overview) 
Section 4 (Input Files) 
Provides information about ECU Configuration Description File. 
Section 5 (Output Files) 
Explains the output files that are generated by the FLS Driver 
Generation Tool. 
Section 6 (Precautions) 
Contains precautions to be taken during configuration of ECU 
Configuration Description File. 
Section 7 (User Configuration 
Describes about user configuration validation done by the FLS Driver 
Validation) 
Generation Tool. 
Section 8 (Messages) 
Describes all the Error/Warning/Information messages of R4.0.3 which 
helps the user to understand the probable reason for the same. 
Section 9 (Notes) 
Provides notes to help the user to understand this document better. 
 
9 

Chapter 1                                                                                                                              Introduction 
 
 
  10 

Reference 
Chapter 2 
 
 
Chapter 2 
Reference 
 
 
 
2.1 
Reference Documents 
 
 
The following table lists the documents referred to develop this document: 
 
Table 2-1    Reference Documents Description 
 
Sl.No.  Title 
Version 
1. 
Specification of Flash Driver for R4.0.3 
3.2.0 
AUTOSAR_SWS_FlashDriver.pdf 
 
2. 
P1x Parameter Definition File 
1.1.6 
 
R403_FLS_P1M_04_05_10_to_15.arxml 
3. 
P1x Parameter Definition File 
1.0.6 
R403_FLS_P1M_18_to_23.arxml 
 
 
 
2.2 
Trademark Notice 
 
 
Microsoft and Windows are trademarks/registered trademarks of Microsoft 
Corporation. 
 
11 

Chapter 2 
Reference 
 
 
 
12 

FLS Driver Generation Tool Overview 
Chapter 3 
 
 
Chapter 3 
FLS Driver Generation Tool Overview 
 
 
 
 
FLS Driver Generation Tool overview is shown below. 
 
 
 
 
 
 
 
ECU 
 
 
Configuration 
 
Fls_Cbk.h, 
Description 
RUCG Tool 
Fls_Cfg.h, 
File, BSWMDT 
Fls_PBcfg.c
File, Translation 
XML File, 
Configuration 
XML File and 
Fls_X1x.dll 
 
 
 
 
 
 
 
Figure 3-1  Overview of FLS Driver Generation Tool 
                   

Renesas  Unified  Code  Generator  (RUCG)  tool  shall  be  used  for  FLS  driver       
configuration generation. 
RUCG  tool  is  a  command  line  tool  that  extracts,  analyzes  the  configuration 
details  provided  in  the  input  file  and  validates  correctness  of  the  data  and 
provides scalability and configurability for FLS Driver module. It accepts ECU 
Configuration  Description  File(s),  BSWMDT  File,  Translation  XML  File, 
Configuration  XML  File  and  Fls_X1x.dll  as  input  and  displays  appropriate 
context  sensitive  error  messages  for  wrong  input  and  exits.  Tool  creates  the 
Log file Fls.log) that contains the list of Error/Warning/Information messages in 
the output directory. 
 
For the error free input file, the tool generates the following output files: 
 
FLS Driver generation tool will generate Fls_Cfg.h, Fls_Cbk.h and Fls_PBcfg.c 
files. 
 
Fls_Cfg.h  and  Fls_Cbk.h  will  be  compiled  and  linked  with  FLS  Driver 
Component.  Fls_PBcfg.c  will  be  compiled  and  linked  separately  from  the 
other C Source files and placed in flash. 
 
ECU Configuration Description File can be created or edited using ECU 
Configuration Editor. 
 
 
 
13 

Chapter 3                                                                                   FLS Driver Generation Tool Overview 
 
Remark 
 
• In case of errors the generation tool returns a 1, in case of no errors the 
generation tool returns a 0. 
 
• FLS Driver Generation Tool uses “Common Published Information” from 
FLS module specific BSWMDT File. FLS module specific BSWMDT File 
should not be updated manually since it is “Static Configuration” file. 
 
14 

Input Files 
Chapter 4 
 
 
Chapter 4  Input Files 
 
 
 
 
RUCG Tool accepts ECU Configuration Description File(s), BSWMDT File, 
Translation XML File, Configuration XML File and Fls_X1x.dll as input. FLS 
Driver Generation Tool needs information about FLS Driver module. Hence 
ECU  Configuration  Description  File  should  contain  configuration  of  FLS 
Driver module. Generation Tool ignores any other AUTOSAR component 
configured  in  the  ECU  Configuration  Description  File.  ECU  Configuration 
Description File can be generated using configuration editor. 
 
ECU Configuration Description File must comply with AUTOSAR standard 
ECU Configuration Description File format. 
 
 
Remark  The detailed explanation about the parameters and containers are found in 
Parameter Definition File mentioned in the Reference Documents section. 
 
15 

Chapter 4                                                                                                                                Input Files 
 
 
 
16 

Output Files 
Chapter 5 
 
 
Chapter 5  Output Files 
 
 
RUCG  Tool  generates  configuration  details  in  C  Header  and  C  Source  files 
(Fls_Cbk.h, Fls_Cfg.h and Fls_PBcfg.c). 
 
The content of each output file is given in the table below: 
 
 
Table 5-1    Output Files Description 
 
Output File 
Details 
Fls_Cbk.h 
This file contains call-back functions prototype declarations. 
Fls_Cfg.h 
This file contains pre-compile time parameters. 
Fls_PBcfg.c 
This file contains post-build time parameters. 
 
Remark  Output files generated by FLS Driver Generation Tool should not be modified 
or edited manually. 
 
17 

Chapter 5                                                                                                                              Output Files 
 
 
 
18 

Precautions 
Chapter 6 
 
 
Chapter 6  Precautions 
 

 
 
 
• 
ECU  Configuration  Description  File  and  BSWMDT  File  must  comply  with 
AUTOSAR  standard  for  R4.0.3  ECU  Configuration  Description  File  and 
BSWMDT File respectively. 
 
• 
The input file must contain FLS Driver module. 
 
• 
Default  Translation  XML  File  (Fls_X1x.trxml)  should  be  present  in  same 
location of Fls_X1x.dll when the variant specific trxml file is not given as input 
in command line. 
 
 
• 
Default Configuration XML File (Fls_X1x.cfgxml) must be present in same 
location of Fls_X1x.dll. 
 
• 
If Translation XML File is not provided on the command line, Fls_X1x.trxml 
which  is  present in  same  location  of  Fls_X1x.dll  is  considered  as  ‘default’ 
Translation XML File. 
 
• 
If  Configuration  XML  File  is  not  provided  on  the  command  line, 
Fls_X1x.cfgxml  which  is  present  in  same  location  of  Fls_X1x.dll  is 
considered as ‘default’ Configuration XML File. 
 
• 
Translation XML File should contain the file extension ‘.trxml’. 
 
• 
Configuration XML File should contain the file extension ‘.cfgxml’. 
 
• 
All  the  function  names  and  the  string  values  configured  should  follow  C 
syntax for variables. It can only contain alphanumeric characters and “_”. It 
should start with an alphabet. 
 
• 
If  the  output  files  generated  by  FLS  Driver  Generation  Tool  are  modified 
externally, then they may not produce the expected results or may lead to 
error/warning/Information messages. 
 
• 
Short Name for a container should be unique within a name space. 
 
• 
An  error  free  ECU  Configuration  Description  File  generated  from 
configuration editor has to be provided as input to the FLS Driver Generation 
Tool. Otherwise Tool may not produce the expected results or may lead to 
errors/warnings/information messages. 
 
• 
User has to make sure that the respective device specific configuration file 
is used otherwise Tool may not produce the expected results or may leads
 
19 

Chapter 6                                                                                                                              Precautions 
 
 
to errors/warnings/information messages. 
 
• 
The description file should always be generated using AUTOSAR specified 
configuration editor and it should not be edited manually. 
 
 
 
Remark  Please refer the FLS Component User Manual for deviations from AUTOSAR 
Specifications, if any. 
20 
 

User Configuration Validation 
Chapter 7 
 
 
Chapter 7  User Configuration Validation 
 
 
 
 
This  section  provides  help  to  analyze  the  error,  warning  and  information 
messages  displayed  during  the  execution  of  FLS  Driver  Generation  Tool.  It 
ensures conformance of input file with syntax and semantics. It also performs 
validation on the input file for correctness of the data. 
 
For  more  details  on  list  of  Error/Warning/Information  messages  that  are 
displayed as a result of input file(s) validation, refer Chapter 8 “Messages”. 
 
The Generation Tool displays error or warning or information when the user 
has  configured  incorrect  inputs.  The  format  of  Error/Warning/Information 
message is as shown below. 
 
 
• 
ERR/WRN/INF<mid><xxx>: <Error/Warning/Information Message>. 
Where, 
<mid>: 092- FLS Driver Module id (092) for user configuration checks. 
 
000 – for command line checks. 
 
<xxx>: 001-999 – Message id. 
 
 
• 
File Name: Name of the file in which the error has occurred. 
 
• 
Path: Absolute path of the container in which the parameter is present. 
 
 
‘File Name’ and ‘Path’ need not be present for all Error/Warning/Information 
messages. 
 
21 

Chapter 7                                                                                                User Configuration Validation 
 
 
 
22 

 
 
 
 
 
 
 
 
      Messages 
    Chapter 8                                                                                           
 
Chapter 8  Messages 
 
 
The  messages  help  to  identify  the  syntax  or  semantic  errors  in  the  ECU 
Configuration  Description  File.  Hence  it  ensures  validity  and  correctness  of  the 
information available in the ECU Configuration Description File. 
 
The  following  section  gives  the  list  of  error,  warning  and  information  messages 
displayed by the Generation Tool. 
 
 
8.1  Error Messages 
 
ERR092001: Number of fields is not same for the entity ‘Structure Name’. 
 
This error occurs, if the number of fields is not same in the structure that is to be 
generated in the output file. 
 
ERR092002: Field ‘Field Name’ is empty in the entity ‘Structure Name’. 
 
This error occurs, if the structure fields that are to be generated in the output file 
are empty. 
 
ERR092003: ‘FLS Driver / MCU Driver’ Component is not present in the input 
file(s).
 
 
This  error  occurs,  if  FLS  Driver  or  MCU  Driver  component  is  not  present  in  the 
input ECU Configuration Description File(s). 
 
ERR092004:  The  parameter  ‘parameter  name’  in  the  container  ‘container 
name’ should be configured.
 
 
This error occurs, if any of the mandatory configuration parameter(s) mentioned 
below  is  (are)  not  configured  in  ECU  Configuration  Description  File.  The  list  of 
mandatory parameters with respect to container is listed below: 
 
Table 8-1    Parameters and Container related to error ERR092004 
 

 
Parameter Name 
Container Name 
FlsDevErrorDetect 
 
 
FlsCancelApi 
 
FlsCompareApi 
 
FlsSetModeApi 
 
 
FlsUseInterrupts 
 
FlsVersionInfoApi 
 
FlsVersionCheckExternalModules 
FlsGeneral 
FlsCriticalSectionProtection 
 
FlsFaciEccCheck 
FlsInterruptConsistencyCheck 
FlsWriteVerify 
FlsUseWVErrorInterface 
FlsLoopCount 
FlsVirtualBoundaryAddress 
FlsDeviceName 
FlsTimeoutMonitoring 
FlsEraseTime 
 
FlsWriteTime 
 
 
23 

 
 
 
 
 
 
 
      Chapter 8 
   Messages                                                                                           
Parameter Name 
Container Name 
FlsErasedValue 
FlsPublishedInformation 
FlsBlankCheckTime 
FlsCallCycle 
FlsDefaultMode 
FlsMaxReadFastMode 
FlsMaxReadNormalMode 
FlsSectorIndex 
 
 
FlsNumberOfSectors 
 
 
FlsPageSize 
FlsSector 
FlsSectorSize 
FlsSectorStartaddress 
FlsDFBaseAddress 
 
 
FlsDFBlockSize 
 
 
FlsDFTotalBlocks 
 
FlsDataFlashSize 
 
FlsFdlCpuFrequency 
FlsDataFlash 
FlsBlankCheckApi 
FlsReadImmediateApi 
FlsSuspendApi 
FlsResumeApi 
FLS_E_READ_FAILED 
 
 
FLS_E_WRITE_FAILED 
 
FLS_E_READ_FAILED_DED 
FlsDemEventParameterRefs 
FLS_E_ERASE_FAILED 
 
FLS_E_COMPARE_FAILED 
 
FLS_E_HW_FAILURE 
 
 
 
 
Remark 
 

                                  •   The container FlsDataFlash and its parameters are mandatory. 
 
ERR092007:  The  value  configured  for  the  parameter  ‘parameter  name’      
should follow C syntax < [a-zA-Z] [a-zA-Z0-9_]>. 

 
This  error  occurs,  if  the  value  of  configuration  parameters  mentioned  in  below 
table does not adhere to C syntax as if the value contains characters other than 
(a-z, A-Z, 0-9 or “_”). The parameter value should always start with an alphabet. 
 
Table 8-2    Parameters and Container related to error ERR092007 
 
Parameter Name 
Container Name 
FlsJobEndNotification 
FlsConfigSet 
FlsJobErrorNotification 
FlsEccSedNotification 
FlsDataFlash 
 FlsEccDedNotification 
 
 
ERR092012:  The  reference  path  <reference  value>  provided  for  the 
parameter ‘parameter name’ within the container
 
‘FlsDemEventParameterRefs’ is incorrect. 
 
This  error  occurs,  if  the  reference  path  <reference  value>  provided  for  the 
 
24 

 
 
 
 
 
 
 
 
      Messages 
    Chapter 8                                                                                           
 
following  parameters  within  the  container  ‘FlsDemEventParameterRefs’  is 
incorrect. 
Table 8-3    Parameters and Container related to error ERR092012 
 
Parameter Name 
Container Name 
FLS_E_COMPARE_FAILED 
 
 
FLS_E_ERASE_FAILED 
 
FLS_E_READ_FAILED 
FlsDemEventParameterRefs 
FLS_E_WRITE_FAILED 
FLS_E_READ_FAILED_DED 
FLS_E_REG_WRITE_VERIFY 
FLS_E_HW_FAILURE 
FLS_E_ECC_FAILED 
FLS_E_INT_INCONSISTENT 
 
 
ERR092015: The value configured for the parameter ‘parameter name’ in 
the container ‘FlsSector’ should be <actual value>, since the sector used 
is data flash sector.
 
 
This  error  occurs,  if  the  value  configured  for  the  following  parameters  in  the 
container FlsSector is not as per below table. 
 
Table 8-4    Parameters and Container related to error ERR092015 
 
FlsNumberOfSector 
FlsSectorSize 
512 
64 
 
Remark 
  For  R7F701318,  R7F701319,  R7F701320,  R7F701321,  R7F701322  and 
R7F701323 devices the value for FlsNumberOfSector is 1024. 
 
ERR092017: The value configured for the parameter ‘parameter name’ in 
the container ‘container name’ should be same for the FlsSectorIndex
 
<Value of FlsSectorIndex> across the multiple configuration set of 
‘FlsConfigSet’. 
 
This  error  occurs,  if  the  value  configured  for  the  following  parameters  in  the 
respective  container  is  not  same  for  the  FlsSectorIndex  across  the  multiple 
configuration set of FlsConfigSet. 
 
Table 8-5    Parameters and Container related to error ERR092017 
 
Parameter Name 
Container Name 
FlsSectorSize 
 
 FlsSector 
FlsNumberOfSectors 
FlsSectorStartaddress 
 
 
ERR092018: 

The 
values 
configured 
for 
the 
parameters 
‘FlsEccSedNotification’  and  ‘FlsEccDedNotification’  in  the  container 
‘FlsDataFlash’  and  the  values  configured  for  the  parameters 
‘FlsJobEndNotification’  and  ‘FlsJobErrorNotification’  in  any  of  the 
‘FlsConfigSet’ container should be unique. 
 
 
25 

 
 
 
 
 
 
 
      Chapter 8 
   Messages                                                                                           
This 
error 
occurs, 
if 
the 
values 
configured 
for 
the 
parameters 
‘FlsEccSedNotification’ 
and 
‘FlsEccDedNotification’ 
in 
the 
container 
‘FlsDataFlash’ 
and 
the 
values 
configured 
for 
the 
parameters 
‘FlsJobEndNotification’  and  ‘FlsJobErrorNotification’  in  any  of  the  ‘FlsConfigSet’ 
container  is  not  unique.  For  example,  the  following  table  shows  the  conditions 
when the error message occurs. 
 
Table 8-6    Parameters and Container related to error ERR092018 
 
Container : FlsDataFlash 
Container : FlsConfigSet 
FlsEccSedNotification  FlsEccDedNotification  FlsJobEndNotification  FlsJobErrorNotification 
EccSedNotification 
EccSedNotification 
EccSedNotification 
EccSedNotification 
EccSedNotification 
EccSedNotification 




EccSedNotification 
EccSedNotification 

EccSedNotification 

EccSedNotification  
EccSedNotification 


EccSedNotification  
 
 
ERR092019: The value configured for the parameter ‘parameter name’ in the 
container ‘FlsDemEventParameterRefs’ should be same across the multiple 
configuration set of ‘FlsConfigSet’.
 
 
This  error  occurs,  if  the  value  configured  for  the  following  parameters  in  the 
container  FlsDemEventParameterRefs  is  not  same  across  the  multiple 
configuration set of FlsConfigSet. 
 
Table 8-7    Parameters and Container related to error ERR092019 
 
 

Parameter Name 
Container Name 
FLS_E_COMPARE_FAILED 
 
FLS_E_ERASE_FAILED 
 
FLS_E_READ_FAILED 
 
FlsDemEventParameterRefs 
FLS_E_WRITE_FAILED 
 
FLS_E_READ_FAILED_DED 
 
FLS_E_REG_WRITE_VERIFY 
 
FLS_E_HW_FAILURE 
FLS_E_INT_INCONSISTENT 
FLS_E_ECC_FAILED 
 
ERR092020: The value configured for the parameter ‘FlsSectorIndex’ in the 
container ‘FlsSector’ should be same across the multiple configuration set 
of 'FlsConfigSet'.
 
 
This error occurs, if the value configured for the parameter FlsSectorIndex in the 
container  FlsSector  is  not  same  across  the  multiple  configuration  set  of 
FlsConfigSet. 
ERR092023:  The  reference  path  of  MCU  <configured  value  of 
FlsFdlCpuFrequency>  provided  for  the  parameter  ‘FlsFdlCpuFrequency’ 
in the container 'FlsDataFlash' is incorrect.
 
 
This error occurs, if the reference path of MCU provided for the parameter 
FlsFdlCpuFrequency in the container FlsDataFlash is incorrect. 
 
 
ERR092028: The value configured for the parameter 
'FlsSectorStartaddress' should be within the range of <range of value> for 
 
26 

 
 
 
 
 
 
 
 
      Messages 
    Chapter 8                                                                                           
 
the <configured value of FlsSectorOption>. 
 
This  error  occurs,  if  the  value  configured  for  the  parameter 
FlsSectorStartaddress is not within the below range. 
 
Table 8-8    Parameters and Container related to error ERR092028 
 
Range of value for FlsSectorStartaddress 
0 to (value configured for FlsVirtualBoundaryAddress - 1) 
 
 
ERR092029: The value configured for the parameter 'FlsTotalSize' should be 
(FlsNumberOfSectors  *  FlsSectorSize)  since  the  sector  used  is  data  flash 
sector. 
 
This error occurs, if the parameter FlsTotalSize in the container FlsGeneral is not 
configured with value equal to (FlsNumberOfSectors * FlsSectorSize). 
 
ERR092032: The value configured for the parameter  FlsMaxReadFastMode 
should be greater than or equal to FlsMaxReadNormalMode in the container 
FlsConfigSet
 <config_index>. 
 
This error occurs, if the parameter FlsMaxReadFastMode  is not configured  with 
value 
greater 
than 
the 
value 
configured 
for 
the 
parameter 
FlsMaxReadNormalMode in the container FlsConfigSet. 
 
ERR092033: The value configured for the parameter FlsCallCycle should be 
greater than '0' if the parameter FlsTimeoutMonitoring is set as TRUE. 
 
This error occurs, if the parameter FlsTimeoutMonitoring is set to TRUE and the 
value configured for the FlsCallCycle is 0. 
 
ERR092034:  If  the  parameter FlsFaciEccCheck  is  configured  as  true,  then 
FLS_E_ECC_FAILED in the container FlsDemEventParameterRefs must be 
configured. 
 
This  error  will  occur  if  no  reference  path  is  provided  for  the  DEM  parameter 
FLS_E_ECC_FAILED  in  the  container  FlsDemEventParameterRefs  when  the 
parameter FlsFaciEccCheck is configured as true. 
 
ERR092035:  If  the  parameter  FlsInterruptConsistencyCheck  is  configured 
as 

true, 
then 
FLS_E_INT_INCONSISTENT 
in 
the 
container 
FlsDemEventParameterRefs must be configured. 
 
This  error  will  occur  if  no  reference  path  is  provided  for  the  DEM  parameter 
FLS_E_INT_INCONSISTENT in the container FlsDemEventParameterRefs when 
the parameter FlsInterruptConsistencyCheck is configured as true. 
 
ERR092036: 
If 
the 
parameter 
FlsWriteVerify 
is 
configured 
as 
FLS_INIT_ONLY 
or 
FLS_INIT_AND_RUNTIME, 
then 
the 
parameter 
'FLS_E_REG_WRITE_VERIFY' in the container FlsDemEventParameterRefs 
should be configured. 
 
This  error  will  occur  if  no  reference  path  is  provided  for  the  DEM  parameter 
FLS_E_REG_WRITE_VERIFY  in  the  container  FlsDemEventParameterRefs 
when the parameter FlsUseWVErrorInterface is configured as true. 
 
ERR092037:  FlsWriteVerifyErrorInterface  parameter  should  have  a  value 
when the parameter FlsUseWVErrorInterface is configured as true. 
 
 
27 

 
 
 
 
 
 
 
      Chapter 8 
   Messages                                                                                           
This  error  will  occur,  if  the  parameter  FlsWriteVerifyErrorInterface  is  not 
configured when the parameters FlsWriteVerify is configured as FLS_INIT_ONLY 
or FLS_INIT_AND_RUNTIME and FlsUseWVErrorInterface is configured as true. 
 
ERR092038:  If  the  parameters  FlsUseInterrupts  and  FlsTimeoutMonitoring 
are  configured  as  true,  then  the  parameter  FlsTimeOutCountValue  in  the 
container FlsConfigSet should have a value. 
 
This  error  will  occur  if  the  FlsTimeOutCountValue  is  not  configured  when  the 
parameters  FlsUseInterrupts  and  FlsTimeoutMonitoring  in  the  container 
FlsGeneral is configured as true. 
 
ERR092039:  The  value  configured  for  the  parameter  FlsCallCycle  in  the 
container  FlsConfigSet  should  be  same  across  the  multiple  configuration 
set. 
 
This  error  occurs,  if  the  value  configured  for  the  parameter  FlsCallCycle  is  not 
same across the multiple configuration set of FlsConfigSet. 
 
ERR092040: The value configured for the parameter FlsTimeOutCountValue 
in  the  container  FlsConfigSet  should  be  same  across  the  multiple 
configuration set. 
 
This 
error 
occurs, 
if 
the 
value 
configured 
for 
the 
parameter 
FlsTimeOutCountValue  is  not  same  across  the  multiple  configuration  set  of 
FlsConfigSet. 
 
ERR092041: User shall not configure multiple sectors. Since data flash is a 
monolithic  on-chip  NV  memory  with  homogeneous  block  size,  it  is  not 
required to have multiple sectors with the same sector sizes. 
 
This  error  occurs,  if  more  than  one  "FlsSector"  is  configured  in  the  container 
FlsConfigSet. 
 
 
8.2  Warning Messages 
                                              None 
 
 
 
8.3  Information Messages 
 
INF092001: The parameter 'parameter name' in the container 
‘FlsConfigSet' is not configured. 
 
This information occurs, if the parameters FlsJobEndNotification or 
FlsJobErrorNotification or FlsEccSedNotification or FlsEccDedNotification in the 
container FlsConfigSet are not configured or configured with NULL or NULL_PTR. 
 
 
 
 
28 

Notes  
  Chapter 9 
 
Chapter 9  Notes 
 
 
 
“Generation Tool” and “Tool” terminologies are used interchangeably to refer 
FLS Driver Generation Tool. 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29 

 
 
 
 
 
 
 
      Chapter 9 
       Notes 
 
 
30 

 
 
Revision History 
 
 
 
Sl.No.  Description 
Version 
Date 
1. 
Initial Version 
1.0.0 
29-Oct-2013 
2. 
Following changes are made: 
1.0.1 
28-Jan-2014 
• 
Error messages ERR092010, ERR092018, ERR092029, 
ERR092030 and ERR092031 are added. 
• 
Error message ERR092007is updated. 
3. 
Following changes are made: 
1.0.2 
2-Sep-2014 
• 
FlsUseInterrupts parameter is added in FlsGeneral container 
in error message ERR092004 in section 8.1. Error Messages 
• 
FlsSuspendTime parameter is added in 
FlsPublishedInformation container in error message 
ERR092004 in section 8.1.1. Error Messages. 
• 
FlsBlankCheckApi, FlsReadImmediateApi, FlsSuspendApi 
and FlsResumeApi parameters are added in FlsDataFlash 
container in error message ERR092004 in section 8.1.1. 
Error Messages. 
• 
Error messages ERR092008, ERR092009 and ERR092010 
are deleted and error message ERR092018 is updated in 
section 8.1 Error Messages. 

The following changes are made: 
1.0.3 
24-Apr-2015 
• 
PDF name and version are updated in  Section 2.1 
• 
Added parameters FlsCancelTime and FlsCFCancelTime in 
the list of mandatory parameters in Section 8.1.  
• 
The description of error ERR092029 is updated in Section 
8.1. 
• 
Updated version number and copyright year. 

The following changes are made: 
1.0.4 
15-Feb-2016 
• 
Updated Abbreviations and Acronyms section to include FACI 
and FCU. 
• 
Removed fcl_cfg.h, fdl_descriptor.h, fcl_descriptor.h details 
and references from Chapter 1, Chapter 3 and 5.  
• 
FLS_E_REG_WRITE_VERIFY is added to the existing Dem 
parameter list. 
• 
FlsAccess, FlsSectorOption and CODE FLASH related 
parameters and container details are removed from 
ERR092004 in Section 8.1. 
• 
Error messages and Information messages for the 
parameters FlsAccess and FlsSectorOption are removed 
from section 8.1 and 8.3 respectively.  
• 
Error message ERR092032 is added and ERR092014, 
ERR092021, ERR092022, ERR092024, ERR092025, 
ERR092026, ERR092030 and ERR092031 are removed 
• 
Information messages INF092002, INF092003, INF092004 
and INF092005 related to FlsAccess and FlsSectorOption 
parameters are removed. 
• 
Error Messages ERR092032 and ERR092034 are added. 
• 
Updated Chapters 3, 4, 5 and 6 for RUCG tool and DLL file. 
• 
Added FLS_E_ECC_FAILED in the parameter name of 
ERR092019. 
• 
Added the parameter ‘FlsFaciEccCheck’ in the parameter 
name of ERR092004. 
• 
Error message ERR092035, ERR092036, ERR092037, 
ERR092038, ERR092039, ERR092040 are added 
• 
Modified ERR092004, ERR092012 and ERR092019 
• 
Publication date and copyright updated 
 
31 

 
 
 
 
 
 
 
Sl.No.  Description 
Version 
Date 
6. 
The following changes are made: 
1.0.5 
24-Mar-2016 
• 
Added R number at end of the document. 
• 
Renamed FlsDFTotalSize in ERR092004 to 
FlsDataFlashSize. 
• 
Updated section 2.1 Reference Documents to correct the 
version of parameter definition files. 
7. 
The following changes are made: 
1.0.6 
16-Jul-2016 
• 
Updated section 2.1 Reference Documents to correct the file 
name and version of parameter definition files. 
• 
Updated R Number                                                                      
• 
Removed not used mandatory parameters from section 8.1 
8. 
The following changes are made: 
1.0.7 
19-Sep-2016 
• 
Error message ERR092041 is added in section 8.1 
• 
Table headers are added 
• 
Info message INF092001 is updated.  
9. 
The following changes are made: 
1.0.8 
13-Feb-2017 
• 
Abbreviation  and Acronyms list is updated. 
• 
Updated Section 2.1 for Document versions. 
• 
Table headers are updated in section 8.1 to specify correct 
ERR Ids. 
• 
Updated R Number. 
• 
Updated notice, address and copyright information’s. 
• 
Error message ERR092033 is added in section 8.1. 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
AUTOSAR MCAL R4.0.3 User's Manual 
FLS Driver Component Ver.1.0.8 
Generation Tool User's Manual 
 
Publication Date: Rev.1.01, February 13, 2017 
 
 
Published by: Renesas Electronics Corporation 
 



 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
SALES  OFFICES 
 
http://www.renesas.com 
 
Refer  to "http://www.renesas.com/" for the latest  and  detailed  information. 
Renesas Electronics America Inc. 
2801 Scott Boulevard Santa Clara, CA 95050-2549, U.S.A. 
Tel: +1-408-588-6000, Fax: +1-408-588-6130 
Renesas Electronics Canada Limited 
9251 Yonge Street, Suite 8309 Richmond Hill, Ontario Canada L4C 9T3 
Tel: +1-905-237-2004 
Renesas Electronics Europe Limited 
Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, U.K 
Tel: +44-1628-585-100, Fax: +44-1628-585-900 
Renesas Electronics Europe GmbH 
Arcadiastrasse 10, 40472 Düsseldorf, Germany 
Tel: +49-211-6503-0, Fax: +49-211-6503-1327 
Renesas Electronics (China) Co., Ltd. 
Room 1709, Quantum Plaza, No.27 ZhiChunLu Haidian District, Beijing 100191, P.R.China 
Tel: +86-10-8235-1155, Fax: +86-10-8235-7679 
Renesas Electronics (Shanghai) Co., Ltd. 
Unit 301, Tower A, Central Towers, 555 Langao Road, Putuo District, Shanghai, P. R. China 200333 
Tel: +86-21-2226-0888, Fax: +86-21-2226-0999 
Renesas Electronics Hong Kong Limited 
Unit 1601-1611, 16/F., Tower 2, Grand Century Place, 193 Prince Edward Road West, Mongkok, Kowloon, Hong Kong 
Tel: +852-2265-6688, Fax: +852 2886-9022 
Renesas Electronics Taiwan Co., Ltd. 
13F, No. 363, Fu Shing North Road, Taipei 10543, Taiwan 
Tel: +886-2-8175-9600, Fax: +886 2-8175-9670 
Renesas Electronics Singapore Pte. Ltd. 
80 Bendemeer Road, Unit #06-02 Hyflux Innovation Centre, Singapore 339949 
Tel: +65-6213-0200, Fax: +65-6213-0300 
Renesas Electronics Malaysia Sdn.Bhd. 
Unit 1207, Block B, Menara Amcorp, Amcorp Trade Centre, No. 18, Jln Persiaran Barat, 46050 Petaling Jaya, Selangor Darul Ehsan, Malaysia 
Tel: +60-3-7955-9390, Fax: +60-3-7955-9510 
Renesas Electronics India Pvt. Ltd. 
No.777C, 100 Feet Road, HAL II Stage, Indiranagar, Bangalore, India 
Tel: +91-80-67208700, Fax: +91-80-67208777 
Renesas Electronics Korea Co., Ltd. 
12F., 234 Teheran-ro, Gangnam-Gu, Seoul, 135-080, Korea 
Tel: +82-2-558-3737, Fax: +82-2-558-5141 
 
 
 
 
 
© 2006-2017 Renesas  Electronics  Corporation.  All rights reserved. 
Colophon  4.1 
 



 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
AUTOSAR MCAL R4.0.3 
 
User’s Manual 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
R20UT3711EJ0101 
 
 
 

Document Outline


9 - R20UT3754EJ0101-AUTOSAR

RUCG Tool User's Manual

11 - R20UT3754EJ0101-AUTOSARs




 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
RUCG Tool 
User’s Manual 
 
 
 
 
 
 
 
Version 1.1.3 
 
 
 
 
 
Target Device: 
RH850/P1M 
 
 
 
 
 
 
 
 
 
 
 
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). 
 
 
 
 
 
 
 
 
www.renesas.com 
Rev.1.01 Feb 2017 
 
 

 
 

 

 
 
 
 
 
Notice 
1. 
Descriptions of circuits, software and other related information in this document are provided only to illustrate the operation 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 disputes 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, drawing, chart, program, algorithm, 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 otherwise misappropriate 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, copy or otherwise misappropriation of Renesas Electronics products. 
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; and 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. 
Renesas Electronics products are neither intended nor 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 damages (space and 
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 third parties arising from the use of any Renesas Electronics 
product for which the product is not intended by Renesas Electronics. 
6. 
When using the 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 radiation 
characteristics, installation, etc. Renesas Electronics disclaims any and all liability for any malfunctions or failure or accident arising out of 
the use of Renesas Electronics products beyond 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. Further, Renesas 
Electronics products are not subject to radiation resistance design. Please ensure to implement safety measures to guard them against the 
possibility of bodily injury, injury or damage caused by fire, and social damage in the event of 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 by your own responsibility as warranty for your 
products/system. Because the evaluation of microcomputer software alone is very difficult and not practical, please evaluate 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. Please investigate applicable laws and regulations that regulate the inclusion or use of controlled substances, 
including without limitation, the EU RoHS Directive carefully and sufficiently and use 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 not use Renesas Electronics products or 
technologies for (1) any purpose relating to the development, design, manufacture, use, stockpiling, etc., of weapons of mass destruction, 
such as nuclear weapons, chemical weapons, or biological weapons, or missiles (including unmanned aerial vehicles (UAVs)) for delivering 
such weapons, (2) any purpose relating to the development, design, manufacture, or use of conventional weapons, or (3) any other purpose of 
disturbing international peace and security, and you shall not sell, export, lease, transfer, or release Renesas Electronics products or 
technologies to any third party whether directly or indirectly with knowledge or reason to know that the third party or any other party will 
engage in the activities described above. When exporting, selling, transferring, etc., Renesas Electronics products or technologies, you shall 
comply with any applicable export control laws and regulations promulgated and administered by the governments of the countries asserting 
jurisdiction over the parties or transactions. 
10.  Please acknowledge and agree that you shall bear all the losses and damages which are incurred from the misuse or violation of the terms and 
conditions described in this document, including this notice, and hold Renesas Electronics harmless, if such misuse or violation results from 
your resale or making Renesas Electronics products available any third party. 
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 majority-owned 
subsidiaries. 
(Note 2)   "Renesas Electronics product(s)" means any product developed or manufactured by or for Renesas Electronics

 

 

 
 
 

 
 
 
Abbreviations and Acronyms 
 
 
 
Abbreviation / Acronym 
Description 
ARXML/arxml 
AUTOSAR xml 
AUTOSAR 
AUTomotive Open System Architecture 
BSWMDT 
Basic Software Module Description Template 
<MSN> 
Module Short Name 
ECU 
Electronic Control Unit 
DMA 
Direct Memory Access 
ECU 
Electronic Control Unit 
MCAL 
Microcontroller Abstraction Layer 
MCU 
Microcontroller Unit 
XML 
eXtensible Mark-up Language 
DLL 
Dynamic Linking Library 
 
 
 
Definitions 
 
 
 
Terminology 
Description 
.arxml 
AUTOSAR XML File. 
.trxml 
Translation XML File. 
PerlCtrl 
The utility converts a Perl program into an ActiveX control. 

 

 

 

 
Table of Contents 
 
Chapter 1 Introduction .........................................................................9 
1.1 
Document Overview ............................................................................................................... 9 
Chapter 2 Reference ........................................................................... 11 
2.1. 
Reference Documents.......................................................................................................... 11 
2.2. 
Trademark Notice ................................................................................................................ 11 
Chapter 3 Tool Overview ..................................................................... 13 
3.1 
Usage..................................................................................................................................... 13 
Chapter 4 Input Files .......................................................................... 17 
4.1 
Msn Control DLL .................................................................................................................. 17 
4.2 
ECU Configuration Description File(s) .............................................................................. 17 
4.3 
BSWMDT File ........................................................................................................................ 17 
4.4 
Translation XML File ............................................................................................................ 18 
4.4.1 

Translation Header File ............................................................................................. 18 
4.4.2 
Device Specific Header File ...................................................................................... 18 
4.5 
Configuration XML File ........................................................................................................ 19 
4.6 
Other Description Files........................................................................................................ 19 
Chapter 5 Output Files ....................................................................... 21 
Chapter 6 Precautions ........................................................................ 23 
Chapter 7 User Configuration Validation .......................................... 25 
Chapter 8 Messages ........................................................................... 27 
8.1. 
RUCG Tool Messages .......................................................................................................... 27 
8.1.1 

Error Messages ......................................................................................................... 27 
8.1.2 
Warning Messages ................................................................................................... 28 
8.1.3 
Information Messages ............................................................................................... 28 
8.2. 
Common Messages ............................................................................................................. 28 
8.2.1 

Error Messages ......................................................................................................... 28 
8.2.2 
Warning Messages ................................................................................................... 31 
8.2.3 
Information Messages ............................................................................................... 31 
8.3. 
R3.2.2 Messages .................................................................................................................. 31 
8.3.1 
Error Messages ......................................................................................................... 32 
8.3.2 
Warning Messages ................................................................................................... 32 
8.3.3 
Information Messages ............................................................................................... 32 
8.4. 
R4.0.3 Messages .................................................................................................................. 32 
8.4.1 

Error Messages ......................................................................................................... 32 
8.4.2 
Warning Messages ................................................................................................... 33 
8.4.3 
Information Messages ............................................................................................... 33 
Chapter 9 Notes .................................................................................. 35 
Chapter 10 Appendix .......................................................................... 37 

 

 
List of Figures 
 
Figure 3.1 Tool Overview ........................................................................................................................ 13 
 
 
 
 
 
List of Tables 
 

Table 1.1 Document Overview .................................................................................................................. 9 
Table 2.1 Reference Documents .............................................................................................................. 11 
Table 3.1 Options and Description ........................................................................................................ 14 
Table 8.1 R3.2.2 BSWMDT Mandatory Parameters .............................................................................. 32 
Table 8.2 R4.0.3 BSWMDT Mandatory Parameters .............................................................................. 33 
 
 

 

Introduction                                                                                                                                    Chapter 1 
Chapter 1  
Introduction 
 
 
 
 
The document describes the features of the RUCG Tool.  
 
RUCG Tool is a command line tool that extracts information from ECU 
Configuration Description File(s) and generates Driver C source and C header 
files. 
 
This document contains information on the options, input and output files of the 
RUCG Tool. In addition, this manual covers a step-by-step procedure for the 
usage of tool. 
 
 
 
 
 
1.1 
Document Overview 
 
 
This user manual is organized as given in the table below: 
 
 
 
Table 1.1 Document Overview 
Section 
Contents 
Section 1 (Introduction) 
Provides an introduction to the document and explains how 
information is organized in this manual. 
Section 2 (Reference) 
Provides a list of documents referred while developing this 
document. 
Section 3 (RUCG Tool 
Provides the component overview of RUCG. 
Overview) 
Section 4 (Input Files) 
Provides information about all the input files supplied to 
Tool. 
Section 5 (Output Files) 
Explains the output files that are generated by the RUCG Tool. 
Section 6 (Precautions) 
Contains precautions to be taken during execution of 
RUCG Tool. 
Section 7 (User Configuration  Describes about user configuration validation done by the RUCG 
Validation) 
Tool. 
Section 8 (Messages) 
Describes all the Error/Warning/Information messages that 
help the user to understand the probable reason for the 
same. 
Section 9 (Notes) 
Provides notes to help the user to understand this document 
better. 
Section 10(Appendix) 
Provides additional information, if any. 

 

Chapter 1                                                                                                                                    Introduction 
 
 
10 
 

Reference                                                                                                                              Chapter 2 
Chapter 2  
Reference 
 
 
 
 
2.1. 
Reference Documents 
 
 
The following table lists the documents referred to develop this document: 
 
 
 
Table 2.1 Reference Documents 
Sl.No.  Title 
Version 
1. 
EAAR-RS-0089.pdf 
1.1.0 
2. 
GettingStarted_MCAL_Drivers_X1x.pdf 
1.0.6 
 
 
 
 
 
2.2. 
Trademark Notice 
 
 
Microsoft and Windows are trademarks/registered trademarks of Microsoft 
Corporation. 
11 
 

Chapter 2                                                                                                                              Reference 
 
 
12 
 


Tool Overview                                                                                                                       Chapter 3 
Chapter 3   Tool Overview 
 
 
 
RUCG Tool is a command line tool that provides scalability and 
configurability for the component. It accepts Module Specific DLL, ECU 
Configuration Description File(s), BSWMDT File, Translation XML File and 
Configuration XML File as input and generates the C Header and C 
Source files. However Configuration XML File is optional. 
 
RUCG Tool is a standalone windows executable. The Tool can run without 
any additional dependencies. 
 
Operating Environment:  
Operating System 
Windows 7 Professional SP1 64 bit 
RAM 
8 GB 
 
RUCG Tool doesn’t support parallel execution. 
 
Figure 3.1 Tool Overview 
For more information about input files to be given to the RUCG tool 
refer section “4 Input Files”. 
 
For more information about output files generated by the RUCG tool 
refer section “5 Output Files”. 
 
3.1  Usage 
 
This section provides the information regarding usage of the RUCG 
Tool. It also provides the syntax of the command line arguments 
(input filenames and options). 
RUCG Tool executable is invoked as shown below. 
 
RUCG.exe <DLL Path> [<Options>] {<Input Filename>} 
 

13 
 

Chapter 3                                                                                                                       Tool Overview 
 
Where, 
 
RUCG.exe: RUCG Tool Executable 
DLL Path: Module specific DLL file path 
Options: [-H/-Help -C/-Config -O/-Output -Osrc -Oinc -L/-Log –F/-
FILVERSION -D/-Dryrun –T/-TimeOut] 
Input Filename: {ECU Configuration Description File(s), BSWMDT 
File, Translation XML File [optional] and Configuration XML File 
[optional]} 
 
Notations: 
{data} represents compulsory data 
<data> represents the actual data that will be specified on command 
line during tool usage. 
[data] represents optional data. 
 
 
 
Table 3.1 Options and Description 
Options 
Description 
-H/-Help 
To display help regarding usage of the tool. Gets the highest priority when 
used with other options. 
-C/-Config 
To execute tool with the options provided in the Configuration XML File. 
Command line options get the higher priority than the options provided in 
Configuration XML File. 
-O/-Output 
By default, the tool generates output files in the  
“<Msn>_Output” folder in the path where DLL is present. The user can use 
the -O option followed by the folder name, to generate the output files in the 
specified folder. Either absolute path or relative path can be provided to 
specify the folder name.  
The C Source and C Header files are generated in the sub folders “src‟ and 
“inc‟ within the output folder. 
-Osrc 
The user can use the -Osrc option followed by the folder name, to generate 
the C Source files in the specified folder. 
-Oinc 
The user can use the -Oinc option followed by the folder name, to generate 
the C Header files in the specified folder. 
–L/-Log 
To log the output to the <Msn>.log file in the output folder. 
-D/-Dryrun 
To execute tool in validation mode. The tool will not generate output files even 
though the input file provided is error free. 
-F/-FILEVERSION  To display the perl file version which are used to create the DLL. 
-T/-TimeOut 
The user can use the –TimeOut option followed by the timeout value, to set 
the maximum timeout for underlying DLL execution. Default timeout value is 
10 seconds. Timeout value should be in the range of 1 – 60 seconds. 
 
Remark   
  If the “-H/-Help” option is provided on the command line without any 
other inputs, RUCG Tool help is displayed. 
14 
 

Tool Overview                                                                                                                       Chapter 3 
  If the “-H/-Help” option is provided with DLL path, module specific 
DLL help is displayed. 
  If Translation XML File is not provided on the command line then 
"<Msn>_X1x.trxml" which is present in the same location of DLL is 
considered as "default" Translation XML File by the RUCG Tool. 
  If Configuration XML File is not provided on the command line then 
"<Msn>_X1x.cfgxml" which is present in the same location of DLL is 
considered as "default" Configuration XML File by the RUCG Tool. 
  The RUCG tool doesn’t allow parallel execution. 
  The RUCG tool returns its execution status to the user through the 
console. User can get this tool return status using the environment 
variable %ERRORLEVEL%.
15 
 

Chapter 3                                                                                                                       Tool Overview 
 
 
 
16 
 

Input Files                                                                                                                             Chapter 4 
Chapter 4   Input Files 
 
 
RUCG Tool accepts the following files as inputs to generate output files. 
 
 
4.1  Msn Control DLL 
 
Module specific DLL File can be generated using PerlCtrl utility from the 
perl scripts. The Perl script contains implementation of generating 
configuration output files with PerlCtrl template. PerlCtrl accepts the perl 
scripts and generates module specific DLL. For the PerlCtrl template 
contents, refer Chapter "10 Appendix". 
 
4.2  ECU Configuration Description File(s) 
 
The ECU Configuration Description file is in XML format, which contains 
the configured values for Parameters, Containers and Modules. ECU 
Configuration Description XML File format will be compliant with the 
AUTOSAR ECU specification standards. ECU Configuration Description 
File can be created or edited using ECU Configuration Editor. 
  
4.3  BSWMDT File  
 
The BSWMDT File in XML format, which is the template for the Basic 
Software Module Description. BSWMDT File format will be compliant with 
the AUTOSAR BSWMDT specification standards. 
 
RUCG Tool uses "Common Published Information" from module specific 
BSWMDT file. BSWMDT file should not be updated manually since it is 
"Static Configuration" file. 
 
The required elements from BSWMDT File by module specific Generation 
Tool is as follows: 
 
BSW-MODULE-DESCRIPTION 
• MODULE-ID 
 
BSW-IMPLEMENTATION 
• SW-VERSION 
• VENDOR-ID 
• AR-RELEASE-VERSION 
• VENDOR-API-INFIX 
 
In case of multiple driver support implementation, VENDOR-API-INFIX is 
mandatory. In case of single driver support implementation, VENDOR-
API- INFIX is not used. 
17 
 

Chapter 4                                                                                                                             Input Files 
 
 
 
4.4  Translation XML File 
 
Translation XML File is in XML format which contains translation and 
device specific header file path. For the syntax of the contents of 
Translation XML File, please refer the Chapter 10 Appendix. 
If mapped device specific address label is changed/updated then only 
respective mapping in Translation Header File needs to be updated. In 
this case there will not be any impact on Generation Tool for the 
generation of address in tool generated output file(s). 
 
4.4.1  Translation Header File 
 
This file is look-up table (mapping in the form of definitions) for the device 
specific address labels. Based on the configuration in ECU Configuration 
Description File, the mapped device specific address labels will be 
searched in Device Specific Header File by RUCG Tool to generate 
associated address in tool generated output file(s). For the Translation 
Header File path, the value of "<Msn>DeviceName" parameter from the 
container "<Msn>General" container should be present as child tag of 
TRANSLATION-FILE-PATH in Translation XML File. Both "Absolute" and 
"Relative" paths are supported by generation tool however default path is 
"Relative" path. 
 
E.g. 
<TRANSLATION-FILE-PATH> 
<Value_Of_MsnDeviceName>..\DF_Timer.h ..\DF_Timer_ISR.h</ 
Value_Of_MsnDeviceName> 
</TRANSLATION-FILE-PATH> 
 
4.4.2  Device Specific Header File  
 
This file contains device specific labels and associated address. Based on 
the configuration in ECU Configuration Description File, the mapped 
device specific address labels will be used to generate associated 
address in tool generated output file(s). For the Device Specific Header 
File path, the value of “<Msn>DeviceName” parameter from the container 
“<Msn>General” container should be present as child tag of DEVICE-
FILE-PATH in Translation XML File. Both “Absolute” and “Relative” paths 
are supported by generation tool however default path is “Relative” path.  
 
If multiple Device Specific Header Files need to be provided for the same 
device (value of “<Msn>DeviceName” parameter) in Translation XML File, 
then each Device Specific Header File path should be separated with 
“space”.  
18 
 

Input Files                                                                                                                             Chapter 4 
 
 
E.g.  
<DEVICE-FILE-PATH>  
<Value_Of_MsnDeviceName>..\DF_Timer.h ..\DF_Timer_ISR.h</ 
Value_Of_MsnDeviceName>  
</DEVICE-FILE-PATH>  
4.5  Configuration XML File  
 
Configuration XML File is in XML format which contains command line 
options and input/output path. For the syntax of the contents of 
Configuration XML File, please refer the Chapter 10 Appendix. 
E.g. 
<LOG>ON/OFF</LOG> 
<HELP>ON/OFF</HELP> 
 
4.6  Other Description Files 
 
RUCG Tool requires other description files (i.e. Dem File and MCU File) 
inputs, depends on the corresponding parameter configuration in the ECU 
Configuration Description File 
19 
 

Chapter 4                                                                                                                             Input Files 
 
 
 
20 
 

Output Files                                                                                                                          Chapter 5 
Chapter 5  
Output Files 
 
 
RUCG Tool is a command line tool that provides scalability and 
configurability for Msn Driver component. It accepts inputs which 
mentioned in the Chapter 4 Input Files and generates configuration details 
in C Header and C Source files (<Msn>_Cfg.h, <Msn>_Cbk.h, 
<Msn>_Lcfg.c and <Msn>_PBcfg.c). 
 
<Msn>_Cfg.h 
This file contains pre-compile configuration parameters. 
 
<Msn>_Cbk.h 
This file contains prototype declarations for callback notification functions. 
 
<Msn>_Lcfg.c 
This file contains link-time parameters. 
 
<Msn>_PBcfg.c 
This file contains post-build configuration data. 
 
Log File 
The file which briefs the execution details of RUCG Tool. 
 
 
Remark: Output files generated by Msn Driver Generation Tool should not be modified or 
edited manually 
21 
 

Chapter 5                                                                                                                          Output Files 
 
 
 
22 
 

Precautions                                                                                                                           Chapter 6 
Chapter 6  
Precautions 
 
 
 
 
• 
Module Specific DLL must be created by using PerlCtrl with the 
PerlCtrl template which specified in this document. For the PerlCtrl 
template contents, refer Chapter "10 Appendix". 
 
• 
ECU Configuration Description File and BSWMDT File must comply 
with AUTOSAR standard for R4.0 ECU Configuration Description File 
and BSWMDT File respectively. 
 
• 
Default Translation XML File (<Msn>_Xx4.trxml) must be present in 
same location of DLL file. 
 
• 
Default Configuration XML File (<Msn>_Xx4.cfgxml) must be present in 
same location of DLL file. 
 
• 
If  Translation  XML  File  is  not  provided  on  the  command  line, 
<msn>_Xx4.trxml  which  is  present  in  same  location  of  DLL  file  is 
considered as ‘default’ Translation XML File. 
 
• 
If Configuration XML File is not provided on the command line, 
Msn_Xx4.cfgxml which is present in same location of DLL file is 
considered as ‘default’ Configuration XML File. 
 
• 
ECU Configuration Description File(s) should contain the file 
extension ‘.arxml’. 
 
• 
Translation XML File should contain the file extension ‘.trxml’. 
 
• 
Configuration XML File should contain the file extension ‘.cfgxml’. 
 
• 
If the output files generated by RUCG Tool are modified externally, 
then they may lead to error while compilation or not produce the 
expected results. 
 
 
 
23 
 

Chapter 6                                                                                                                            Precautions 
 
 
 
24 
 

User Configuration Validation                                                                                             Chapter 7 
Chapter 7  
User Configuration Validation 
 
 
 
 
This section provides help to analyze the error, warning and information 
messages displayed during the execution of RUCG Tool. It ensures 
conformance of input file with syntax and semantics. It also performs 
validation on the input file for correctness of the data. 
 
 
For more details on list of Error/Warning/Information messages that are 
displayed as a result of input file(s) validation, refer Chapter “8 
Messages”. 
 
 
The RUCG Tool displays error or warning or information messages when 
the user has configured incorrect inputs. There are two types of messages 
displayed, 
 
RUCG Tool generated messages 
Module Specific DLL generated messages 
 
The format of RUCG Tool generated message is as shown below. 
 
• 
CGERR/CGINF/CGWAR<xx><yy>: 
<Error/Warning/Information Message>. 
<xx>: Stage of error happen 
<yy>: Actual error code 
 
The format of Module Specific DLL generated messages is as shown 
below. 
 
• 
ERR/WRN/INF<mid><xxx>: <Error/Warning/Information 
Message>. where, 
<mid>: 123 - MSN Driver Module id (123) for user configuration checks. 
 
000 - for command line checks. 
 
<xxx>: 001-999 - Message id. 
 
• 
File Name: Name of the file in which the error has occurred 
 
• 
Path: Absolute path of the container in which the parameter is present. 
 
‘File Name’ and ‘Path’ need not be present for all 
Error/Warning/Information messages. 
25 
 

Chapter 7                                                                                             User Configuration Validation 
 
 
26 
 

Messages                                                                                                                              Chapter 8 
Chapter 8  
Messages 
 
 
The messages help to identify the syntax or semantic errors in the inputs 
supplied to execution.  
The following section gives the list of error, warning and information 
messages displayed during the tool execution. 
When the tool detects the following errors, it will automatically exit after 
showing the error message. 
 
8.1. 
RUCG Tool Messages 
 
This section contains the list of error/warning/information messages which 
is generated by the RUCG tool. 
8.1.1  Error Messages 
 
CG_ERR0001: Another instance is already running. 
This error occurs, if trying to run more than one instance of application in 
parallel. 
 
CG_ERR0002: First argument should be a module specific DLL file 
path. 
This error occurs, if the specified first file argument does not have 
extension (.dll or .ocx). 
 
CG_ERR0003: DLL not found on specified path. 
This error occurs, if the specified DLL file input is not found in the 
specified location. 
 
CG_ERR0004: Specified module specific DLL file is not DLL 
executable. 
This error occurs, if the specified DLL file is not a windows executable 
DLL. 
 
CG_ERR0101: Please provide valid number of arguments. 
This error will occur, if the no option is provided in the command line.  
 
CG_ERR0102: Please provide valid time out value in seconds (1 - 60). 
This error occurs, if the specified timeout value is invalid or out of range. 
 
CG_ERR0301: DLL activation context creation failed. 
This error occurs, if the generated manifest file for the specified DLL is 
wrong. Ensure the manifest file write implementation in the RUCG Tool. 
 
CG_ERR0302: Specified DLL implemented using wrong PerlCtrl 
template. 
This error occurs, if the specified DLL file is created using wrong Control ID 
in PerlCtrl template. For the PerlCtrl template contents, refer Chapter "10 
Appendix". 
 
CG_ERR0303: DLL directory should be write-enabled. 
This error occurs, if the specified DLL file path is write protected. 
 
CG_ERR0401: Code generation is not completed within the time out. 
This error occurs, if the specified DLL does not return within a default or 
specified timeout. 
 
27 
 

Chapter 8                                                                                                                              Messages 
Note: When Code Generation is terminated due to timeout, the RUCG Tool 
drops a temporary file (GLOB(0x2a8d104)) in the execution location. Please 
delete the file after the execution. 
 
CG_ERR0402: Cannot find implementation of method "execution” in 
the DLL. 
This error will occur, if the specified DLL created without entry function call 
"execute". 
 
CG_ERR0403: Error occurred while code generation. 
This error will occur, when the specified DLL calls “exit” function while its 
execution. In the tool code implementation, general assumption is “exit” 
function in the perl script should called only at the erroneous conditions.  
  
8.1.2  Warning Messages 
 
None 
 
8.1.3  Information Messages 
 
CG_INF0001: Tool Version 
 
This is to display Tool Version for each execution of the tool. 
 
CG_INF0002: Module DLL Path 
This is to display parsed Module DLL Path from the command line 
arguments. 
 
CG_INF0003: <RUCG Tool Usage Information> 
This is to display usage information of the tool. 
 
CG_INF0004: Execution terminated due to parallel execution errors. 
This information will occur, if the execution is terminated due to parallel 
execution. 
 
CG_INF0005: Execution terminated due to command line errors. 
This information will occur, if the execution is terminated due to command 
line errors. 
 
CG_INF0006: Execution terminated due to the previous errors. 
This information will occur, if the error happened during the DLL execution. 
 
CG_INF0007: Code generation completed successfully. 
This information will occur, if the tool execution completed successfully. 
 
8.2. 
Common Messages 
 
This section contains the list of error/warning/information messages which 
is common for AUTOSAR Renesas R3.2.2 and R4.0.3 X1x MCAL Driver 
module that will be generated during the Module Specific DLL execution. 
 
8.2.1  Error Messages 
 
ERR000001: File <File_Name> does not exist. 
This error occurs, if the input <File_Name> is not found. 
 
ERR000002: Name of the Generation Tool Configuration XML File is 

28 
 

Messages                                                                                                                              Chapter 8 
not given along with <-C/-CONFIG> option. 
This error occurs, if the name of the Generation Tool Configuration XML File 
is not given along with <-C/-CONFIG> option. 
 
ERR000003: File <File name> is not as per XML standard. 
 
This error will occur, if the input <File name> is not as per XML standard. 
 
ERR000004: Cannot open the <Log file name> file. 
 
This error will occur, if unable to open the <Log file name> file. 
 
ERR000005: Name of output directory is not given along with <-O/- 
OUTPUT> option. 
 
This error will occur, if the output directory name is not given along with <-
O/- OUTPUT> option. 
 
ERR000006: Name of output directory is not given in OUTPUT-PATH 
tag in <File name>. 
 
This error will occur, if the output directory is not given in OUTPUT-PATH 
tag in configuration file. 
 
ERR000007: The Generation Tool expects inputs.  
This error will occur, if Only specified Module Specific DLL path in the 
command line without default configuration file. 
 
ERR000008: The option <option> is not supported by the Generation 
Tool. The Generation Tool supports <-O/-OUTPUT, -Osrc , -Oinc, -H/-
HELP, -L/-LOG, -C/-CONFIGFILE and -D/-DRYRUN>" options. 
 
This error will occur, if the invalid <option> is provided to the tool. 
 
ERR000009: Invalid output directory name <output directory name> as 
the file with same name exists. 
 
This error will occur, if the <output directory name> already exists. 
 
ERR000010: Invalid output directory name <output directory name> 
Directory name should not contain any of \*\?\"\|\: characters. 
 
This error will occur, if the <output directory name> path contains junk 
character. 
 
ERR000011: ECU Configuration Description File is not provided as 
input to the Generation Tool. 
 
This error will occur, if the ECU Configuration Description File is not given in 
the command line or in configuration file. 
 
ERR000012: The input <File name> is not as per XML standard. 
Provide the ECU Configuration Description File as input on the 
command line. 
 
This error will occur, if the ECU Configuration Description File is not as per 
XML standard. 
 
ERR000014: 'TRANSLATION-FILE-PATH' tag in <File name> is empty.  
This error will occur, if the translation <File name> doesn’t have  
“TRANSLATION-FILE-PATH‟ tags. 
 
ERR000015: The 'device_name' tag should be present as child of 
'TRANSLATION-FILE-PATH'' tag in <File name>. 
 
This error will occur, if the device mentioned in ECU Configuration 
Description File is not present in “TRANSLATION-FILE-PATH‟ tag in the 
<File name> 
 
ERR000016: ‘DEVICE-FILE-PATH’ tag in <File name> is empty.  
29 
 

Chapter 8                                                                                                                              Messages 
This error will occur, if the translation file <File name> doesn’t have 
“DEVICE- FILE-PATH‟ tags. 
 
ERR000017: The 'device_name’ tag should be present as child of 
‘DEVICE-FILE-PATH' tag in <File name>. 
 
This error will occur, if the device mentioned in ECU Configuration 
Description File is not present in “DEVICE-FILE-PATH‟ tag. 
 
ERR000018: Cannot create directory <output directory name>.  
This error will occur, if unable to create output directory <output directory 
name>. 
 
ERR000019: Cannot open <File name>.  
This error will occur, if unable to open <File name>. 
 
ERR000020: The macro label <macro label> should be unique in 
<translation file name> translation C Header File. 
 
This error will occur, if macro label is not unique in translation C Header 
File. 
 
ERR000021: The macro definition for <macro label> macro is not 
found in <translation file name> translation C Header File. The macro 
label format should be <label format>. 
 
This error will occur, if macro definition is not found in translation C Header 
File. 
 
ERR000022: The macro value for <macro label> macro is empty in 
<translation file name> translation C Header File. 
 
This error will occur, if macro label value is empty in translation C Header 
File. 
 
ERR000023: The macro definition for <macro value> macro is not 
found in input device specific C Header File(s). 
 
This error will occur, if macro definition is not found in input device specific 
C Header File(s). 
 
ERR000024: The macro value for <macro value> macro is empty in 
input device specific C Header File(s). 
 
This error will occur, if macro value is empty in input device specific C 
Header File(s). 
 
ERR000025: Path <Configured Reference Path> provided for Bsw 
Module is incorrect. 
 
This error will occur, if the reference provided for Bsw Module Component is 
incorrect. 
 
ERR000026: BSWMDT content is not present in the input file(s) for 
‘<Module Name>’ module. 
 
This error will occur, if the module specific BSWMDT content is not present 
in the input files. 
 
ERR000027: <MSN> BSWMDT File of either AUTOSAR R3.2 or R4.0 
should be given as input. 
 
This error will occur, if the both R3.2 and R4.0 BSWMDT file given to the 
input to the generation tool. 
 
ERR000028: 'MODULE-DESCRIPTION-REF' element should be present 
in the description file of '<Module Name>' module. 
 
This error will occur, if the MODULE-DESCRIPTION-REF element is not 
present module specific description file. 
30 
 

Messages                                                                                                                              Chapter 8 
 
ERR000029: AUTOSAR version of BSWMDT File and Module 
Description File is different. 
 
This error will occur, if the AUTOSAR version of the BSWMDT File and 
module description file is different. 
 
Remark  Apart from the above error codes DLL will generates some additional 
Module Specific errors during the execution. 
8.2.2  Warning Messages 
 
WRN000001: As per AUTOSAR ECU Configuration Description File 
naming convention, the file extension should be '.arxml' for file. 
 
This warning will occur, if ECU Configuration Description files having an 
extension other than ‟.arxml‟. 
 
8.2.3  Information Messages 
 
INF000001: DLL Version: 
 
This is to display DLL Version of specified module specific DLL. 
 
INF000002: Command line arguments:  
This is to display the DLL arguments received from the Tool. 
 
INF000003: The valid inputs are provided below.  
This information will occur, if the DLL option is not given. (I.e. only provide 
Module DLL Path as command line arguments) 
 
INF000004: Opened file <filename> at <time>.  
This information will occur, during opening the file. 
 
INF000005: Error(s) and Warning(s) detected.  
This information will display the number of errors and warnings. 
INF000006: Execution completed successfully.  
This information will occur, if the execution completed successfully. 
 
INF000007: Execution completed successfully with warnings. 
 
This information will occur, if the execution completed successfully with 
warnings. 
 
INF000008: Execution terminated due to command line errors.  
This information will occur, if the execution terminated due to command line 
errors. 
 
INF000009: Execution terminated due to error in the input file.  
This information will occur, if the execution terminated due to error in the 
input file. 
 
INF000010: Execution terminated due to error, during the structure 
generation in the output file. 
 
This information will occur, if the execution terminated during structure 
generation in output file. 
 
 
8.3. 
R3.2.2 Messages 
 
This section contains the list of error/warning/information messages which is 
specific to AUTOSAR Renesas R3.2.2 X1x MCAL Driver module that will be 
generated during the Module Specific DLL execution. 
31 
 

Chapter 8                                                                                                                              Messages 
 
8.3.1  Error Messages 
 
ERR000030: The 'parameter tag name' tag should be configured in 
BSWMDT File. 
 
This error will occur, if any of the configuration parameter(s) mentioned 
below is (are) not configured in BSWMDT File.  
 
The list of mandatory parameters with respect to container is listed below: 
 
Table 8.1 R3.2.2 BSWMDT Mandatory Parameters 
Container 
Parameters 
BswImplementation 
SW-MAJOR-VERSION 
 
SW-MINOR-VERSION 
 
SW-PATCH-VERSION 
 
AR-MAJOR-VERSION 
 
AR-MINOR-VERSION 
 
AR-PATCH-VERSION 
 
VendorApiInfix 
 
BswModuleDescription 
ModuleId 
 
 
 
Note: VendorApiInfix parameter is mandatory for only some modules. 

 
8.3.2  Warning Messages 
 
None. 
 
8.3.3  Information Messages 
 
None. 
 
8.4. 
R4.0.3 Messages 
 
 
This section contains the list of error/warning/information messages which is 
specific to AUTOSAR Renesas R4.0.3 X1x MCAL Driver module that will be 
generated during the Module Specific DLL execution. 
 
8.4.1  Error Messages 
 
ERR000030: The 'parameter tag name' tag should be configured in 
BSWMDT File. 
 
This error will occur, if any of the configuration parameter(s) mentioned 
below is (are) not configured in BSWMDT File.  
32 
 

Messages                                                                                                                              Chapter 8 
 
The list of mandatory parameters with respect to container is listed below: 
 
 
Table 8.2 R4.0.3 BSWMDT Mandatory Parameters 
Container 
Parameters 
BswImplementation 
SwVersion 
 
 
VendorId  
 
ArReleaseVersion  
 
VendorApiInfix  
 
BswModuleDescription  
ModuleId  
 
 
 
Note: VendorApiInfix parameter is mandatory for only some modules. 

 
8.4.2  Warning Messages 
 
None. 
 
8.4.3  Information Messages 
 
None. 
33 
 

Chapter 8                                                                                                                              Messages 
 
 
34 
 

Notes                                                                                                                                     Chapter 9 
Chapter 9  
Notes 
 
 
 
 
“Tool” terminology is used interchangeably to refer RUCG Tool. 
35 
 

Chapter 9                                                                                                                                    Notes 
 
36 
 

Appendix                                                                                                                             Chapter 10 
Chapter 10    Appendix 
 
 
•  Translation XML File 
 
 
Translation XML File content format shall be given as mentioned below: 
 
<?xml version="1.0" encoding="UTF-8"?> 
<!-- 
The tag PATH-DETAILS should not be renamed since it is top level 
element. 
--> 
<PATH-DETAILS> 
<!-- 
TRANSLATION-FILE-PATH should contain the path of the translation 
header file. The tag TRANSLATION-FILE-PATH should not be 
renamed. Only respective value should be updated for the translation 
header file. 
--> 
<TRANSLATION-FILE-PATH> 
<value_of_MsnDeviceName>Path</value_of_MsnDeviceName> 
</TRANSLATION-FILE-PATH> 
<!-- 
The tags present in DEVICE-FILE-PATH tag should contain the path 
of the device specific C Header File. 
The tags present in DEVICE-FILE-PATH should be equal to the value for 
parameter 
MsnDeviceName present in MsnGeneral container. The 
tag DEVICE-FILE-PATH should not be renamed. 
 
If multiple device header files need to provide for same device then 
each file name should be separated with space. 
--> 
<DEVICE-FILE-PATH> 
<value_of_MsnDeviceName>Path</value_of_MsnDeviceName> 
</DEVICE-FILE-PATH> 
</PATH-DETAILS> 
 
37 
 

Chapter 10                                                                                                                              Appendix 
 
•  Configuration XML File 
 
 
 
Configuration XML File content format shall be given as mentioned below: 
 
 
<?xml version=”1.0” encoding="UTF-8"?> 
--> 
<!-- 
None of the tag from this XML should be renamed or deleted. 
--> 
<XML> 
<!-- Supported Command Line options<OPTION> 
<!-- Only ON or OFF should be provided. --> 
<HELP>ON/OFF</HELP> 
 
 
<!-- Only ON or OFF should be provided. --> 
<LOG>ON/OFF</LOG> 
 
 
<!-- Only ON or OFF should be provided. --> 
<DRYRUN>ON/OFF</DRYRUN> 
 
 
<!-- Only ON or OFF should be provided. --> 
<OUTPUT>OFF</OUTPUT> 
 
 
<!-- Name of output directory --> 
<OUTPUT-PATH>Path</OUTPUT-PATH> 
</OPTION> 
 
 
<!-- To provide input files. If multiple input files need to be 
provided then each file should be separated with ",". --> 
<INPUT-FILE>Path</INPUT-FILE> 
</XML> 
 
 
38 
 

Appendix                                                                                                                             Chapter 10 
 
 
•  PerlCtrl Template 
 
Module Specific dll can be created by using PerlCtrl utility. PerlCtrl accepts 
the perl scripts which consists implementation of generating module specific 
configuration files with correct perlCtrl template. 
 
PerlCtrl Template content shall be given as mentioned below: 
 
=pod 
     
=begin PerlCtrl 
     
        %TypeLib = ( 
            PackageName     => 'MsnCtrl', 
            TypeLibGUID     => '{52093072-B5B3-413B-B4CF-
ACD3E3AAFE7A}', # do NOT edit this line 
            ControlGUID     => '{1D887D1B-E692-4F8B-8552-F6957BB8B834}', 
# do NOT edit this line either 
            DispInterfaceIID=> '{CFC0FF40-EAE4-49C8-8720-
850170DB1ADD}', # or this one 
            ControlName     => 'MsnVeryOwnControl', 
            ControlVer      => 1,  # increment if new object with same ProgID 
                                   # create new GUIDs as well 
            ProgID          => 'MsnCtrl.Control', 
            DefaultMethod   => 'main', 
            Methods         => { 
                'main' => { 
                        DocString           => "The main() method", 
                        HelpContext         => 10, 
                        RetType             =>  VT_I4, 
                        TotalParams         =>  1, 
                        NumOptionalParams   =>  0, 
                        ParamList           =>[ 'cmd_input' => VT_BSTR ] 
                    }, 
                },  # end of 'Methods' 
            Properties      => { 
                },  # end of 'Properties' 
            );  # end of %TypeLib 
     
=end PerlCtrl 
     
=cut 
 
39 
 

Chapter 10                                                                                                                              Appendix 
 
 
40 
 

 
Revision History 
 
 
 
Sl.No.  Description 
Version 
Date 

Initial Version 
1.0.0 
7-Nov-2015 

Section 3.1 and 8.1 are updated as per the new enhancement 
1.1.0 
12-Dec-2015 
feature requirements (EAAR_PN0089_FR_0018, 
EAAR_PN0089_FR_0019, EAAR_PN0089_NR_0010). 

Reference section is updated with correct document name. 
1.1.1 
7-Apr-2016 

R-Number corrected for the document 
1.1.2 
13-Jul-2016 

Following changes are made, 
1.1.3 
17-Feb-2017 
1. Updated notice and copyright information. 
2. Updated R Number. 
41 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
RUCG Tool User's Manual V1.1.3 
 
Publication Date: Rev.1.01, February 17, 2017 
 
Published by: Renesas Electronics Corporation 
 
 
 
 


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
SALES  OFFICES 
 
http://www.renesas.com 
Refer  to "http://www.renesas.com/" for the latest  and  de  tailed  information. 
Renesas Electronics America Inc. 
2801 Scott Boulevard Santa Clara, CA 95050-2549, U.S.A. 
Tel: +1-408-588-6000, Fax: +1-408-588-6130 
Renesas Electronics Canada Limited 
9251 Yonge Street, Suite 8309 Richmond Hill, Ontario Canada L4C 9T3 
Tel: +1-905-237-2004 
Renesas Electronics Europe Limited 
Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, U.K 
Tel: +44-1628-585-100, Fax: +44-1628-585-900 
Renesas Electronics Europe GmbH 
Arcadiastrasse 10, 40472 Düsseldorf, Germany 
Tel: +49-211-6503-0, Fax: +49-211-6503-1327 
Renesas Electronics (China) Co., Ltd. 
Room 1709, Quantum Plaza, No.27 ZhiChunLu Haidian District, Beijing 100191, P.R.China 
Tel: +86-10-8235-1155, Fax: +86-10-8235-7679 
Renesas Electronics (Shanghai) Co., Ltd. 
Unit 301, Tower A, Central Towers, 555 Langao Road, Putuo District, Shanghai, P. R. China 200333 
Tel: +86-21-2226-0888, Fax: +86-21-2226-0999 
Renesas Electronics Hong Kong Limited 
Unit 1601-1611, 16/F., Tower 2, Grand Century Place, 193 Prince Edward Road West, Mongkok, Kowloon, Hong Kong 
Tel: +852-2265-6688, Fax: +852 2886-9022 
Renesas Electronics Taiwan Co., Ltd. 
13F, No. 363, Fu Shing North Road, Taipei 10543, Taiwan 
Tel: +886-2-8175-9600, Fax: +886 2-8175-9670 
Renesas Electronics Singapore Pte. Ltd. 
80 Bendemeer Road, Unit #06-02 Hyflux Innovation Centre, Singapore 339949 
Tel: +65-6213-0200, Fax: +65-6213-0300 
Renesas Electronics Malaysia Sdn.Bhd. 
Unit 1207, Block B, Menara Amcorp, Amcorp Trade Centre, No. 18, Jln Persiaran Barat, 46050 Petaling Jaya, Selangor Darul Ehsan, Malaysia 
Tel: +60-3-7955-9390, Fax: +60-3-7955-9510 
Renesas Electronics India Pvt. Ltd. 
No.777C, 100 Feet Road, HAL II Stage, Indiranagar, Bangalore, India 
Tel: +91-80-67208700, Fax: +91-80-67208777 
Renesas Electronics Korea Co., Ltd. 
12F., 234 Teheran-ro, Gangnam-Gu, Seoul, 135-080, Korea 
Tel: +82-2-558-3737, Fax: +82-2-558-5141 
 
 
 
 
 
© 2006-2017 Renesas  Electronics  Corporation.  All rights reserved. 
Colophon  4.1 
 



 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
RUCG Tool 
 
User’s Manual 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
       
 
R20UT3754EJ0101 
 
 
 

Document Outline