Port Driver
Port Driver
Component Documentation
1 - Port Integration Manual
Integration Manual
For
Port
VERSION: 1
DATE: 05/08/17
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. | Description | Author | Version | Date |
| 1 | Initial version | Lucas Wendling | 1 | 05/08/17 |
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
References
This section lists the title & version of all the documents that are referred for development of this document
Dependencies
SWCs
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
Configuration Files to be provided by Integration Project
N/A
Da Vinci Parameter Configuration Changes
DaVinci Interrupt Configuration Changes
Manual Configuration Changes
Integration DATAFLOW REQUIREMENTS
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.
| Init | Scheduling Requirements | Trigger |
| | |
| Runnable | Scheduling Requirements | Trigger |
| | |
.
Memory Map REQUIREMENTS
Mapping
| Memory Section | Contents | Notes |
| | |
| | |
* Each …START_SEC… constant is terminated by a …STOP_SEC… constant as specified in the AUTOSAR Memory Mapping requirements.
Usage
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>
3 - R20UT3722EJ0101-AUTOSAR
AUTOSAR MCAL R4.0 User's Manual5 - R20UT3722EJ0101-AUTOSARs



;
AUTOSAR MCAL R4.0.3
User’s Manual
PORT Driver Component Ver.1.0.9
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.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 ADC
Analog to Digital Converter
ANSI
American National Standards Institute
API
Application Programming Interface
ARXML
AutosaR eXtensible Mark-up Language
AUTOSAR
AUTomotive Open System ARchitecture
BUS
BUS Network
BSWMDT
Basic Software Module Description Template
CAN
Controller Area Network
DEM
Diagnostic Event Manager
DET
Development Error Tracer
DIO
Digital Input Output
ECU
Electronic Control Unit
EEPROM
Electrically Erasable Programmable Read-Only Memory
GNU
GNU is Not Unix
GPT
General Purpose Timer
HW
HardWare
ICU
Input Capture Unit
id/ID
Identifier
I/O
Input Output
ISR
Interrupt Service Routine
LIN
Local Interconnect Network
MCAL
Microcontroller Abstraction Layer
MCU
MicroController Unit
MHz
Mega Hertz
NA
Not Applicable
PDF
Parameter Definition File
PWM
Pulse Width Modulation
RAM
Random Access Memory
Rev
Revision
ROM
Read Only Memory
RTE/Rte
Runtime Environment
SchM
Schedule Manager
SCI
Serial Communication Interface
SPI
Serial Peripheral Interface
SWS
Software Requirements Specification
WDT
Watchdog Timer
5
Definitions Term Represented by PORT pin
Numeric identifier linked to a hardware PORT pin
Sl. No.
Serial Number
Project Makefile (.mak)
This file has the script that guides the make utility to choose the
appropriate program files that are to be compiled and linked together
.trxml
Translation extended Markup Language
PORT
Represents a whole configurable port on a microcontroller device.
6
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. PORT Driver Component Makefile ......................................................................................... 17 3.1.1 Folder structure ....................................................................................................... 17 Chapter 4 Forethoughts ................................................................... 19 4.1. General...................................................................................................................................... 19 4.2. Preconditions ........................................................................................................................... 20 4.3. User Mode and Supervisor Mode ........................................................................................... 21 4.4. Data Consistency ..................................................................................................................... 21 4.5. Deviation List ........................................................................................................................... 23 Chapter 5 Architecture Details ........................................................ 25 Chapter 6 Registers Details ............................................................. 27 Chapter 7 Interaction Between The User And PORT Driver Component ............................................................................................31 7.1. Services Provided By PORT Driver Component To User .................................................... 31 Chapter 8 PORT Driver Component Header And Source File Description ............................................................................................33 Chapter 9 Generation Tool Guide .................................................... 35 Chapter 10 Application Programming Interface .............................. 37 10.1. Imported Types ........................................................................................................................ 37 10.1.1 Standard Types ....................................................................................................... 37 10.1.2 Other Module Types ................................................................................................ 37 10.2. Type Definitions ....................................................................................................................... 37 10.2.1 Port_ConfigType...................................................................................................... 37 10.2.2 Port_PinType ........................................................................................................... 39 10.2.3 Port_PinDirection Type ........................................................................................... 39 10.2.4 Port_PinModeType .................................................................................................. 40 10.3. Function Definitions ................................................................................................................ 41 10.3.1. Port_Init ................................................................................................................... 41 10.3.2. Port_SetPinDirection ............................................................................................... 42 10.3.3. Port_RefreshPortDirection ...................................................................................... 42 7
10.3.4. Port_SetPinMode .................................................................................................... 43 10.3.5. Port_GetVersionInfo ................................................................................................ 43 10.3.6. Port_SetToDioMode ................................................................................................ 44 10.3.7. Port_SetToAlternateMode ....................................................................................... 44 10.3.8. Port_SetPinDefaultDirection .................................................................................... 45 10.3.9. Port_SetPinDefaultMode ......................................................................................... 45 Chapter 11 Development And Production Errors ............................ 47 11.1. PORT Driver Component Development Errors ...................................................................... 47 11.2. PORT Driver Component Production Errors ........................................................................ 48 Chapter 12 Memory Organization ..................................................... 49 Chapter 13 P1M Specific Information ............................................... 51 13.1. Interaction between the User and PORT Driver Component ............................................... 51 13.1.1. Translation Header File ........................................................................................... 51 13.1.2. Parameter Definition File ......................................................................................... 52 13.1.3. Services Provided By PORT Driver Component to the User .................................. 52 13.2. Sample Application ................................................................................................................. 52 13.2.1. Sample Application Structure .................................................................................. 52 13.2.2. Building Sample Application .................................................................................... 54 13.2.2.1. Configuration Example ............................................................................ 54 13.2.2.2. Debugging the Sample Application ......................................................... 54 13.3. Memory and Throughput ........................................................................................................ 55 13.3.1. ROM/RAM Usage .................................................................................................... 55 13.3.2. Stack Depth ............................................................................................................. 56 13.3.3. Throughput Details .................................................................................................. 56 Chapter 14 Release Details ................................................................ 57 8
List of Figures Figure 1-1 System Overview Of AUTOSAR Architecture .......................................................... 11 Figure 1-2 System Overview Of The PORT Driver In AUTOSAR MCAL Layer .......................... 12 Figure 5-1 PORT Driver Architecture.......................................................................................... 25 Figure 12-1 PORT Driver Component Memory Organization ....................................................... 49 Figure 13-1 Overview of PORT Driver Sample Application ......................................................... 52 List of Tables
Table 4-1 Supervisor mode and User mode details .................................................................. 21 Table 4-2 PORT Driver Protected Resources List .................................................................... 22
Table 4-3 PORT Driver Deviation List ....................................................................................... 23 Table 6-1 Register Details ......................................................................................................... 27 Table 8-1 Description of the PORT Driver Component Files .................................................... 34 Table 10-1 API Provided by PORT Driver Component ................................................................ 41 Table 11-1 DET Errors of PORT Driver Component ................................................................... 47 Table 11-2 DEM Errors of PORT Driver Component .................................................................. 48 Table 13-1 PDF information for P1M .......................................................................................... 52 Table 13-2 ROM/RAM Details without DET ................................................................................ 55 Table 13-3 ROM/RAM Details with DET ..................................................................................... 56 Table 13-4 Throughput Details of the APIs.................................................................................. 56 9
10
Introduction Chapter 1 Chapter 1 Introduction The purpose of this document is to describe the information related to
PORT Driver Component for Renesas P1x microcontrollers.
This document shall be used as reference by the users of PORT Driver
Component for P1M Device. The information specific to P1M Device like,
compiler, linker, assembler, integration and build process for application
along with the memory consumption and throughput information are
provided.
The users of PORT Driver Component shall use this document as
reference. This document describes the common features of PORT Driver
Component. This document is intended for the developers of ECU
software using Application Programming Interfaces provided by
AUTOSAR. The PORT Driver Component provides the following services:
• PORT Driver Component initialization
• Port Pin Direction Handling
• Port Pin Direction Refreshing
• Port Pin Mode Handling
• Port Set To Dio Mode
• Port Set To Alternate Mode
• Port Pin Set To Default Direction
• Port Pin Set To Default Mode
• Module Version Information
The following diagram shows the system overview of the AUTOSAR
Architecture.
Application Layer
AUTOSAR RTE
System Services
On board Device Abstraction
PORT Driver Microcontroller
Figure 1-1 System Overview Of AUTOSAR Architecture 11
Chapter 1 Introduction The PORT Driver Component comprises of two sections that is,
embedded software and the configuration tool to achieve scalability and
configurability. The PORT Driver Component Code Generation Tool is a
command line tool that accepts ECU configuration description files as
input and generates C Source and C Header files. The configuration
description is an ARXML file that contains information about the
configuration for PORT pins. The tool generates Port_Cfg.h, Port_Cbk.h
and Port_PBcfg.c files.
The Figure in the following page depicts the PORT Driver as part of layered
AUTOSAR MCAL Layer:
Microcontroller Drivers
Memory Drivers
Communication Drivers I/O Drivers
in
e
in
te
x
t
t
r
e
e
n
S
W
r
r
a
P
F
n
n
l
a
GP
MC
a
a
I
EEP
H
LI
CA
le
tc
C
RA
l
l
x
a
N
h
o
F
F
R
n
N Dr
T
U
d
Pre
M
la
l
a
d
D
a
I
P
CU
RO
A
D
o
D
D
Og
s
s
le
y
W
r
DC
r
T
r
T
h
h
i
r
v
D
i
I
RT i
O
v
D
iv
e
e
Dr
D
M
Dr
er
v
M
r
Dr
e
e
r
e
st
s
i
v
r
i
r
D
Dr
Dr
Drr
i
v
r
t
i
i
D
v
er
i
v
v
v
r
er
er
i
i
er
er
r
e
i
v
i
v
v
iv
r
e
e
e
ve e
r
r
r
r
r M
&
E
E
WDT
C Po
Micro- xt
F
E
G
U
Cl
l
P
L
PW
.
a
CA
IC
A
PT
n
B
R
S
SCI
I
DIO
D
i
o
s
N
O
PI
t
c
w
Controller u
h
N
U
C
M
M
s
or
k
er
Figure 1-2 System Overview Of The PORT Driver In AUTOSAR MCAL Layer
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 Section 1 (Introduction)
This section provides an introduction and overview of PORT 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 for PORT Driver Component
Process)
along with a sample application.
Section 4 (Forethoughts)
This section provides brief information about the PORT Driver
Component, the preconditions that should be known to the user before it
is used, data consistency details and deviation list.
Section 5 (Architecture Details)
This section describes the layered architectural details of the PORT
Driver Component.
Section 6 (Register Details)
This section describes the register details of PORT Driver Component.
Section 7 (Interaction Between
This section describes interaction of the PORT Driver Component with
The User And PORT Driver
the upper layers.
Component)
Section 8 (PORT Driver
This section provides information about the PORT Driver Component
Component Header And Source
source files. This section also contains the brief note on the tool
File Description)
generated output file.
Section 9 (Generation Tool Guide) This section provides information on the PORT Driver Component Code
Generation Tool.
Section 10 (Application
This section mentions all the APIs provided by the PORT Driver
Programming Interface)
Component.
Section 11 (Development And
This section lists the DET and DEM errors handled by PORT Driver.
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 describes the details of the P1M Sample Application
Information)
with its folder structure, the information about RAM/ROM usage,
stack depth and throughput details.
Section 14 (Release Details)
This section provides release details with version name.
13
Chapter 1 Introduction 14
Reference Documents Chapter 2 Chapter 2 Reference Documents Sl. No. Title Version 1.
AUTOSAR_SWS_PortDriver.pdf
3.2.0
2.
AUT
OSAR BUGZILLA (http://www.autosar.org/bugzilla) -
Note: AUTOSAR BUGZILLA is a database, which contains concerns raised
against information present in AUTOSAR Specifications.
3.
r01uh0436ej0130-rh850p1x.pdf
1.30
4.
AUTOSAR_SWS_CompilerAbstraction.pdf
3.2.0
5.
AUTOSAR_SWS_MemoryMapping.pdf
1.4.0
6.
AUTOSAR_SWS_PlatformTypes.pdf
2.5.0
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 PORT Driver Component is
explained. Description of the Makefiles along with samples is provided in this
section.
Remark The details about the C Source and C Header files that are generated by the
PORT Driver Generation Tool are mentioned in the “R20UT3723EJ0101-
AUTOSAR.pdf”.
3.1. PORT Driver Component Makefile The Makefile provided with the PORT Driver Component consists of the GNU
Make compatible script to build the PORT Driver Component in case of any
change in the configuration. This can be used in the upper level Makefile (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\port\src
\Port.c
\Port_Ram.c
\Port_Version.c
X1X\common_platform\modules\port\include
\Port.h
\Port_PBTypes.h
\Port_Ram.h
\Port_Version.h
\Port_Debug.h
\Port_Types.h
\Port_RegWrite.h
X1X\P1x\modules\port\sample_application\<SubVariant>\make\<Compiler>
\App_PORT_P1M_Sample.mak
X1X\P1x\modules\port\sample_application\<SubVariant>\obj\<Complier>
X1X\common_platform\modules\port\generator\Port_X1x.dll
X1X\P1x\common_family\generator
\Global_Application_P1x.trxml
\Sample_Application_P1x.trxml
\P1x_translation.h
X1X\P1x\modules\port\user_manual
(User manuals will be available in this folder)
X1X\P1x\modules\port\generator
\R403_PORT_P1x_BSWMDT.arxml
Note: 1. <Compiler> can be ghs.
2. <AUTOSAR_version> should be 4.0.3.
3. <SubVariant> can be P1M.
17
Chapter 3 Integration and Build Process 18
Forethoughts Chapter 4 Chapter 4 Forethoughts 4.1. General Following information will aid the user to use the PORT Driver Component
software efficiently:
•
The PORT Driver Component does not enable or disable the ECU or
Microcontroller power supply. The upper layer should handle this
operation.
•
Start-up code is not implemented by the PORT Driver Component.
•
PORT Driver Component does not implement any callback
notification functions.
•
PORT Driver Component does not implement any scheduled functions.
•
The PORT Driver Component is restricted to Post Build only.
•
The authorization of the user for calling the software triggering of a
hardware reset is not checked in the PORT Driver Component. This will
be the responsibility of the upper layer.
•
The PORT Driver Component supports setting of Analog and Digital
Noise Elimination. To figure out the different port filter arrangements the
device User Manual should be taken as reference. If no configuration of a
certain port filter is done within this Port Module, the device specific
default settings will take effect on this filter.
•
The value of unused pins are set to defined state. i.e Mode = DIO,
Direction = Input, Pin Level Value = LOW
•
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 PORT Driver does not have the API support to read the status of
Port pins or Port registers. Hence PORT Driver will not support ‘Read
back’ feature.
•
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.
•
Port_SetToDioMode and Port_SetPinDefaultMode Api shall not change
or affect the level of the requested pin.
•
The access to HW registers is possible only using AUTOSAR standard
and vendor specific API functions described in this document (Chapter
10).
•
The output level of each pin can be inverted by configuring the required
value (true/false) through the configuration parameter
PortOutputLevelInversion.
•
The functions/variables with "STATIC" as pilot tag, provides an
indication to the compiler that the function/variable following this tag is a
static type. So the scope of static functions/variables is restricted to the
file where they are declared. User should take care of the tag name with
respect to compiler used.
•
During changing direction to OUTPUT for a particular pin, the pin level
value (PSR register) is also set to the default configured value in order
to avoid an undefined output level of the pin. This needs to be
considered for any application software controlling the pin.
•
The default value for the parameter 'PortLoopTimeout' is ‘5’. The user shall
configure the parameter 'PortLoopTimeout' to standard default value ‘5’ to
avoid unwanted reporting of DEM due to protected register write failure.
The maximum value of this parameter 'PortLoopTimeout' is '255'.
19
Chapter 4 Forethoughts
4.2. Preconditions Following preconditions have to be adhered by the user, for proper
functioning of the PORT Driver Component:
•
The Port_PBcfg.c, Port_Cfg.h and Port_Cbk.h files generated by the
PORT Driver Component Code Generation Tool must be compiled and
linked along with PORT Driver Component source files.
•
The application has to be rebuilt, if there is any change in the Port_Cfg.h
file generated by the PORT Driver Component Generation Tool.
•
File Port_PBcfg.c generated for single configuration set or multiple
configuration sets using PORT Driver Component Code Generation Tool
should be compiled and linked independently.
•
Symbolic names for all Port Pins are generated in Port_Cfg.h file which
can be used as parameters for passing to PORT Driver Component APIs.
•
The PORT Driver Component needs to be initialized for all Port Pins
before doing any operation on Port Pins. The Port_Init () API shall also be
called after a reset in order to reconfigure the Port Pins of the
microcontroller. If PORT Driver Component is not initialized properly, the
behavior of Port Pins may be undetermined.
•
The user should ensure that PORT Driver Component API requests are
invoked with correct input arguments.
•
The other modules depending on PORT Driver Component should ensure
that the PORT Driver Component initialization is successful before doing
any operation on Port Pins.
•
Input parameters are validated only when the static configuration
parameter PORT_DEV_ERROR_DETECT is enabled. Application should
ensure that the right parameters are passed while invoking the APIs when
PORT_DEV_ERROR_DETECT is disabled.
•
Values for production code Event Id’s should be assigned externally by the
configuration of the DEM.
•
A mismatch in the version numbers of header and the source files will
result in a compilation error. User should ensure that the correct versions
of the header and the source files are used.
•
The PORT Driver Component APIs, except Port_GetVersionInfo API,
which are intended to operate on Port Pins shall be called only after PORT
Driver Component is initialized by invoking Port_Init() API. Otherwise Port
Pin functions will exhibit undefined behavior.
•
All Port Pins and their functions should be configured by the Port
configuration tool. It is the User/Integrator responsibility to ensure that the
same Port/Port Pin is not being accessed/configured in parallel by different
entities in the same system.
•
User have the responsibility to enable or disable the critical protection
using
the
parameter
PortCriticalSectionProtection. By
enabling
parameter PortCriticalSectionProtection, Microcontroller HW registers
which suffer from concurrent access by multiple tasks, are protected.
•
The same alternative function should not be assigned to two different
pins at same time.
20
Forethoughts Chapter 4 4.3. User Mode and Supervisor Mode The below table specifies the APIs which can run in user mode, supervisor
mode or both modes:
Table 4-1 Supervisor mode and User mode details Sl.No API Name User Supervisor Known limitation in User mode Mode mode 1 Port_Init
x
x
For User mode, critical section is
disabled
2 Port_SetPinDirection
x
x
For User mode, critical section is
disabled
3 Port_RefreshPortDirection
x
x
For User mode, critical section is
disabled
4 Port_SetPinMode
x
x
For User mode, critical section is
disabled
5 Port_SetToDioMode
x
x
For User mode, critical section is
disabled
6 Port_SetToAlternateMode
x
x
For User mode, critical section is
disabled
7 Port_SetPinDefaultDirection
x
x
For User mode, critical section is
disabled
8 Port_SetPinDefaultMode
x
x
For User mode, critical section is
disabled
9 Port_GetVersionInfo
x
x
For User mode, critical section is
disabled
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.
4.4. Data Consistency To support the re-entrance and interrupt services, the AUTOSAR PORT
component will ensure the data consistency while accessing its own RAM
storage or hardware registers. The PORT component will use
SchM_Enter_Port_<Exclusive Area> and SchM_Exit_Port_<Exclusive Area>
functions. The SchM_Enter_Port_<Exclusive Area> function is called before
the data needs to be protected and SchM_Exit_Port_<Exclusive
Area>function is called after the data is accessed.
The following exclusive areas along with scheduler services are used to
provide data integrity for shared resources:
•
PORT_SET_PIN_MODE_PROTECTION
•
PORT_SET_PIN_DIR_PROTECTION
•
PORT_SET_TO_DIO_ALT_PROTECTION
•
PORT_INIT_CONFIG_PROTECTION
•
PORT_REFRESHPORT_INTERNAL_PROTECTION
•
PORT_SET_PIN_DEFAULT_MODE_PROTECTION
•
PORT_SET_PIN_DEFAULT_DIR_PROTECTION
The functions SchM_Enter_Port_<Exclusive Area> and
SchM_Exit_Port_<Exclusive Area> can be disabled through the
configuration parameter ‘PortCriticalSectionProtection’.
21
Chapter 4 Forethoughts
Table 4-2 PORT Driver Protected Resources List API Name Exclusive Area Type Protected Resources Port_Init
PORT_INIT_CONFIG_PROTECTION
HW registers:PFCEn,
PFCn, PFCAEn,
PMCSRn,PMSRn,JPFCE0,
JPMCSR0,JPMSR0,PSRn,
JPSR0,PISAn,JPISA0,PIB
Cn,JPIBC0,PIPCn,PUn,JP
U0,PDn,JPD0,PBDCn,JPB
DC0,PODCn,JPODC0,PO
DCEn,PDSCn,PUCCn,JPD
SC0,JPUCC0,PINVnDNFA
nCTL,DNFAnENL,DNFCK
SnC, FCLAnCTL
Port_SetPinDirection
PORT_SET_PIN_DIR_PROTECTION
HWregisters:PSRn,JPSR0,
PMSRn,PINVn,JPMSR0
PORT_REFRESHPORT_INTERNAL_PR
HW registers:PMSRn,
OTECTION
JPMSR0.
Port_RefreshPortDire
ction
PORT_SET_PIN_MODE_PROTECTION
HWregisters:PIPCn,PMSRn
,PMCSRn,PSRn,JPMSRn,J
PMCSR0,JPSR0,PFCEn,P
FCn,PFCAEn,JPFCE0.
Port_SetPinMode
Port_SetToDioMode
PORT_SET_TO_DIO_ALT_PROTECTIO
HW registers:PMCSRn,
N
PIPCn, JPMCSR0
Port_SetToAlternateM
PORT_SET_TO_DIO_ALT_PROTECTIO
HW registers:PMCSRn,
ode
N
PIPCn, JPMCSR0
Port_SetPinDefaultMo
PORT_SET_PIN_DEFAULT_MODE_PRO
HW registers:PMCSRn,
de
TECTION
PMSRn, PIPCn,
JPMCSR0,JPMSR0,PFCE
n,PFCn,PFCAEn,JPFCE0.
Port_SetPinDefaultDir
PORT_SET_PIN_DEFAULT_DIR_PROTE
HW registers:PMSRn,
ection
CTION
JPMSR0
Port_GetVersionInfo
None
None
Note: The highest measured duration of a critical section is 43.387 micro seconds measured
for Port_Init API.
22
Forethoughts Chapter 4 4.5. Deviation List Table 4-3 PORT Driver Deviation List Sl. No. Description AUTOSAR Bugzilla 1.
The Port Pin specific containers
-
(PortPin0, PortPin1, PortPin2 and so
on …) are added as sub containers
of PortGroup<n> containers, having
the parameters
‘PortPinDirection’,
‘PortPinDirectionChangeable’,
‘PortPinLevelValue’ and
‘PortPinInitialMode’ are added.
AUTOSAR specified containers
‘PortContainer’ and ‘PortPin’ with all
its parameters are considered as
unused.
2.
PortPinMode configuration
-
parameter is not used for
implementation as all possible
modes of a pin can be used in
the Port_SetPinMode function.
3.
[ecuc_sws_2108] requirement is
-
not applicable to port module
since implementation of PORT
module is vendor specific.
4.
Port Pin level inversion is
-
implemented as per Renesas
requirement which is violating
AUTOSAR requirement
PORT082
23
Chapter 4 Forethoughts
24



Architecture Details Chapter 5 Chapter 5 Architecture Details The PORT Driver Component accesses the microcontroller Port Pins that are
located in the On-Chip hardware. The basic architecture of the PORT Driver
Component is illustrated below:
Initialization
Direction Refreshing
Direction Switching
Runtime Mode Change
Figure 5-1 PORT Driver Architecture The PORT Driver Component consists of the following sub modules based on
the functionality:
•
Port Initialization.
•
Port Direction Refreshing.
•
Port Pin Direction Switching.
•
Port Pin Mode Change.
•
Module Version Information
Port Initialization This sub module provides the Port initialization functionality by providing the
Port_Init() API. This API should be invoked before the usage of any other APIs
of PORT Driver Component. Port Initialization includes initializing Port Pin
mode, Port Pin direction, Port Pin Level value, Port Pin driven value (Normal /
Open Drain), Activation of internal pull-ups and Port Filter configuration.
Port Direction Refreshing This sub module provides the Port Direction Refreshing functionality by
providing the Port_RefreshPortDirection() API. In this functionality the PORT
Driver Component refreshes the direction of all configured Port Pins except
those Port Pins that are configured as ‘Port Pin Direction Changeable during
runtime’.
In this functionality only Direction of Port Pins is refreshed.
Port Pin Direction Switching This sub module provides the Port Direction switching functionality at run time
by providing the the Port_SetPinDirection() API. In this functionality the
PORT driver Component allows the user to change the direction of Port Pins
during runtime.
This sub module provides the Port Direction switching functionality at run time
by providing the Port_SetPinDefaultDirection() API. In this functionality the
PORT driver Component allows the user at runtime to change the direction of
Port Pins to default direction set by the configuration at the time of Port_Init().
25
Chapter 5 Architecture Details Port Pin Mode changing This sub module provides the Port Mode change functionality at run time by
providing the Port_SetPinMode() API. In this functionality the PORT driver
Component allows the user to change the mode of Port Pins during runtime.
This sub module provides the Port Mode change functionality at run time by
providing the Port_SetToDioMode() API. In this functionality the PORT
driver Component allows the user to change the mode of Port Pin to DIO
mode during runtime.
This sub module provides the Port Mode change functionality at run time by
providing the Port_SetToAlternateMode() API. In this functionality the PORT
driver Component allows the user to change the mode of Port Pin to alternate
mode during runtime.
This sub module provides the Port Mode change functionality at run time by
providing the Port_SetPinDefaultMode() API. In this functionality the PORT
driver Component allows the user at runtime to change the mode of Port Pin
to default mode set by the configuration at the time of Port_Init().
Module Version Information
The Api Port_GetVersionInfo is responsible for reading the version information
of the PORT Driver Information. The verison information includes Module ID,
Vendor ID, and Version number of the PORT Driver software.
26
Registers Details Chapter 6 Chapter 6 Registers Details This section describes the register details of PORT Driver Component.
Table 6-1 Register Details Register Register Access Access API Name RegisterConfig Parameter Macro/Variable 8/16/32 r/w/rw s bits Port_SetPinDirection
32 bit
rw
PSRn
PortPinLevelValue,
usChangeableConfigVal
PortPinDirectionChangeable
32 bit
rw
JPSR0
PortPinLevelValue,
usChangeableConfigVal
PortPinDirectionChangeable
32 bit
rw
PMSRn
PortPinDirection,
usOrMaskVal
PortPinDirectionChangeable
32 bit
rw
JPMSR0
PortPinDirection,
usOrMaskVal
PortPinDirectionChangeable
32 bit
w
PINVn
PortOutputLevelInversion,
usPortinversionVal
PortPinDirectionChangeable
PortPinDirection
r
PORT_LONG_WORD_ON
32 bit
PPROTSn
-
E
w
PORT_WRITE_ERRO
32 bit
PPCMDn
-
R_CLEAR_VAL
Port_RefreshPortDirecti
rw
PortPinDirection,
on
32 bit
PMSRn
PortPinDirectionChangeable
ulMaskAndConfigValue
rw
PortPinDirection,
32 bit
JPMSR0
PortPinDirectionChangeable
ulMaskAndConfigValue
Port_SetToDioMode
32 bit
rw
PMCSRn
PortPinDioAltModeChangeable usOrMask
PortPinInitialMode
16 bit
rw
PIPCn
PortIpControl
usOrMask
PortPinInitialMode
PortPinDioAltModeChangeable
32 bit
rw
JPMCSR0
PortPinDioAltModeChangeable usOrMask
PortPinInitialMode
Port_SetToAlternateMo 32 bit
rw
PMCSRn
PortPinDioAltModeChangeable usOrMask
de
PortPinInitialMode
16 bit
rw
PIPCn
PortIpControl
usOrMask
PortPinInitialMode
PortPinDioAltModeChangeable
32 bit
rw
JPMCSR0
PortPinDioAltModeChangeable usOrMask
PortPinInitialMode
Port_SetPinDefaultMod
32 bit
rw
PMCSRn
PortPinModeChangeable,
usOrMask
e
PortPinInitialMode
usInitModeRegVal
PortPinDirection
27
Chapter 6 Registers Details Register Register Access Access API Name RegisterConfig Parameter Macro/Variable 8/16/32 r/w/rw s bits 32 bit
rw
PMSRn
PortPinModeChangeable,
usOrMask
PortPinInitialMode
usInitModeRegVal
PortPinDirection
16 bit
rw
PIPCn
PortPinModeChangeable,
usOrMask
PortIpControl
usInitModeRegVal
32 bit
rw
JPMCSR0
PortPinModeChangeable,
usOrMask
PortPinInitialMode
usInitModeRegVal
PortPinDirection
32 bit
rw
JPMSR0
PortPinModeChangeable,
usOrMask
PortPinInitialMode
usInitModeRegVal
PortPinDirection
rw
PFCEn
PortPinModeChangeable,
usOrMask
16 bit
PortPinInitialMode
usInitModeRegVal
rw
PFCn
PortPinModeChangeable,
usOrMask
16 bit
PortPinInitialMode
usInitModeRegVal
rw
PFCAEn
PortPinModeChangeable,
usOrMask
16 bit
PortPinInitialMode
usInitModeRegVal
rw
JPFCE0
PortPinModeChangeable,
usOrMask
8 bit
PortPinInitialMode
usInitModeRegVal
Port_SetPinDefaultDire
32 bit
rw
PMSRn
PortPinDirection,
usOrMaskVal
ction
PortPinDirectionChangeable
32 bit
rw
JPMSR0
PortPinDirection,
usOrMaskVal
PortPinDirectionChangeable
Port_SetPinMode
16 bit
rw
PIPCn
PortPinModeChangeable,
usOrMask
PortIpControl
32 bit
rw
PMSRn
PortPinModeChangeable
usOrMask
32 bit
rw
PMCSRn
PortPinModeChangeable,
usOrMask
32 bit
rw
PSRn
PortPinModeChangeable,
usInitModeRegVal
PortPinLevelValue
32 bit
rw
JPMSR0
PortPinModeChangeable,
usOrMask
32 bit
rw
JPMCSR0
PortPinModeChangeable,
usOrMask
32 bit
rw
JPSR0
PortPinModeChangeable,
usInitModeRegVal
PortPinLevelValue
rw
PFCEn
PortPinModeChangeable,
usOrMask
16 bit
rw
PFCn
PortPinModeChangeable,
usOrMask
16 bit
rw
PFCAEn
PortPinModeChangeable,
usOrMask
16 bit
rw
JPFCE0
PortPinModeChangeable,
usOrMask
8 bit
Port_Init
32 bit
rw
PSRn
PortPinLevelValue
usInitModeRegVal
28
Registers Details Chapter 6 Register Register Access Access API Name RegisterConfig Parameter Macro/Variable 8/16/32 r/w/rw s bits 32 bit
rw
JPSR0
PortPinLevelValue
usInitModeRegVal
rw
PMSRn
PortPinDirection,
32 bit
usInitModeRegVal
rw
PMCSRn
32 bit
PortPinInitialMode
usInitModeRegVal
16 bit
rw
PISAn
PortInputSelection
usInitModeRegVal
8 bit
rw
JPISA0
PortInputSelection
usInitModeRegVal
16 bit
rw
PIBCn
PortInputBufferControl
usInitModeRegVal
8 bit
rw
JPIBC0
PortInputBufferControl
usInitModeRegVal
16 bit
rw
PIPCn
PortIpControl
usInitModeRegVal
16 bit
rw
PUn
PullUpOption
usInitModeRegVal
8 bit
rw
JPU0
PullUpOption
usInitModeRegVal
16 bit
rw
PDn
PullDownOption
usInitModeRegVal
8 bit
rw
JPD0
PullDownOption
usInitModeRegVal
16 bit
rw
PBDCn
PortBiDirectionControl
usInitModeRegVal
8 bit
rw
JPBDC0
PortBiDirectionControl
usInitModeRegVal
rw
PortSameLevelSamples
ucDNFACTL
8 bit
DNFAnCTL
PortSamplingClockFrequency
rw
FCLAnCTL
PortDigitalFilterEdgeControl
8 bit
ucFCLACTL
m
rw
PortDigitalFilterEnableInput
8 bit
DNFAnENL
ucDNFAENL
rw
PortClockSource
32 bit
DNFCKSnC
ulDNFCKS
rw
8 bit
JPFCE0
PortPinInitialMode
usInitModeRegVal
rw
32 bit
JPMCSR0
PortPinInitialMode
usInitModeRegVal
rw
PortPinDirection,
32 bit
JPMSR0
usInitModeRegVal
16 bit
rw
PFCEn
PortPinInitialMode
usInitModeRegVal
rw
16 bit
PFCn
PortPinInitialMode
usInitModeRegVal
rw
16 bit
PFCAEn
PortPinInitialMode
usInitModeRegVal
w
PPCMDn
-
PORT_WRITE_ERROR_
32 bit
CLEAR_VAL
29
Chapter 6 Registers Details Register Register Access Access API Name RegisterConfig Parameter Macro/Variable 8/16/32 r/w/rw s bits r
PPROTSn
-
PORT_LONG_WORD_ON
32 bit
E
w
JPPCMD0
-
PORT_WRITE_ERROR_
32 bit
CLEAR_VAL
r
JPPROTS0 -
PORT_LONG_WORD_ON
32 bit
E
32 bit
w
PODCn
PortOpenDrainControlExpansi
usInitModeRegVal
on
32 bit
w
JPODC0
PortOpenDrainControlExpansi
usInitModeRegVal
on
32 bit
w
PODCEn
PortOpenDrainControlExpansi
usInitModeRegVal
on
32 bit
w
PDSCn
PortDriveStrengthControl
usInitModeRegVal
32 bit
w
JPDSC0
PortDriveStrengthControl
usInitModeRegVal
32 bit
w
PUCCn
PortUnlimitedCurrentControl
usInitModeRegVal
32 bit
w
JPUCC0
PortUnlimitedCurrentControl
usInitModeRegVal
32 bit
w
PINVn
PortOutputLevelInversion
usInitModeRegVal
Port_GetVersionInfo
-
-
-
-
-
30
Interaction Between The User And PORT Driver Component Chapter 7 Chapter 7 Interaction Between The User And PORT Driver Component The details of the services supported by the PORT 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 PORT Driver Component To User The PORT Driver provides following functionalities to the upper layers:
•
To initialize the PORT pins.
•
To change the direction of a PORT pin during runtime.
•
To change the mode of a PORT pin during runtime.
•
To refresh the direction of a PORT Pin.
•
To read the version information of the PORT module.
•
To change the direction of a PORT pin to default.
•
To change the mode of a PORT pin to default.
•
To change the mode of a PORT pin to DIO.
•
To change the mode of a PORT pin to ALTERNATE.
31
Chapter 7 Interaction Between The User And PORT Driver Component
32
PORT Driver Component Header And Source File Description Chapter 8 Chapter 8 PORT Driver Component Header And Source File Description This section explains the PORT 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 PORT Driver Generation Tool:
•
Port_Cfg.h
•
Port_Cbk.h
The C source file generated by PORT Driver Generation Tool:
•
Port_PBcfg.c
The PORT Driver Component C header files:
•
Port.h
•
Port_PBTypes.h
•
Port_Ram.h
•
Port_Version.h
•
Port_Debug.h
•
Port_Types.h
•
Port_RegWrite.h
The PORT Driver Component source files:
•
Port.c
•
Port_Ram.c
•
Port_Version.c
The Stub C header files:
•
Compiler.h
•
Compiler_Cfg.h
•
MemMap.h
•
Platform_Types.h
•
Std_Types.h
•
Dem.h
•
Dem_Cfg.h
•
Det.h
•
Rte.h
•
Schm_Port.h
33
Chapter 8 PORT Driver Component Header And Source File Description The description of the PORT Driver Component files is provided in the table below:
Table 8-1 Description of the PORT Driver Component Files File Details Port_Cfg.h
This file contains various PORT Driver Pre-compile time parameters, macro
definitions for the ISRs, channel notifications used by PORT Driver, PORT pin
handles.
Port_Cbk.h
This file contains the definition of error interface which will be invoked when the
port register write-verify fails.
Port_PBcfg.c
This file contains the post-build configuration data. The structures related to PORT
initialization, PORT Timer channel configuration and the timer related structures are
also provided in this file.
Port.h
This file provides extern declarations for all the PORT Driver Component APIs. This
file provides service Ids of APIs, DET Error codes and type definitions for Port
initialization structure. This header file shall be included in other modules to use the
features of PORT Driver Component.
Port_PBTypes.h
This file contains the data structures related to Port initialization, Port Refresh,
Direction changeable Pins at run time and Mode Changeable at run time.
Port_Types.h
This file provides data structure and type definitions for initialization of MCU Driver.
Port_Debug.h
This file is used for version check.
Port_Ram.h
This file contains the extern declarations for the global variables defined in
Port_Ram.c file.
Port_Version.h
This file contains the macros of AUTOSAR version numbers of all modules that are
interfaced to PORT Driver.
Port_RegWrite.h
This file contains macro definitions for the registers write and
Register write verification.
Port.c
This file contains the implementation of all APIs.
Port_Ram.c
This file contains the global variables used by PORT Driver Component.
Port_Version.c
This file contains the code for checking version of all modules that are interfaced to
PORT Driver.
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.
Platform_Types.h
This file provides provision for defining platform and compiler dependent types.
Dem.h
This file is a stub for DEM component
Dem_Cfg.h
This file contains the stub values for Dem_Cfg.h
SchM_Port.h
This file is a stub for SchM Component
Std_Types.h
Provision for Standard types
Det.h
This file is a stub for DET component.
Rte.h
This file is a stub for Rte Component.
34
Generation Tool Guide Chapter 9 Chapter 9 Generation Tool Guide For more information on the PORT Driver Component Generation Tool,
please refer “R20UT3723EJ0101-AUTOSAR.pdf”.
35
Chapter 9 Generation Tool Guide
36
Application Programming Interface Chapter 10 Chapter 10 Application Programming Interface This section explains the Data types and APIs provided by the PORT Driver
Component to the Upper layers.
10.1. Imported Types This section explains the Data types imported by the PORT 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_VersionInfoType
Std_ReturnType
10.1.2 Other Module Types In this chapter all types included from the Dem_types.h are listed:
Dem_EventIdType
10.2. Type Definitions This section explains the type definitions of PORT Driver Component
according to AUTOSAR Specification.
10.2.1 Port_ConfigType Name: Port_ConfigType
Type: struct
Element: Type Name Explanation uint32
ulStartOfDbToc
Database start
value.
Port_Regs
pPortNumRegs
Pointer to the
address of
Numeric port
registers
configuration.
Port_FuncCtrlRegs
pPortNumFuncCtrlRegs
Pointer to the
address of the
Numeric function
control registers
configuration.
Port_PMSRRegs
pPortNumPMSRRegs
Pointer to the
address of the
Numeric PMSR
registers
configuration.
Port_Regs
pPortJRegs
Pointer to the
address of JTAG
port registers
configuration
37
Chapter 10 Application Programm ing Interface
Type Name Explanation Port_FuncCtrlRegs
pPortJFuncCtrlRegs
Pointer to the
address of JTAG
function control
registers
configuration
Port_PMSRRegs
pPortJPMSRRegs
Pointer to the
address of JTAG
PMSR registers
configuration.
Port_PinsDirChangeable
pPinDirChangeable
Pointer to the
address of
runtime direction
changeable pins
structure.
Port_PinModeChangeableGroups
pPinModeChangeableGrou Pointer to the
ps
address of
runtime mode
changeable pin
group details
structure.
Port_PinDioAltChangeableDetails
pPinDioAltModeDetails
Pointer to the
address of run
time mode
changeable pins
structure.
Port_PinModeChangeableDetails
pPinModeChangeableDetai Pointer to the
ls
address of run
time mode
changeable pins
structure.
Port_DNFARegs
pPortDNFARegs
Pointer to the
DNFA registers
structure.
Port_FCLARegs
pPortFCLARegs
Pointer to the
FCLA registers
structure.
Port_DNFCKSRegs
pPortDNFCKSRegs
Pointer to the
DNFCKS
registers
structure
uint8
ucNoOfPinsDirChangeable Total number of
Pins configured
for Direction
Changeable at
run time
uint8
ucNoOfPinsModeChangea
Total number of
ble
Pins configured
for mode
Changeable at
run time
uint8
ucNoOfPinsDioAltModeCha Total number of
ngeable
Pins configured
for mode
Changeable at
run time
38
Application Programming Interface Chapter 10 Type Name Explanation uint8
ucNoOfDNFARegs
The total number
of DNFA noise
elimination
registers
uint8
ucNoOfFCLARegs
The total number
of FCLA noise
elimination
registers
uint8
ucNoOfDNFCKSRegs
The total number
of DNFCKS
noise elimination
registers
This is the type of the external data structure containing the initialization data for the
PORT Driver Component.
Description:
The user shall use the symbolic names defined in the PORT Driver Configuration Tool.
The configuration of each Port Pin is Microcontroller specific.
10.2.2 Port_PinType Name: Port_PinType
Type: uint16
Range: 0 to 65535
Description: The user shall use the symbolic names defined in the PORT Driver Configuration Tool.
The configuration of each Port Pin is Microcontroller specific.
10.2.3 Port_PinDirection Type Name: Port_PinDirectionlType
Type: Enumeration
PORT_PIN_OUT
Output Direction
Range: PORT_PIN_IN
Input Direction
Description: These are the possible directions of a port pin.
39
Chapter 10 Application Programm ing Interface
10.2.4 Port_PinModeType Name: Port_PinModeType
Type: uint8
Range: PIPC=0
0
PORT_DIO_OUT
(Port_PinModeType)0x00
1
PORT_DIO_IN
(Port_PinModeType)0x01
2
APP_ALT1_OUT
(Port_PinModeType)0x02
3
APP_ALT1_IN
(Port_PinModeType)0x03
4
APP_ALT2_OUT
(Port_PinModeType)0x04
5
APP_ALT2_IN
(Port_PinModeType)0x05
6
APP_ALT3_OUT
(Port_PinModeType)0x06
7
APP_ALT3_IN
(Port_PinModeType)0x07
8
APP_ALT4_OUT
(Port_PinModeType)0x08
9
APP_ALT4_IN
(Port_PinModeType)0x09
A
APP_ALT5_OUT
(Port_PinModeType)0x0A
B
APP_ALT5_IN
(Port_PinModeType)0x0B
C
APP_ALT6_OUT
(Port_PinModeType)0x0C
D
APP_ALT6_IN
(Port_PinModeType)0x0D
E
PORT_MODE_DIO
(Port_PinModeType)0x00
F
PORT_MODE_ADJUST
(Port_PinModeType)0x0E
Range: PIPC=1
0
APP_ALT1_OUT_SET_PIPC (Port_PinModeType)0x82
1
APP_ALT1_IN_SET_PIPC
(Port_PinModeType)0x83
2
APP_ALT2_OUT_SET_PIPC (Port_PinModeType)0x84
3
APP_ALT2_IN_SET_PIPC
(Port_PinModeType)0x85
4
APP_ALT3_OUT_SET_PIPC (Port_PinModeType)0x86
5
APP_ALT3_IN_SET_PIPC
(Port_PinModeType)0x87
6
APP_ALT4_OUT_SET_PIPC (Port_PinModeType)0x88
7
APP_ALT4_IN_SET_PIPC
(Port_PinModeType)0x89
8
APP_ALT5_OUT_SET_PIPC (Port_PinModeType)0x8A
9
APP_ALT5_IN_SET_PIPC
(Port_PinModeType)0x8B
A
APP_ALT6_OUT_SET_PIPC (Port_PinModeType)0x8C
B
APP_ALT6_IN_SET_PIPC
(Port_PinModeType)0x8D
Description: These are the possible modes of a port pin.
40
Application Programming Interface Chapter 10 10.3. Function Definitions Table 10-1 API Provided by PORT Driver Component SI.No API’s 1
Port_Init
2
Port_SetPinDirection
3
Port_RefreshPortDirection
4
Port_SetPinMode
5
Port_GetVersionInfo
6
Port_SetToDioMode
7
Port_SetToAlternateMode
8
Port_SetPinDefaultDirection
9
Port_SetPinDefaultMode
10.3.1. Port_Init Name: Port_Init
FUNC(void, PORT_PUBLIC_CODE) Port_Init (P2CONST(Port_ConfigType,
Prototype: AUTOMATIC, PORT_APPL_CONST) ConfigPtr)
Service ID: 0x00
Sync/Async: Synchronous
Reentrancy: Non-Reentrant
Type Parameter Value/Range Parameters In: Port_ConfigType
ConfigPtr
NA
Parameters InOut: NA
NA
NA
Parameters out: NA
NA
NA
Type Possible Return Values Return Value: void
NA
Description: This service performs initialization of the PORT Driver component.
Configuration None
Dependency: Preconditions: None
41
Chapter 10 Application Programm ing Interface
10.3.2. Port_SetPinDirection Name: Port_SetPinDirection
FUNC (void, PORT_PUBLIC_CODE) Port_SetPinDirection (Port_PinType Pin,
Prototype: Port_PinDirectionType Direction)
Service ID: 0x01
Sync/Async: Synchronous
Reentrancy: Reentrant
Type Parameter Value/Range Parameters In: Port_PinType
Pin
0 to 65535
Port_PinDirectionType
Direction
PORT_PIN_OUT
PORT_PIN_IN
Parameters InOut: NA
NA
NA
Parameters out: NA
NA
NA
Type Possible Return Values Return Value: void
NA
Description: This service sets the port pin direction during runtime
Configuration Parameter PortSetPinDirectionApi should be configured as TRUE
Dependency: Preconditions: Ports should be initialized by calling Port_Init().
10.3.3. Port_RefreshPortDirection Name: Port_RefreshPortDirection
FUNC (void, PORT_PUBLIC_CODE) Port_RefreshPortDirection (void)
Prototype: Service ID: 0x02
Sync/Async: Synchronous
Reentrancy: Non-Reentrant
Type Parameter Value/Range Parameters In: NA
NA
NA
Parameters InOut: NA
NA
NA
Parameters out: NA
NA
NA
Type Possible Return Values Return Value: void
NA
Description: This service shall refresh the direction of all configured ports to the configured direction
Configuration None
Dependency: Preconditions: Ports should be initialized by calling Port_Init().
42
Application Programming Interface Chapter 10 10.3.4. Port_SetPinMode Name: Port_SetPinMode
FUNC (void, PORT_PUBLIC_CODE) Port_SetPinMode (Port_PinType Pin,
Prototype: Port_PinModeType Mode)
Service ID: 0x04
Sync/Async: Synchronous
Reentrancy: Reentrant
Type Parameter Value/Range Parameters In: Port_PinType
Pin
0 to 65535
Port_PinModeType
Mode
0 to 255
Parameters InOut: NA
NA
NA
Parameters out: NA
NA
NA
Type Possible Return Values Return Value: void
NA
Description: This function used to set the mode of a port pin during runtime.
Configuration Parameter PortSetPinModeApi should be configured as TRUE
Dependency: Preconditions: Ports should be initialized by calling Port_Init().
10.3.5. Port_GetVersionInfo Name: Port_GetVersionInfo
FUNC(void, PORT_PUBLIC_CODE) Port_GetVersionInfo
Prototype: (P2VAR(Std_VersionInfoType, AUTOMATIC, PORT_APPL_DATA)versioninfo)
Service ID: 0x03
Sync/Async: Synchronous
Reentrancy: Non-Reentrant
Type Parameter Value/Range Parameters In: NA
NA
NA
Parameters InOut: NA
NA
NA
Parameters out: Type Parameter Value/Range Std_VersionInfoType
versioninfo
NA
Type Possible Return Values Return Value: void
NA
Description: This API will store the version information of port module in the pointer versioninfo.
Configuration Parameter PortVersionInfoApi should be configured as TRUE
Dependency: Preconditions: None.
43
Chapter 10 Application Programm ing Interface
10.3.6. Port_SetToDioMode Name: Port_SetToDioMode
FUNC (void, PORT_PUBLIC_CODE) Port_SetToDioMode (Port_PinType Pin)
Prototype: Service ID: 0x05
Sync/Async: Synchronous
Reentrancy: Reentrant
Type Parameter Value/Range Parameters In: Port_PinType
Pin
0 to 65535
Parameters InOut: NA
NA
NA
Parameters Out: NA
NA
NA
Type Possible Return Values Return Value: void
NA
Description: This function used to set the mode of a port pin to DIO mode during runtime.
Configuration Parameter PortSetToDioAltModeApi should be configured as TRUE
Dependency: Preconditions: Ports should be initialized by calling Port_Init()
10.3.7. Port_SetToAlternateMode Name: Port_SetToAlternateMode
FUNC (void, PORT_PUBLIC_CODE) Port_SetToAlternateMode (Port_PinType
Prototype: Pin)
Service ID: 0x06
Sync/Async: Synchronous
Reentrancy: Reentrant
Type Parameter Value/Range Parameters In: Port_PinType
Pin
0 to 65535
Parameters InOut: NA
NA
NA
Parameters Out: NA
NA
NA
Type Possible Return Values Return Value: void
NA
Description: This function used to set the mode of a port pin to alternate mode during runtime.
Configuration Parameter PortSetToDioAltModeApi should be configured as TRUE
Dependency: Preconditions: Ports should be initialized by calling Port_Init()
44
Application Programming Interface Chapter 10 10.3.8. Port_SetPinDefaultDirection Name: Port_SetPinDefaultDirection
FUNC (void, PORT_PUBLIC_CODE) Port_SetPinDefaultDirection
Prototype: (Port_PinType Pin)
Service ID: 0x08
Sync/Async: Synchronous
Reentrancy: Reentrant
Type Parameter Value/Range Parameters In: Port_PinType
Pin
0 to 65535
Parameters InOut: NA
NA
NA
Parameters Out: NA
NA
NA
Type Possible Return Values Return Value: void
NA
Description: This service sets the port pin direction during runtime. The PORT Driver module allows
changing the direction of the pin to configured direction set by the configuration at the
time of Port_Init().
Configuration Parameter PortSetPinDefaultDirectionApi should be configured as TRUE
Dependency: Preconditions: Ports should be initialized by calling Port_Init()
10.3.9. Port_SetPinDefaultMode Name: Port_SetPinDefaultMode
FUNC (void, PORT_PUBLIC_CODE) Port_SetPinDefaultMode (Port_PinType
Prototype: Pin)
Service ID: 0x07
Sync/Async: Synchronous
Reentrancy: Reentrant
Type Parameter Value/Range Parameters In: Port_PinType
Pin
0 to 65535
Parameters InOut: NA
NA
NA
Parameters Out: NA
NA
NA
Type Possible Return Values Return Value: void
NA
Description: This function used to set the mode of a port pin during runtime. The PORT Driver module
allows changing the mode of the pin to default mode set by the configuration at the time
of Port_Init()
Configuration Parameter PortSetPinDefaultModeApi should be configured as TRUE
Dependency: Preconditions: Ports should be initialized by calling Port_Init()
45
Chapter 10 Application Programm ing Interface
46
Development And Production Errors Chapter 11 Chapter 11 Development And Production Errors In this section the development and production errors that are reported by the
PORT Driver Component are tabulated. The development errors will be
reported only when the pre compiler option PORT_DEV_ERROR_DETECT is
enabled in the configuration.
11.1. PORT Driver Component Development Errors The following table contains the DET errors that are reported by PORT Driver
Component. These errors are reported to Development Error Tracer Module
when the PORT Driver Component APIs are invoked with wrong input
parameters or without initialization of the driver.
Table 11-1 DET Errors of PORT Driver Component
Sl. No. 1 Error Code
PORT_E_PARAM_CONFIG
Related API(s)
Port_Init
Source of Error
API is invoked with NULL Pointer
Sl. No. 2 Error Code
PORT_E_INVALID_DATABASE
Related API(s)
Port_Init
Source of Error
Invalid database is found
Sl. No. 3 Error Code
PORT_E_UNINIT
Related API(s)
Port_RefreshPortDirection, Port_SetPinDirection, Port_SetPinMode,
Port_SetToDioMode, Port_SetToAlternateMode,
Port_SetPinDefaultMode, Port_SetPinDefaultDirection
Source of Error
APIs are invoked without the initialization of the PORT Driver Component.
Sl. No. 4 Error Code
PORT_E_PARAM_PIN
Related API(s)
Port_SetPinMode, Port_SetPinDirection, Port_SetToDioMode,
Port_SetToAlternateMode, Port_SetPinDefaultMode,
ort_SetPinDefaultDirection
Source of Error
API is invoked with invalid Pin
Sl. No. 5 Error Code
PORT_E_PARAM_INVALID_MODE
Related API(s)
Port_SetPinMode
Source of Error
API is invoked with invalid mode
Sl. No. 6 Error Code
PORT_E_DIRECTION_UNCHANGEABLE
Related API(s)
Port_SetPinDirection, Port_SetPinDefaultDirection
Source of Error
API is invoked with Pin which is not configured as ‘Direction Changeable during run
time’.
Sl. No. 7 Error Code
PORT_E_MODE_UNCHANGEABLE
47
Chapter 11 Development And Production Errors Related API(s)
Port_SetPinMode, Port_SetToDioMode, Port_SetToAlternateMode,
Port_SetPinDefaultMode
Source of Error
API is invoked with Pin which is not configured as ‘Mode Changeable during run time’.
Sl. No. 8 Error Code
PORT_E_PARAM_POINTER
Related API(s)
Port_GetVersionInfo
Source of Error
GetVersionInfo is called with NULL pointer.
11.2. PORT Driver Component Production Errors The following table contains the DEM errors that are reported by PORT
software component.
Table 11-2 DEM Errors of PORT Driver Component Sl. No. 1 Error Code
PORT_E_WRITE_TIMEOUT_FAILURE
Related API(s)
Port_Init ,Port_SetPinDirection
Source of Error
When writing to a write-protected register fails.
Sl. No. 2 Error Code
PORT_E_REG_WRITE_VERIFY
Related API(s)
Port_Init ,Port_SetPinDirection, Port_RefreshPortDirection, Port_SetPinMode,
Port_SetToDioMode, Port_SetToAlternateMode, Port_SetPinDefaultMode,
Port_SetPinDefaultDirection
Source of Error
When register write-verify fails.
48
Memory Organization Chapter 12 Chapter 12 Memory Organization Following picture depicts a typical memory organization, which must be met
for proper functioning of PORT Driver Component software.
PORT Driver Component ROM Section RAM Section Library / Object Files Global RAM of unspecific size required for Port
Port Driver code related to API’s are placed in
Driver functioning.
this memory.
X1
Y1
Segment Name:
Segment Name:
PORT_PUBLIC_CODE_ROM NO_INIT_RAM_UNSPECIFIED Global 1-bit RAM to be initialized by start-up
Port Driver code related to Internal Functions
code.
are placed in this memory
Segment Name:
Y2
X2
RAM_1BIT Segment Name:
PORT_PRIVATE_CODE_ROM Tool Generated Files The const section in the file Port_PBcfg.c is
placed in this memory.
X3
Segment Name:
PORT_CFG_DATA_UNSPECIFIED Figure 12-1 PORT Driver Component Memory Organization49
Chapter 12 Memory Organization
ROM Section (X1, X2, X3): PORT_PUBLIC_CODE_ROM (X1): API(s) of PORT Driver Component,
which can be located in code memory.
PORT_PRIVATE_CODE_ROM (X2): Internal functions of PORT Driver
Component code that can be located in code memory.
PORT_CFG_DATA_UNSPECIFIED (X3): This section consists of PORT
Driver Component constant configuration structures and database table of
contents generated by the PORT Driver Component Generation Tool. This
can be located in code memory.
RAM Section (Y1 and Y2): NO_INIT_RAM_UNSPECIFIED (Y1): This section consists of the global RAM
variables that are used internally by PORT Driver Component. This can be
located in data memory.
RAM_1BIT (Y2): This section consists of the global RAM variables of 1-bit
size that are used internally by PORT Driver Component. This can be located
in data memory.
50
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 PORT Driver Component The details of the services supported by the PORT Driver Component to the
upper layers users and the mapping of the channels to the hardware units is
provided in the following sections:
13.1.1. Translation Header File The translation header file supports following devices:
R7F701304
R7F701305
R7F701310
R7F701311
R7F701312
R7F701313
R7F701314
R7F701315
R7F701318
R7F701319
R7F701320
R7F701321
R7F701322
R7F701323
51








Chapter 13 P1M Specific Information 13.1.2. Parameter Definition File Parameter definition files support information for P1M
Table 13-1 PDF information for P1M PDF Files Devices Supported R403_PORT_P1M_04_05
701304, 701305
R403_PORT_P1M_10_11_14_15
701310, 701311, 701314, 701315
R403_PORT_P1M_12_13
701312, 701313
R403_PORT_P1M_18_19_22_23
701318, 701319, 701322, 701323
R403_PORT_P1M_20_21
701320, 701321
13.1.3. Services Provided By PORT Driver Component to the User The PORT Driver Component provides the following functionalities to the
upper layers or users:
To initialize the Port and set according Port filter functions.
To refresh the direction of Port.
To switch the Port pin direction at run time.
To change the mode of a Port pin at run time.
To read the PORT Driver Component version information.
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 PORT APIs can be invoked from the application.
Generic AUTOSAR TYPES
COMPILER
RH850 TYPES
Devices P1x PO R T
STUB
STUB
STUB
Sample
DET
DEM
SchM
application
Figure 13-1 Overview of PORT Driver Sample Application
52
P1M Specific Information Chapter 13 The Sample Application of the P1M is available in the path
X1X\P1x\modules\port\sample_application
The Sample Application consists of the following folder structure:
X1X\P1x\modules\port\definition\<AUTOSAR_version>\<SubVariant>\
R403_PORT_P1M_04_05.arxml
R403_PORT_P1M_10_11_14_15.arxml
R403_PORT_P1M_12_13.arxml
R403_PORT_P1M_18_19_22_23.arxml
R403_PORT_P1M_20_21.arxml
X1X\P1x\modules\port\sample_application\<SubVariant>\
<AUTOSAR_version>\
\src\Port_PBcfg.c
\include\Port_Cfg.h
\include\Port_Cbk.h
\config\App_PORT_P1M_701304_Sample.arxml
\config\App_PORT_P1M_701305_Sample.arxml
\config\App_PORT_P1M_701310_Sample.arxml
\config\App_PORT_P1M_701311_Sample.arxml
\config\App_PORT_P1M_701312_Sample.arxml
\config\App_PORT_P1M_701313_Sample.arxml
\config\App_PORT_P1M_701314_Sample.arxml
\config\App_PORT_P1M_701315_Sample.arxml
\config\App_PORT_P1M_701318_Sample.arxml
\config\App_PORT_P1M_701319_Sample.arxml
\config\App_PORT_P1M_701320_Sample.arxml
\config\App_PORT_P1M_701321_Sample.arxml
\config\App_PORT_P1M_701322_Sample.arxml
\config\App_PORT_P1M_701323_Sample.arxml
In the Sample Application all the PORT APIs are invoked in the following
sequence:
•
Port_GetVersionInfo: The API Port_GetVersionInfo is invoked to get the
version of the PORT Driver module with a variable of Std_VersionInfoType.
After the call of this API the passed parameter will get updated with the
PORT Driver version details.
•
Port_Init: The API Port_Init is invoked with a valid database address for the
proper initialization of the PORT Driver, all the PORT Driver control
registers and RAM variables will get initialized after this API is called.
•
Port_SetPinMode: This service sets the Port Pin mode during runtime.
•
Port_SetPinDirection - This service sets the direction of Port Pin during
runtime
•
Port_RefreshPortDirection: The API refreshes the direction of all ports to
the configured direction. It excludes those port pins from refreshing that
are configured as ‘pin direction changeable during runtime’ by invoking
internal API Port_RefreshPortInternal().
•
Port_SetPinDefaultDirection - This service will switch the port pin to the
default direction during runtime
•
Port_SetToDioMode: This function used to set the mode of a port pin to
53
Chapter 13 P1M Specific Information DIO mode during runtime.
•
Port_SetToAlternateMode : This function used to set the mode of a port
pin to Alternate mode during runtime.
•
Port_SetPinDefaultMode - This service sets the mode of Port Pin to default
mode during runtime
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_PORT_P1M_701318_Sample.arxml
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:
“X1X\P1x\common_family\make\<Compiler>”
Now execute the batch file SampleApp.bat with following parameters:
SampleApp.bat Port 4.0.3 <Device_name>
•
After this, the tool output files will be generated with the configuration
as
mentioned
in
App_PORT_P1M_701318_Sample.arxml file
available in the path:
“X1X\P1x\modules\port\sample_application\<SubVariant>\<AUTOSAR_ve
rsion>\config\App_PORT_P1M_701318_Sample.arxml”
•
After this, all the object files, map file and the executable file
App_PORT_P1M_Sample.out will be available in the output folder:
(“X1X\P1x\modules\port\sample_application\<SubVariant>
\obj\<Compiler>”)
•
The executable can be loaded into the debugger and the sample application
can be executed.
•
The initialization function initializes all ports and port pins with the
configuration set pointed by ConfigPtr by invoking internal API
Port_InitConfig(). This function should be called first in order to initialize the
port for use otherwise no operation can occur on the MCU ports and port
pins. This function is also called after reset, in order to reconfigure the ports
and port pins of the MCU.
•
Port_SetPinMode: This API will change the pin mode to the requested
mode.
•
Port_SetToDioMode: This API will set the mode of a pin to DIO mode.
54
P1M Specific Information Chapter 13 •
Port_SetToAlternateMode: This API will set the mode of a port pin to
Alternate mode.
•
Port_SetPinDirection: This API will change the direction of the pin to the
requested direction.
•
Port_RefreshPortDirection: This API will refresh all the port pins to the
configured value except the pins that are configured as pin direction
changeable during runtime.
Note: The <Device_name> indicates the device to be compiled, which can be
701304 or 701305 or 701310 or 701311 or 701312 or 701313 or
701314 or 701315 or 701318 or 701319 or 701320 or 701321 or
701322 or 701323.
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\port\sample_application\<SubVariant>
\<AUTOSAR_version>\config\App_PORT_P1M_701318_Sample.arxml”
•
The database alone can be generated by using the following commands.
make –f App_PORT_P1M_Sample.mak generate_port_config
make –f App_PORT_P1M_Sample.mak App_PORT_P1M_Sample.s37
•
After this, a flash able Motorola S-Record file
App_PORT_P1M_Sample.s37 is available in the output folder.
13.3. Memory and Throughput 13.3.1. ROM/RAM Usage The details of memory usage for the typical configuration, with DET disabled
as provided in Section 13.2.2.1
Configuration Example are provided in this
section.
Table 13-2 ROM/RAM Details without DET Sl. No. ROM/RAM Segment Name Size in bytes for Size in bytes for
701312 701318 1
ROM
PORT_PUBLIC_CODE_ROM
-
1140
PORT_PRIVATE_CODE_ROM
-
3050
PORT_CFG_DATA_UNSPECIFIED
-
610
2
RAM
RAM_1BIT
-
0
NO_INIT_RAM_UNSPECIFIED
-
4
The details of memory usage for the typical configuration, with DET enabled
and all other configurations as provided in 13.2.2.1
Configuration Example
are provided in this section.
55
Chapter 13 P1M Specific Information Table 13-3 ROM/RAM Details with DET Sl. No. ROM/RAM Segment Name Size in bytes Size in bytes for 701312 for 701318 1
ROM
PORT_PUBLIC_CODE_ROM
-
1468
PORT_PRIVATE_CODE_ROM
-
3372
PORT_CFG_DATA_UNSPECIFIED
-
628
2
RAM
RAM_1BIT
-
1
NO_INIT_RAM_UNSPECIFIED
-
4
13.3.2. Stack Depth The worst-case stack depth for PORT Driver Component for the typical
configuration provided in Section 13.2.2.1
Configuration Example is 48 byte
13.3.3. Throughput Details The throughput details of the APIs for the configuration mentioned in the
Section 13.2.2.1
Configuration Example will be provided in the next release.
The clock frequency used to measure the throughput is 80 MHz for all APIs.
Table 13-4 Throughput Details of the APIs Sl. No. API Name Throughput in Remarks microseconds for 701318 1
Port_Init
63.71
-
2
Port_RefreshPortDirection
3.96
-
3
Port_SetPinDirection
3.15
-
4
Port_GetVersionInfo
0.14
-
5
Port_SetPinMode
9.45
-
6
Port_SetToDioMode
1.99
-
7
Port_SetToAlternateMode
1.95
-
8
Port_SetPinDefaultDirection
1.50
-
9
Port_SetPinDefaultMode
7.35
-
56
Release Details Chapter 14 Chapter 14 Release Details
PORT Driver Software Version: 1.5.4
57
Chapter 14 Release Details
58
Revision History Sl.No. Description Version Date 1.
Initial Version
1.0.0
9-Oct-2013
2.
Following changes are made:
1.0.1
21-Nov-2013
1. Sample application is regenerated for the change in parameter
definition file.
2. Section 10.2.4 is updated for Port_PinModeType.
3.
Following changes are made:
1.0.2
31-Jan-2014
1. Chapter 2 is updated for referenced documents version.
2. Section 13.1.1 is updated for adding the device names.
3. Section 13.2 is updated for compiler, assembler and linker
details.
4. Section 13.3 is updated to add parameter definition file and
sample application configuration files for all P1M devices.
5. Chapter 14 is updated for PORT driver component version
information.
4.
Following changes are made:
1.0.3
03-Sep-2014
1. Chapter 2 is updated for referenced documents version.
2. Section 13.1.1 is updated for adding the device names.
3. Section 13.2 is updated for compiler, assembler and linker
details.
4. Section 13.3 is updated to add parameter definition file and
sample application configuration files for all P1M devices.
5. Chapter 14 is updated for PORT driver component version
information.
6. Deviation list is updated to add PORT_E_PARAM_POINTER
error foe Port_GetVersioInfo API and AUTOSAR requirement.
7. Memory and Throughput details are updated.
8. Section 10.2.1 is updated to add new structure element.
5.
Following changes are made:
1.0.4
05-Sep-2014
1. Section 13.4.3 updated for Throughput details.
2. Page alignment is updated.
3. Table of contents updated.
6.
Following changes are made:
1.0.5
29-Apr-2015
1. Section 1.1 Document Overview is updated.
2. Chapter 2 Reference documents are updated for version
change.
3. Chapter 4 is updated for information regarding Interrupt vector
table.
4. Chapter 6 Port_SetPinMode is updated.
5. Section 10.2.4 Port_PinModeType is updated.
6. Section 13.1.1 is updated for adding new devices.
7. Section 13.2 Compiler, Linker and Assembler section is
removed.
8. Section 13.2 is updated for parameter definition file and sample
application configuration files of all P1M devices.
9. Section 13.3 Memory and Throughput details are updated.
59
Sl.No. Description Version Date 7
Following changes are made:
1.0.6
29-Mar-2016
1. Chapter 2 Reference documents are updated for version
change.
2. Definitions in Page 6 is updated for "PORT Idle State"
3. Section 4.1 is updated for information “The parameter
PortDriveStrengthControl has dependency on parameter
PortUnlimitedCurrentControl while specifying the output driving
abilities of port pins”
4. Section 4.1 is updated for information “Port_SetToDioMode and
Port_SetPinDefaultMode Api shall not change or affect the level
of the requested pin” and information on accessing the Hardware
registers.
5. Section 4.4 is updated to add Exclusive areas.
6. Chapter 6, Table 6-1, Register Details is updated for Apis
Port_SetPinDirection, Port_SetPinMode, Port_InitConfig,
Port_SetToDioOrAltMode, Port_SetPinDefaultDirection and
Port_SetPinDefaultMode.
7. Chapter 8 is updated to add Stub C header files
8. Section 10.1.1 updated to add Std_ReturnType
9. Chapter 12 is updated to remove
PORT_CFG_DBTOC_UNSPECIFIED in ROM Section and in
Figure 12-1
10. Section 13.2.2 updated for correction in API names
11. Updated Chapter 13.3 ‘Memory and Throughput’.
12. Updated Chapter 14 ‘Release Details’ to change the driver
version.
13. Updated Chapter 3 and Chapter 9 to add R-Numbered Tool
User manual name.
14. Added R number at end of the document.
15. Copyright information is updated
8.
Following changes are made:
1.0.7
06-Jun-2016
1. Chapter 1 Introduction is updated.
2. Information on unused pins and Port Pin level inversion is
updated in Chapter 4.1 General.
3. The point regarding digital filter time delay has been removed
and the information on Port_GetVersionInfo is updated in 4.5
Deviation list.
4. Chapter 5 Architecture Details is updated with the
information on Port_GetVersionInfo.
5. Chapter 7 is updated with the information on PORT Driver
features.
6. Chapter 8 is updated to add the information about
Port_Cbk.h file.
7. Table 11-2 is updated to add the DEM error
PORT_E_REG_WRITE_VERIFY.
8. Table 11-1 is updated to add the DET error
PORT_E_PARAM_POINTER.
9. Chapter 14 Release Details is updated with Port Driver
Software version.
10. Section 4.3 is updated with note on critical section
11. Chapter 6 Register details is updated.
12. Section 13.2.1 and section 13.2.2 are updated.
13. Chapter 8 PORT Driver Component Header and Source File
Description is updated for adding stub files.
60
Sl.No. Description Version Date 14. Chapter 3 and 9 are updated with R-Numbered Tool User
manual name.
15. Version of R-number is updated at the end of document.
16. Memory section NOINIT_RAM_UNSPECIFIED is updated to
NO_INIT_RAM_UNSPECIFIED in Figure 12-1,Table 13-2
and 13-3.
17. Added precondition items about critical protection and
transient hardware faults in chapter 4.2 ‘Precondition’ and
worst case duration value is updated as Note in Chapter 4.4
Data Consistency.
18. Section 10.2.1 Port_ConfigType is updated.
19. Port_RegWrite.h added for the section 3.1.1, chapter 8 and
Table 8-1.
20. Table 4-2 PORT Driver Protected Resources List added in
the section 4.4.
21. Reference document updated in chapter 2.
22. In Page 6 definitions section is updated.
9.
Following changes are made:
1.0.8
24-Oct-2016
1.
Definitions section is updated.
2.
Chapter 14 is updated for PORT driver component version
information.
3.
Chapter 13.3 updated for ROM/RAM Usage,Stack Depth
and Throughput Details.
4.
Critical section value updated in the Table 4-2.
5.
Preconditions updated in section 4.2.
6. Port Pin level inversion information is updated in 4.5
Deviation list.
7. Section 4.1.General is updated with the information on
keyword STATIC.
8. Deviation regarding the parameter PortPinlevelValue of
JTag PortPin is added in the section 4.5.Deviation List
10
Following changes are made:
1.0.9
14-Feb-2017
1. Section 4.1.General is updated with the information on pin
level of output pin.
2. Deviation regarding the parameter PortPinlevelValue of
JTag PortPin is removed from the section 4.5.Deviation List
3. Abbreviation list is updated.
4. Section 10.3 Function Definitions is updated
5. Chapter 2 Reference documents is updated for device
manual name and version change.
6. Chapter 14 Release Details is updated with Port Driver
Software version.
7. Version of R-number is updated at the end of document
8. Notice is updated
9. Section 4.1.General is updated with the information on
default value of PortLoopTimeout
10. Section 13.2.2.2 is updated with 701318 device information
11. Chapter 3 and 9 are updated with R-Numbered Tool User
manual name.
12. Chapter 13.3. Memory and Throughput is updated
13. Known limitation added for user mode in the section 4.3
14. Macros PORT_MODE_DIO" and "PORT_MODE_ADJUST"
added in Section 10.2.4.
15. Information on Port_SetPinDefaultDirection and
Port_SetPinDefaultMode added in Chapter 5.
61
AUTOSAR MCAL R4.0.3 User's Manual PORT Driver Component Ver.1.0.9 Embedded User’s Manual Publication Date: Rev.1.01, February 14, 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

AUTOSAR MCAL R4.0.3
User’s Manual
R20UT3722EJ0101
Document Outline
6 - R20UT3723EJ0101-AUTOSAR
AUTOSAR MCAL R4.0 User's Manual8 - R20UT3723EJ0101-AUTOSARs


AUTOSAR MCAL R4.0.3
User’s Manual
PORT Driver Component Ver.1.0.9
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 AUTOSAR
AUTomotive Open System ARchitecture
BSWMDT
Basic Software Module Description Template
DEM
Diagnostic Event Manager
DIO
Digital Input Output
ECU
Electronic Control Unit
ICU
Input Capture Unit
Id/ID
Identifier
INTP
Interrupt
MCAL
Micro Controller Abstraction Layer
MCU
Micro Controller Unit
NMI
Non Maskable Interrupt
RUCG
Renesas Unified Code Generator
Rev.
Revision
XML
eXtensible Mark-up Language
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 PORT Driver Generation Tool. It is generated by ECU
File
Configuration Editor.
PORT
Represents a whole configurable port on a microcontroller device.
Sl.No
Serial Number.
Rev
Revision
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 PORT 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 ............................................................................................................. 27 8.3 Information Messages ........................................................................................................ 28 Chapter 9 Notes ................................................................................................. 29 7
List of Figures Figure 3-1 Overview of PORT Driver Generation Tool .................................................................. 13 List of Tables
Table 5-1 Output Files Description .................................................................................................... 17 Table 8-1 Parameters and Container related to error ERR124004 ................................................................ 23
8
Introduction Chapter 1 Chapter 1 Introduction The PORT Driver component provides the service for initializing the whole
PORT structure of the microcontroller.
The PORT Driver Component comprises of two sections as Embedded
Software and the Generation Tool to achieve scalability and configurability.
The document describes the features of the PORT Driver Generation Tool.
PORT Driver Generation Tool is a command line tool that extracts
information from ECU Configuration Description File and generates PORT
Driver C Source and C Header files (Port_Cfg.h, Port_Cbk.h and
Port_PBcfg.c)
This document contains information on the options, input and output files of
the PORT Driver Generation Tool. In addition, this manual covers a step-by-
step procedure for the usage of tool.
ECU Configuration Description File contains information about PORT
General Configuration, Port Pin Configurations.
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 (PORT Driver
Provides the component overview of PORT 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 PORT 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 PORT 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:
Sl.No. Title Version 1.
AUTOSAR_SWS_PortDriver.pdf
3.2.0
2.
P1x Parameter Definition File 1.0.5
R403_PORT_P1M_04_05.arxml
3.
P1x Parameter Definition File 1.0.6
R403_PORT_P1M_12_13.arxml
4.
P1x Parameter Definition File 1.0.5
R403_PORT_P1M_20_21.arxml
5.
P1x Parameter Definition File 1.0.5
R403_PORT_P1M_18_19_22_23.arxml
6.
P1x Parameter Definition File 1.0.8
R403_PORT_P1M_10_11_14_15.arxml
2.2 Trademark Notice Microsoft and Windows are trademarks/registered trademarks of Microsoft
Corporation.
11
Chapter 2 Reference 12
PORT Driver Generation Tool Overview Chapter 3 Chapter 3 PORT Driver Generation Tool Overview PORT Driver Generation Tool overview is shown below.
ECU Configuration RUCG Tool Description File, Port_Cfg.h, Translation XML Port_Cbk.h, File, BSWMDT Port_P Bcfg.c File and Configuration XM L File and and Port_X1x.dll Figure 3-1 Overview of PORT Driver Generation Tool RUCG Tool is a command line tool that provides scalability and
configurability for PORT Driver component. It accepts ECU Configuration
Description File(s) , BSWMDT File, Translation XML File, Configuration
XML File and Port_X1x.dll as input and generates the C Header and C
Source files (Port_Cfg.h,Port_Cbk.h and Port_PBcfg.c) for error free input
files.
Port_Cfg.h and Port_Cbk.h will be compiled and linked with PORT Driver
Component. Port_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.
PORT Driver Generation Tool extracts, analyzes the configuration details
provided in the input file and validates correctness of the data. Tool displays
appropriate context sensitive error messages for wrong input and exits. Tool
creates
the
Log
file
(Port.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: C
header Port_Cfg.h, Port_Cbk.h and C source Port_PBcfg.c file names.
Remark •
In case of errors the generation tool returns a 1, in case of no errors
the generation tool returns a 0.
•
PORT Driver Generation Tool uses “Common Published Information”
13
Chapter 3 PORT Driver Generation Tool Overview from PORT module specific BSWMDT File.This should not be
updated manually since it is “Static Configuration” file.
14
Input Files Chapter 4 Chapter 4 Input Files PORT Driver Generation Tool accepts ECU Configuration Description File(s),
Configuration XML file, BSWMDT File and Translation XML File as input.
PORT Driver Generation Tool needs information about PORT Driver
component. Hence ECU Configuration Description File should contain
configuration of PORT Driver component. 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 PORT Driver Generation Tool generates configuration details in C Header and
C Source files (Port_Cfg.h, Port_Cbk.h and Port_PBcfg.c).
The content of each output file is given in the table below:
Table 5-1 Output Files Description Output File Details Port_Cfg.h
This file contains the macro definitions for general configuration, total number of Port
Pins configured and configuration set handles. This file also includes the Port Pin
handles for each configuration set.
Port_Cbk.h
This file contains prototype declarations for PORT call back notification functions.
Port_PBcfg.c
This file contains structure for Port Pin Initialization, Port Pin Direction Switch and Port
Pin Direction Refresh during runtime.
Remark Output files generated by PORT 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 PORT Driver and DEM component related
configuration.
.
• Default Translation XML File (Port_X1x.trxml) should be present in same
location of Port_X1x.dll when the variant specific trxml file is not given as
input in command line.
• Default Configuration XML File (Port_X1x.cfgxml) must be present in
same location of Port_X1x.dll.
• If Translation XML File is not provided on the command line,
Port_X1x.trxml which is present in same location of Port_X1x.dll is
considered as ‘default’ Translation XML File.
• If Configuration XML File is not provided on the command line,
Port_X1x.cfgxml which is present in same location of Port_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 PORT 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 PORT Driver
Generation Tool. Otherwise Tool may not produce the expected results or
may lead to “errors/warnings/information messages”.
• If no configuration of certain port filter is done within this Port Module, the
device specific default settings will take effect on this filter.
• If user selects the alternate signal in the port group container, then the
respective port filter container should be configured. For example: If signal
NMI is selected in the port group container respective filter group
container has to be configured.
• The digital noise filter clock container ‘PortDigitalFilterClkCtrl’ should be
configured along with containers ‘PortDigitalFilterGroup’, if
‘PortDigitalFilterClkCtrl’ container exists.
• In case of multiple configuration sets, if any filter is configured in one
configuration set, then the same filter should be configured across all
configured multiple configuration sets.
• In post-build time, sub containers of PortFilterGroupConfig containers
should not be added or deleted.
• Edge/Level settings for External Interrupt (INTP) signals can be
overwritten by ICU component to change the default activation type and
19
Chapter 6 Precautions the type of activation at run-time.
• User has to make sure that the respective device specific configuration file
is used otherwise Tool may not produce the expected results or may lead
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 PORT 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 PORT 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 messages 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>: 124 - PORT Driver Module Id (124) 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 ERR124001: 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.
ERR124002: 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.
ERR124003: 'PORT Driver / DEM' Component is not present in the input
file(s). This error occurs, if PORT Driver or DEM component is not present in the
input ECU Configuration Description File(s).
ERR124004: 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 ERR124004 Parameter Name Container Name -
PortConfigSet
PortDevErrorDetect
PortSetPinDirectionApi
PortSetPinModeApi
PortVersionInfoApi
PortDeviceName
PortCriticalSectionProtection
PortGeneral
PortVersionCheckExternalModules
PortLoopTimeout
23
Chapter 8 Messages Parameter Name Container Name PortMaxMode
PortSetToDioAltModeApi
PortSetPinDefaultDirectionApi
PortWriteVerify
PortUseWriteVerifyErrorInterface
PortSetPinDefaultModeApi
PortPinDirection
PortPinDirectionChangeable
PortPinLevelValue
‘Port Group’ container
Where in ‘Port Group container': PortGroup<Group
PortPinInitialMode
number/Alphabetic name> for PortPin<Pin number>.
PortInputBufferControl
E.g. PortGroup0
PortPin0,
PortBiDirectionControl
PortGroup1
PortPullUpOption
PortPin1,
PortPullDownOption
PortGroupJtag0
PortPin0 etc.
PortInputSelection
PortIpControl
PortInputSelection
PortOutputDriveStrength
PortPinModeChangeable
PortOpenDrainControl_Expansion
PortOutputLevelInversion
PortPinDioAltModeChangeable
-
PortFilterGroupConfig
PortSameLevelSamples
Digital Filter Container PortDigitalFilterGroup<Filter
Group number> Ex: PortDigitalFilterGroup0,
PortSamplingClockFrequency
PortDigitalFilterGroup1... etc
PortDigitalFilterEnableInput(X) where X= 0-7
PortDigitalFilterEdgeControl(Y) where Y =0-5
PortDigitalFilterModeSelection
PORT_E_WRITE_TIMEOUT_FAILURE
PortDemEventParameterRefs
PortClockSource<Filter clock source selection
SamplingClockSourceSelection
number>
ERR124005: The number of configuration sets configured for 'PORT'
and 'MCU' modules should be same.
This error occurs, if the number of configuration sets configured for PORT and
MCU modules are not same.
ERR124007: Short name of ‘Port Group container’ container should
be same across all configuration sets. This error occurs, if short name of ‘Port Group container’ container is not same
across all configuration sets.
ERR124008: Short name of ' Port Pin container’ should be same across all
configuration sets.
This error occurs, if short name of ‘Port Pin container’ is not same across all
configuration sets.
24
Messages Chapter 8 ERR124009: The value for parameter 'PortPinModeChangeable' from ‘Port Group Container’ container should not be configured as <true>
as the value for parameter ‘PortSetPinModeApi’ in the container ‘PortGeneral’ is configured as <false>. This error occurs, if the parameter PortSetPinModeApi in the container
PortGeneral is configured as false and parameter PortPinModeChangeable is
configured as true for at least one of the ‘Port Group container’ container.
ERR124010: The value for parameter 'PortInputBufferControl' of the
'PortPin[X]' container should not be configured as <true> as either
configured value for parameter 'PortPinDirection' of the same container
is configured as <PORT_PIN_OUT> or parameter 'PortPinInitialMode'
is configured as '<value of PortPinInitialMode>' and parameters
'PortPinDirectionChangeable', 'PortPinDioAltModeChangeable'
'PortPinModeChangeable' are configured <FALSE>.
This error will occur,if PortInputBufferControl configured as true when
PortPinInitialMode is OUT mode or PortPinDirection is PORT_PIN_OUT and
none
of
the
corresponding
runtime
changeable
features
[
PortPinDirectionChangeable,
PortPinDioAltModeChangeable,
PortPinModeChangeable] is made true.
ERR124011: The value for parameter ‘PortPinDirectionChangeable’ for
any ‘Port Group Container’ container should not be configured as <true>
as the value for parameter ‘PortSetPinDirectionApi’ in the container ‘PortGeneral’ is configured as <false>. This error occurs, if the parameter PortSetPinDirectionApi in the container
PortGeneral is configured as false and parameter PortPinDirectionChangeable
is configured as true for at least one of the ‘Port Group container’ container.
ERR124012: The reference path <path> provided for the parameter
'PORT_E_WRITE_TIMEOUT_FAILURE' within the container
'PortDemEventParameterRefs' is incorrect.
This error occurs, if the path provided for parameter
PORT_E_WRITE_TIMEOUT_FAILURE
in
the
container
PortDemEventParameterRefs is
incorrect.
ERR124013: Value of the parameter 'PortPinInitialMode' of 'Port
Group container' 'Port Pin container' container should not be
configured as <value of PortPinInitialMode>, since the parameter 'PortPinDioAltModeChangeable' of same container is configured as <true>. This error occurs, if the parameter PortPinInitialMode of the ‘Port Group
container’ is configured as DIO and parameter PortPinDioAltModeChangeable
of the same ‘Port Group container’ container is true.
ERR124014: The value for parameter ‘PortPinDioAltModeChangeable’ for
any ‘Port Group Container’ container should not be configured as <true>
as the value for parameter ‘PortSetToDioAltModeApi’ in the container
‘PortGeneral’ is configured as <false>.
This error occurs, if the parameter PortSetToDioAltModeApi in the container
PortGeneral
is
configured
as
false
and
parameter
PortPinDioAltModeChangeable is configured as true for at least one of the
25
Chapter 8 Messages ‘Port Group container’ container.
ERR124015: The value for parameter 'PortSetPinDefaultDirectionApi'
from 'PortGeneral' container should not be configured as <true> as the
value for parameter 'PortSetPinDirectionApi' in the container
'PortGeneral' is configured as <false>.
This error will occur, if the parameter PortSetPinDirectionApi in the container
PortGeneral
is
configured
as
false
and
parameter
PortSetPinDefaultDirectionApi in the PortGeneral container PortGeneral is
configured as true.
ERR124016: The value for parameter 'PortSetPinDefaultModeApi' from
'PortGeneral' container should not be configured as <true> as the value
for parameter 'PortSetPinModeApi' in the container 'PortGeneral' is
configured as <false>. This error will occur, if the parameter PortSetPinModeApi in the container
PortGeneral is configured as false and parameter PortSetPinDefaultModeApi
in the PortGeneral container PortGeneral is configured as true.
ERR124018: The configured value of the parameter ‘PortPinInitialMode’
of the container ‘PortPin1’ is incorrect, since the parameter
‘PortIpControl’ is configured as <true> and ‘PortPinInitialMode’ is
configured as <>. This error will occur, if the parameter PortIpControl in the container PortGroup
is configured as true and parameter PortPinInitialMode of the same PortGroup
container is configured as any mode except the one for which the parameter
PortIpControl is required to be TRUE.
ERR124019: The value of the parameter‘PORT_E_REG_WRITE_VERIFY’
should be configured in the container ‘PortDemEventParameterRefs’
when the parameter ‘PortWriteVerify’ is configured as <TRUE> in the
‘PortGeneral’ container
This error occurs, if DEM parameter PORT_E_REG_WRITE_VERIFY path is
not configured in PortDemEventParameterRefs container when parameter
‘PortWriteVerify’ is configured as true in PortGeneral container.
ERR124020: As write-verify check is enabled through the parameter
PortWriteVerify in PortGeneral container and
PortUseWriteVerifyErrorInterface is configured as true,
PortWriteVerifyErrorInterface should have valid error notification. This
error
will
occur,
if
the
parameters
PortWriteVerify
and
PortUseWriteVerifyErrorInterface in PortGeneral container is configured as
true and valid notification name is not configured for the parameter
PortWriteVerifyErrorInterface.
ERR124021: The reference path <Value of path > configured for the
parameter 'PORT_E_REG_WRITE_VERIFY' in the container
'PortDemEventParameterRefs', short name of the DEM container is
incorrect.
This error occurs, if the path provided for the DEM parameter
'PORT_E_REG_WRITE_VERIFY'
inside
‘PortDemEventParameterRefs’
container is wrong when the parameter ‘PortWriteVerify’ in the ‘PortGeneral '
container is configured as True.
26
Messages Chapter 8 ERR124022: As write-verify check is disabled in the parameter
‘PortWriteVerify’ and ‘
PortUseWriteVerifyErrorInterface’ parameter
should not be configured as true in PortGeneral Container.
This error will occur, if the parameter ‘PortUseWriteVerifyErrorInterface’ is
configured as true when the parameter ‘PortWriteVerify’ is disabled in the
PortGeneral Container.
ERR124023: In PortConfigSet container If any PortDigitalFilterGroup is
configured,then the container SamplingClockSourceSelection inside
PortFilterGroupConfig should be configured.
This error will occur, if any of the PortDigitalFilterGroup is configured and the
container SamplingClockSourceSelection inside the PortFilterGroupConfig is
not configured.
ERR124024: In PortConfigSet container If any PortDigitalFilterGroup is
configured,then the parameter PortDigitalFilterClockSelection inside
the PortFilterGroupConfig container should be configured.
This error will occur,if any of the PortDigitalFilterGroup is configured and the
parameter PortDigitalFilterClockSelection inside the PortFilterGroupConfig
container is not configured.
ERR124025: The reference path <PortDigitalFilterClockSelectionPath>
provided for the parameter within the container 'PortFilterGroupConfig'
is incorrect.
This error will occur, if the reference path provided for the parameter
PortDigitalFilterClockSelection within the container 'PortFilterGroupConfig' is
incorrect.
ERR124026: If any PortDigitalFilterGroup is configured,then the
parameter PortDigitalFilterClockSelection should be present and
configured inside the PortFilterGroupConfig container. This error will occur, if any of the PortDigitalFilterGroup container is configured
and
the
parameter
PortDigitalFilterClockSelection
inside
the
PortFilterGroupConfig container is not present.
ERR124027: The parameters 'PortPullUpOption' and
'PortPullDownOption' should not be configured as <true> at the same
time. This error will occur, if the parameters 'PortPullUpOption' and
'PortPullDownOption' configured as <true> at the same time in PortPin
container of any PortGroup.
8.2 Warning Messages WRN124001: The parameter ‘PortPinDirection’ of container ‘Port
Group container’ should not be configured as <PORT_PIN_OUT>,
since the parameter ‘PortPinInitialMode’ of the same ‘Port Group
container’ container is configured as an Input type mode. The value
for parameter ‘PortPinDirection’ is considered as <PORT_PIN_IN>.
27
Chapter 8 Messages This warning occurs, if value configured for the parameter PortPinDirection is
Output and value configured for the parameter PortPinInitialMode is of Input
type mode. The value of the parameter PortPinDirection will be considered as
Input.
WRN124002: The parameter ‘PortPinDirection’ of container ‘Port
Group container’ should not be configured as <PORT_PIN_IN>, since
the parameter ‘PortPinInitialMode’ of the same ‘Port Group container’ container 'is configured as an Output type mode. The value for
parameter ‘PortPinDirection’ is considered as <PORT_PIN_OUT>.
This warning occurs, if value configured for the parameter PortPinDirection is
Input and value configured for the parameter PortPinInitialMode is of Output
type mode. The value of the parameter PortPinDirection will be considered as
Output.
WRN124006: The values configured in SamplingClockSourceSelection
container are ignored since no PortDigitalFilterGroup container is
configured.
This
warning
will
occur
if
the
values
configured
for
SamplingClockSourceSelection
container
are
ignored
when
no
PortDigitalFilterGroup container is configured.
8.3 Information Messages None.
28
Notes Chapter 9 Chapter 9 Notes “Generation Tool” and “Tool” terminologies are used interchangeably to refer
PORT Driver Generation Tool.
29
Chapter 9 Notes 30
Revision History
Sl.No. Description Version Date 1.
Initial Version
1.0.0
08-Oct-2013
2.
Following change is made:
1.0.1
21-Nov-2013
•
Error message ERR124004 is updated for addition of
PortDemEventParameterRefs container.
3.
Following changes are made:
1.0.2
28-Jan-2014
•
Error messages ERR124003, ERR124005, ERR124006,
ERR124008 and ERR124014 are added in section 8.1.
•
Error message ERR124004 is updated in section 8.1.
•
Warning messages WRN124003, WRN124005 are updated in
section 8.2.
4.
Following changes are made:
1.0.3
12-Mar-2014
•
Error messages ERR124004 is updated in section 8.1 for the
removal of PortPinStatusBackup parameter.
•
The error message ERR124006 and the warning message
WRN124004 are deleted from chapter 8.
5.
Following changes are made:
1.0.4
27-Aug-2014
•
Error messages ERR124015 and ERR124016 are added newly in
section 8.1.
•
Error message ERR124004 is updated for addition of
SamplingClockSourceSelection container and
PortSetPinDefaultDirectionApi and PortSetPinDefaultModeApi
parameters in PortGeneral container.
•
The warning message WRN124006 is added newly in section 8.3
.
•
Reference Documents section is updated for addition of Parameter
definition file reference in chapter 2.
•
Precautions chapter is updated.
6.
Following changes are made:
1.0.5
29-Apr-2015
•
Parameter definition file names and versions are updated in
section 2.1.
•
Error message ERR124018 is added in section 8.1.
7.
Following changes are made:
1.0.6
29-Mar-2016
•
Parameter definition file name versions are updated in section 2.1.
•
Description for error message ERR124010 is updated in section
8.1.
•
Port_X1x.exe is replaced with Port_X1x.dll in Chapter 6
•
ERR124004 is updated to remove parameter PortDemErrorDetect
from container PortGeneral
•
Added R number at end of the document
•
Chapter 3 is updated for Figure 3-1
•
Copyright information is updated
31
Sl.No. Description Version Date 8.
Following changes are made:
1.0.7
11-Jul-2016
•
Parameter definition file name versions are updated in section 2.1
•
Port_Cbk.h information added in the chapter 1,3 and 5.
•
Error message ERR124019 to ERR124027 are added in section
8.1.
•
R number is updated at end of the document
9.
Following changes are made:
1.0.8
24-Oct-2016
•
Warning messages WRN124003 and WRN124005 are removed
from section 8.2.
•
Table number is added for table present in Chapter 8.1 Error
Messages.
•
Parameter definition file name versions are updated in section 2.1
•
Parameters PortDriveStrengthControl and
PortUnlimitedCurrentControl are removed and
PortOutputDriveStrength is added to the Table 8-1
10.
Following changes are made:
1.0.9
14-Feb-2017
•
Abbreviation list is updated.
•
R number is updated at end of the document
•
Notice is updated
•
Version of Parameter definition files updated in the section
2.1.Reference Documents
32
33
AUTOSAR MCAL R4.0.3 User's Manual PORT Driver Component Ver.1.0.9 Generation Tool User's Manual Publication Date: Rev.1.01, February 14, 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

AUTOSAR MCAL R4.0.3
User’s Manual
R20UT3723EJ0101
Document Outline
9 - R20UT3754EJ0101-AUTOSAR
RUCG Tool User's Manual11 - 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.
websit
e (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 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.
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 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 7
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 8
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.
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 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 1
Initial Version
1.0.0
7-Nov-2015
2
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).
3
Reference section is updated with correct document name.
1.1.1
7-Apr-2016
4
R-Number corrected for the document
1.1.2
13-Jul-2016
5
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