SPI Handler Driver
SPI Handler Driver
Component Documentation
1 - R20UT3726EJ0101-AUTOSAR
AUTOSAR MCAL R4.0 User's Manual3 - R20UT3726EJ0101-AUTOSARs


AUTOSAR MCAL R4.0.3
User’s Manual
SPI Driver Component Ver.1.0.12
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 Mar 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 3
4
Abbreviations and Acronyms Abbreviation / Acronym Description ANSI
American National Standards Institute
API
Application Programming Interface
ARXML/arxml
AutosaR eXtensible Mark-up Language
ASIC
Application Specific Integration Circuit
AUTOSAR
AUTomotive Open System Architecture
BSW
Basic SoftWare
CPU
Central Processing Unit
CS
Chip Select
CSIH/CSIG
Enhanced Queued Clocked Serial Interface.
DEM/Dem
Diagnostic Event Manager
DET/Det
Development Error Tracer
DMA
Direct Memory Access
EB
External Buffer
ECU
Electronic Control Unit
EEPROM
Electrically Erasable Programmable Read-Only Memory
FIFO
First In First Out
GNU
GNU’s Not Unix
GPT
General Purpose Timer
HW
HardWare
IB
Internal Buffer
Id
Identifier
I/O
Input/Output
ISR
Interrupt Service Routine
MCAL
Microcontroller Abstraction Layer
MHz
Mega Hertz
MCU
Microcontroller unit
NA
Not Applicable
PLL
Phase Locked Loop
RAM
Random Access Memory
ROM
Read Only Memory
RTE
Run Time Environment
SPI
Serial Peripheral Interface
PDF
Parameter Definition File
DIO
Digital Input Output
WDT
Watchdog Timer
RUCG
Renesas Unified Code Generator
μC
Micro controller
XML
eXtensible Mark-up Language
ICU
Input Capture Unit
CAN
Controller Area Network
BUS
BUS Network
5
PWM
Pulse Width Modulation
PORT
Represents a whole configurable port on a microcontroller device
ADC
Analog to Digital Converter
LIN
Local Interconnect Network
Definitions Term Represented by Sl. No.
Serial Number
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. SPI Driver Component Makefile ............................................................................................. 17 Chapter 4 Forethoughts ..................................................................... 19 4.1. General...................................................................................................................................... 19 4.2. Preconditions ........................................................................................................................... 27 4.3. User Mode and Supervisor Mode ........................................................................................... 28 4.4. Memory modes ........................................................................................................................ 29 4.5. Data Consistency ..................................................................................................................... 30 4.6. Deviation List ........................................................................................................................... 31 Chapter 5 Architecture Details .......................................................... 33 Chapter 6 Registers Details ............................................................... 37 Chapter 7 Interaction Between The User And SPI Driver Component ............................................................................................ 49 7.1. Services Provided By SPI Driver Component To The User................................................. 49 Chapter 8 SPI Driver Component Header And Source File Description ............................................................................................ 51 Chapter 9 Generation Tool Guide ...................................................... 55 Chapter 10 Application Programming Interface ................................. 57 10.1 Imported Types .............................................................................................................................. 57 10.1.1 Standard Types ............................................................................................................ 57 10.1.2 Other Module Types ..................................................................................................... 57 10.2 Type Definitions .............................................................................................................................. 57 Spi_ConfigType ........................................................................................................... 57 Spi_StatusType ........................................................................................................... 57 Spi_JobResultType ...................................................................................................... 58 Spi_SeqResultType ..................................................................................................... 58 Spi_DataType .............................................................................................................. 58 Spi_NumberOfDataType ............................................................................................. 58 Spi_ChannelType ........................................................................................................ 59 Spi_JobType ................................................................................................................ 59 Spi_SequenceType ..................................................................................................... 59 7





Spi_HWUnitType ....................................................................................................... 59 Spi_AsyncModeType ................................................................................................. 59 Spi_CommErrorType ................................................................................................. 59 Spi_HWErrorsType .................................................................................................... 60 Spi_SelfTestType ...................................................................................................... 60 Spi_ReturnStatus ....................................................................................................... 60 10.3 Function Definitions ....................................................................................................................... 61 10.3.1 Spi_Init ........................................................................................................................ 61 10.3.2 Spi_DeInit .................................................................................................................... 62 10.3.3 Spi_WriteIB ................................................................................................................. 62 10.3.4 Spi_AsyncTransmit ..................................................................................................... 63 10.3.5 Spi_ReadIB ................................................................................................................. 63 10.3.6 Spi_SetupEB ............................................................................................................... 64 10.3.7 Spi_GetStatus ............................................................................................................. 64 10.3.8 Spi_GetJobResult ....................................................................................................... 65 10.3.9 Spi_GetSequenceResult ............................................................................................. 65 10.3.10 Spi_SyncTransmit ..................................................................................................... 66 10.3.11 Spi_GetHWUnitStatus ............................................................................................... 66 10.3.12 Spi_Cancel ................................................................................................................ 67 10.3.13 Spi_SetAsyncMode ................................................................................................... 67 10.3.14 Spi_GetVersionInfo ................................................................................................... 68 10.3.15 Spi_MainFunction_Handling ..................................................................................... 69 10.3.16 Spi_SelfTest .............................................................................................................. 69 10.3.17 Spi_GetErrorInfo ....................................................................................................... 70 Chapter 11 Development And Production Errors .............................. 71 11.1 SPI Driver Component Development Errors ......................................................................... 71 11.2 SPI Driver Component Production Errors............................................................................. 72 11.3 SPI Driver Hardware Errors .................................................................................................... 73 11.3.1 Data Consistency Check .............................................................................................. 73 11.3.2 Parity Check ................................................................................................................. 73 11.3.3 Overrun ........................................................................................................................ 73 Chapter 12 Memory Organization ....................................................... 75 Chapter 13 P1M Specific Information ................................................. 79 13.1. Interaction Between The User And SPI Driver Component ................................................. 79 13.1.1 Translation Header File .............................................................................................. 79 13.1.2 Parameter Definition File ............................................................................................ 79 13.1.3 ISR Function ............................................................................................................... 80 13.2. Sample Application ................................................................................................................. 82 8
13.2.1 Sample Application Structure ..................................................................................... 82 13.2.2 Building Sample Application ....................................................................................... 84 13.2.2.1 Configuration Example ............................................................................. 84 13.2.2.2 Debugging The Sample Application ......................................................... 84 13.3. Memory And Throughput ........................................................................................................ 85 13.3.1 ROM/RAM Usage ....................................................................................................... 85 13.3.2 Stack Depth ................................................................................................................ 86 13.3.3 Throughput Details ..................................................................................................... 86 Chapter 14 Release Details .................................................................. 87 9
List Of Figures Figure 1-1 System Overview Of AUTOSAR Architecture ....................................................... 11 Figure 1-2 System Overview Of The SPI Driver In AUTOSAR MCAL Layer .......................... 12 Figure 4-1 Chip select behavior when SpiCSInactiveAfterlastdata is False and
SpiCsIdleEnforcement is True ............................................................................... 21 Figure 4-2 Chip select behavior when SpiCSInactiveAfterlastdata is True and
SpiCsIdleEnforcement is True ............................................................................... 22 Figure 4-3 Chip select behavior when SpiCSInactiveAfterlastdata is True and
SpiCsIdleEnforcement is False.............................................................................. 22 Figure 4-4 Chip select behavior when SpiCSInactiveAfterlastdata is False and
SpiCsIdleEnforcement is False.............................................................................. 23 Figure 5-1 SPI Driver Architecture .......................................................................................... 33 Figure 5-2 Component Overview Of SPI Driver Component .................................................. 34 Figure 13-1 Overview Of SPI Driver Sample Application .......................................................... 82 List Of Tables
Table 4-1 Table for Chip Select behavior .............................................................................. 21 Table 4-2 List of parameters in Channel container that are linked to the registers. .............. 24 Table 4-3 List of parameters in Job container that are linked to the registers. ...................... 24 Table 4-4 List of parameters in External Device container that are linked to the registers. .. 25 Table 4-5 User Mode and Supervisory Mode ........................................................................ 28 Table 4-6 HW unit and Memory Mode Selection ................................................................... 29 Table 4-7 SPI Driver Protected Resources List ..................................................................... 30 Table 4-8 SPI Driver Deviation List ........................................................................................ 31 Table 6-1 Register Details...................................................................................................... 37 Table 8-1 Description Of The SPI Driver Component Files ................................................... 52 Table 10-1 The APIs provided by the SPI Driver Component .................................................. 61
Table 11-1 DET Errors Of SPI Driver Component ................................................................... 71 Table 11-2 DEM Errors Of SPI Driver Component .................................................................. 72 Table 13-1 PDF information for P1M ....................................................................................... 79 Table 13-2 Interrupt Handler .................................................................................................... 80 Table 13-3 ROM/RAM Details without DET ............................................................................. 85 Table 13-4 ROM/RAM Details with DET .................................................................................. 85 Table 13-5 Throughput Details Of The APIs ............................................................................ 86 10
Introduction Chapter 1 Chapter 1 Introduction The purpose of this document is to describe the information related to SPI
Driver Component for Renesas P1x microcontrollers.
This document shall be used as reference by the users of SPI Driver
Component. The system overview of complete AUTOSAR architecture is
shown in the below Figure:
Application Layer
AUTOSAR RTE
System Services
On board Device Abstraction
SPI Driver Microcontroller
Figure 1-1 System Overview Of AUTOSAR Architecture The SPI Driver is part of the Microcontroller Abstraction Layer (MCAL), the
lowest layer of Basic Software in the AUTOSAR environment.
11
Chapter 1 Introduction The Figure in the following page depicts the SPI Driver as part of layered
AUTOSAR MCAL Layer:
M icrocont roller Drivers
M e mo r y Drivers
Communication Drivers
I/O Drivers
in
e
in
ter
x
SW
te
te
n
Pat
G
M
r
r
a
IF
n
n
l
c
C
R
P
C
a
a
HE
LI
C
le
P
P
h
o
AM
T
U
l
l
aAN
x
A
I
D
O
d
E
N
re
F
F
nR
C
W
D
I
Dr
o
P
D
g
l
l
d U
O
R
a
a
D
a
M
C
R
i
r
T
T
lD
y
T
s
s
er
D
v
D
iv
e
e
h
h
OM
i
D
D
rv
r
D
D
D
e
r
e
s
s
i
r
r
i
v
r
t
t
D
D
De
v
i
r
r
r
v
r
i
i
r
e
i
i
v
v
r
er
r
r
v
e
v
i
r r
e
e
v
i
i
D
i er
r
e
v
v
v r
r
e
r
er
er
ri
er r
v
e
r
P
E
Micro - F
E
D
W
C
G
o
x
L
M
U
U
L
EP
C
I
P
A
I
lo
w
t.
S
S
IN
C
O
PT
n
N D
n
C
A
M
C
A
W
D
P
e
Controller B
U
i
T
i
c
S
R
t
t
k
r
U
U
I
or
N
M
C
I
H
O
&
S
Figure 1-2 System Overview Of The SPI Driver In AUTOSAR MCAL Layer The SPI Driver Component comprises Embedded software and the
Configuration Tool to achieve scalability and configurability.
The SPI Driver component code Generation Tool is a command line tool that accepts ECU
configuration description files as input and generates source and header files. The
configuration description is an ARXML file that contains information about the configuration for
SPI Driver. The tool generates the Spi_PBcfg.c, Spi_Lcfg.c, Spi_Cfg.h and Spi_Cbk.h.
The SPI driver provides services for reading from and writing to devices connected
through SPI buses. It provides access to SPI communication to several users (For
example, EEPROM, I/O ASICs). It also provides the required mechanism to configure the
on-chip SPI peripheral.
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 SPI 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, Makefile structure for SPI
Process)
Driver Component. This section also explains about the Makefile
descriptions, Integration of SPI Driver Component with other
components, building the SPI Driver Component along with a sample
application.
Section 4 (Forethoughts)
This section provides brief information about the SPI Driver Component,
the preconditions that should be known to the user before it is used,
memory modes, data consistency details, deviation list and Support For
Different Interrupt Categories.
Section 5 (Architecture Details)
This section describes the layered architectural details of the SPI Driver
Component.
Section 6 (Register Details)
This section describes the register details of SPI Driver Component.
Section 7 (Interaction Between
This section describes interaction of the SPI Driver Component with the
User And SPI Driver Component) upper layers.
Section 8 (SPI Driver Component This section provides information about the SPI Driver Component
Header And Source File
source files is mentioned. This section also contains the brief note on the
Description)
tool generated output file.
Section 9 (Generation Tool Guide) This section provides information on the SPI Driver Component Code
Generation Tool.
Section 10 (Application
This section explains all the APIs provided by the SPI Driver Component.
Programming Interface)
Section 11 (Development And
This section lists the DET ,DEM errors and hardware errors.
Production Errors)
Section 12 (Memory
This section provides the typical memory organization, which must be
Organization)
met for proper functioning of component.
Section 13(P1M
This section provides P1M specific information also the information
Specific information)
about linker compiler and sample application.
Section 14 (Release Details)
This section provides release details with version name and base
version.
13
Chapter 1 Introduction 14
Reference Documents Chapter 2 Chapter 2 Reference Documents Sl. No. Title Version 1.
Autosar R4.0
3.2.0
AUTOSAR_SWS_SPIHandlerDriver.pdf
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.
r01uh0436ej0120_rh850p1x.pdf
1.20
4.
Autosar R4.0
3.2.0
AUTOSAR_SWS_CompilerAbstraction.pdf
5.
Autosar R4.0
1.4.0
AUTOSAR_SWS_MemoryMapping.pdf
6.
Autosar R4.0
2.5.0
AUTOSAR_SWS_PlatformTypes.pdf
7.
Autosar R4.0
0.3
AUTOSAR_BSW_MakefileInterface.pdf
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 SPI Driver Component is explained.
Description of the Makefiles along with samples is provided in this section.
Remark The details about the C Source and Header files that are generated by the
SPI Driver Generation Tool are mentioned in the
“R20UT3727EJ0101-AUTOSAR.pdf”.
3.1. SPI Driver Component Makefile The Makefile provided with the SPI Driver Component consists of the GNU
Make compatible script to build the SPI 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\spi\src\ Spi_Driver.c
\ Spi.c
\ Spi_Scheduler.c
\Spi_Irq.c
\Spi_Ram.c
\Spi_Version.c
X1X\common_platform\modules\spi\include\Spi_Driver.h
\Spi.h
\Spi_Scheduler.h
\Spi_Irq.h
\Spi_LTTypes.h
\Spi_PBTypes.h
\Spi_Ram.h
\Spi_Version.h
\Spi_Types.h
\Spi_RegWrite.h
X1X\P1x\modules\spi\Sample_application\<SubVariant>\make\<Compiler>
\App_SPI_P1M_Sample.mak
17
Chapter 3 Integration And Build Process X1X\P1x\modules\spi\Sample_application\<SubVariant>\obj\ <compiler>
X1X\common_platform\modules\spi\generator\Spi_X1x.dll
X1X\common_platform\modules\spi\generator\ Spi_X1x.cfgxml
tools/RUCG/RUCG.exe
X1X\P1x\common_family\generator
\Sample_Application_P1x.trxml
\P1x_translation.h
X1X\P1x\modules\spi\generator
\R403_SPI_P1x_BSWMDT.arxml
X1X\P1x\modules\spi\user_manual
(User manuals will be available in this folder)
Notes: 1. <Compiler> can be ghs.
2. <SubVariant> can be P1M.
3. <AUTOSAR_version> can be 4.0.3.
18
Forethoughts Chapter 4 Chapter 4 Forethoughts 4.1. General Following information will aid the user to use the SPI Driver Component
software efficiently:
•
SPI Driver component does not take care of setting the registers which
configure clock, prescaler and PLL.
•
SPI Driver component handles only the Master mode.
•
SPI Driver component supports full-duplex mode.
•
The chip select is implemented using the microcontroller pins and it is
configurable.
•
The required initialization of the port pins configured for chip select has to
be performed by the Port Driver Component.
•
The microcontroller pins used for chip select is directly accessed by the SPI
Driver component without using the APIs of DIO module.
•
The SPI Handler/Driver interface configuration is based on Channels, Jobs
and Sequences.The Data transmissions will be done according to Channels,
Jobs and Sequences configuration parameters.
•
Maximum number of channels and sequences configurable is 256 and job
is 65536.
•
The scope is restricted to post-build with multiple configuration sets.
•
The identifiers for channels, jobs and sequences entered by the user should
start from 0 and should be continuous.
•
The width of the transmitted data unit is configurable and the valid values
are 8 bits to 32 bits.
•
The number of channels, jobs and sequences should be same across
multiple configuration sets.
•
The channels, jobs and sequences cannot be deleted or added at post-build
time.
•
The channel data received shall be stored in 1 entry deep internal buffers
by channel. The SPI Handler/Driver shall not take care of the overwriting of
these “receive” buffers by another transmission on the same channel.
•
The channel data to be transmitted shall be copied in 1 entry deep internal
buffers by channel. The SPI Handler/Driver cannot prevent overwriting of
these “transmit” buffers by users during transmissions.
•
If different Jobs (and consequently also Sequences) have common
Channels, the SPI Handler/Driver’ environment should ensure that read
and/or write functions are not called during transmission.
•
If a Job contains more than one Channel, all Channels contained have the
same Job properties during transmission and are linked together statically.
•
The SPI hardware unit cannot be deleted or added at post–build time. But,
the reassignment of the SPI hardware units to different jobs is possible at
post-build time.
•
The DMA unit cannot be deleted or added at post–build time. But, the
reassignment of DMA units to the SPI hardware units is possible at post-
19
Chapter 4 Forethoughts build time.
•
When the level of scalable functionality is configured as 1, then the SPI
Handler/Driver offers an asynchronous transfer service for SPI buses. An
asynchronous transmission means that the user calling the transmission
service is not blocked when the transmission is ongoing.
•
When the level of scalable functionality is configured as 2, then two SPI
buses using separate hardware units are required. In this case, the SPI bus
dedicated for synchronous transmission is configurable.
•
When the level of scalable functionality is configured as 2, two modes of
asynchronous communication using polling or interrupt mechanism are
possible. These modes are selectable during execution time.
•
When the level of scalable functionality is configured as 1 or 2, If interrupt
mechanism is selected during execution time, the transmission and
reception will be performed using the on-chip DMA unit only if the DMA
mode is enabled through the configuration.
•
The LEVEL 2 SPI Handler is specified for microcontrollers that have to provide
at least two SPI busses using separated hardware units. Otherwise, using this
level of functionality makes no sense.
•
When Level Delivered is 0 and 2, the memory mode configured for jobs linked
for the synchronous sequence shall be always Direct Access Mode only.
•
The SPI Handler/Driver is not allowed to suspend a Sequence transmission
already started in favour of another Sequence in case of Non-Interruptible
Sequences
•
If user configures 32 bit IB and EB channels and additionally configures DMA
in direct access mode there will be a generator error message.
•
When the SPI driver is configured in Level 2 (SpiLevelDelivered) and the
DMA is also configured (SpiDmaMode), then the asynchronous mode needs
to be set for interrupt mode using the API Spi_SetAsyncMode.
•
The SPI DMA type is specified by the parameter SPI_DMA_TYPE_USED.
Note: The DMA will work whenever the DMA access for the LOCAL RAM,
which is having PE guard protection is enabled (this can be done by
configuring the PE guard registers.)
•
Direct Access mode can be effectively used in case of sequence having
channels and buffers of significantly different properties.
• Double Buffer mode can be effectively used in case of sequence having more
number of jobs, channels and buffers with same hardware properties for
continuous transmission of data. For double buffer mode only usage of
internal buffers is allowed. FIFO mode can be effectively used at the time of
transmit/receive of large amount of data. FIFO mode can also be used in case
of sequence having lesser number of jobs and having more channels and
buffers.
•
In case size of buffers is more than the hardware buffer size i.e. 128 words,
an interrupt will occur after every 128 words are transmitted where the
hardware buffer will be loaded with the remaining buffers to be transmitted.
20
Forethoughts Chapter 4 •
In a particular configurations where CSIH HW units are configured, Spi_Init
function must be called before Port_Init function.
•
Only if "SpiCsInactiveAfterLastData" parameter is set to "true", the PWR bit
in CSI hardware will be cleared for that hardware unit, so setting "false" value
can lead to unnecessary power consumption.
•
When “SpiCsIdleEnforcement” is set to true for the jobs configured for CSIH
Hw units, the value configured for "SpiCsInactive" will not have any impact in
actual Chip Select behavior".
•
The parameter "SpiCsIdleEnforcement" influences the behavior of idle level
of the chip select during data transfer and after the transmission of a job.
•
When the parameter 'SpiCsIdleEnforcement' is configured as false, the
corresponding chip select is deactivated before every channel transmission
and stays active after transmission until another job with different CS is
transmitted.
•
When the parameter 'SpiCsIdleEnforcement' is configured as true, the chip
select is deactivated after job transmission. An idle phase of CS is inserted
between transmissions of two data buffers. The duration of idle state of the
chip select between the channels transmissions will be less than duration of
idle state of the chip select between single data of each channel.
•
In CSIG,CS is active during the whole job transmission independently of data
and is set to inactive state after job is finished.
Table 4-1 Table for Chip Select behavior Figure
SpiCSInactiveAfterlastdata
SpiCsIdleEnforcement
4-1
FALSE
TRUE
4-2
TRUE
TRUE
4-3
TRUE
FALSE
4-4
FALSE
FALSE
Note: In the below figures, the signal represented in Yellow is the clock signal
and the Blue signal is the chip select signal.
Figure 4-1 Chip select behavior when SpiCSInactiveAfterlastdata is
False and SpiCsIdleEnforcement is True 21

Chapter 4 Forethoughts Note: If ‘SpiCsIdleEnforcement’ is TRUE, Chip select will get deactivated after
transmission is over, even if ‘SpiCSInactiveAfterlastdata’ is configured as
FALSE.
Figure 4-2 Chip select behavior when SpiCSInactiveAfterlastdata is
True and SpiCsIdleEnforcement is True Figure 4-3 Chip select behavior when SpiCSInactiveAfterlastdata is
True and SpiCsIdleEnforcement is False Note: 1. The expected CS behavior may not be observed at high baud rates in case of
Asynchronous transmission using Direct Access Mode, due to general limitation
of the serial controllers.
2. CS state can be held for Asynchronous transmission by using buffer modes
like FIFO.
3. When channel properties are different and SpiCsIdleEnforcement is
configured as False, then the corresponding chip select will be deactivated after
each channel transmission.
22
Forethoughts Chapter 4 Figure 4-4 Chip select behavior when SpiCSInactiveAfterlastdata is
False and SpiCsIdleEnforcement is False This information is valid only for DIRECT ACCES MODE.
•
For availability of Data Consistency Check on the port pins, please refer
respective microcontroller user manual.
•
Sequences assigned to a hardware channel (CSIHx) which is configured to
work with transmit only memory mode can be an interruptible or non-
interruptible
sequence
(specified
by
the
parameter
SpiInterruptibleSequence). However, even if the sequence is non-
interruptible, it can still be interrupted by CPU-controlled high priority
communication functionality. I.e. the parameter SpiInterruptibleSequence is
valid only for software interruption.
•
Each of the high priority sequences shall refer to a unique chip select line.
These lines shall not be referred by any of the low priority sequences too.
•
In order to support DEEPSTOP functionality without resetting the
microcontroller, the re initialization of the Driver using Spi_Init API is
supported.
To
achieve
this
functionality
the
'SPI_E_ALREADY_INITIALIZED' Det error check is to be suppressed using
‘SpiAlreadyInitDetCheck’ parameter when DET is enabled. When DET is
disabled there is no impact of “SpiAlreadyInitDetCheck” parameter.
•
In a Hardware channel which has sequences working with transmit only
mode and is of high priority, if there is a request for transmission of high
priority sequence, then it will interrupt an ongoing sequence with transmit
only mode if the sequence is non-interruptible.
•
When the sequence is getting transmitted with transmit only mode, if there
is a request for high priority sequence, the ongoing sequence will be
interrupted after the ongoing job is finished and memory mode will switch
from transmit only mode to direct access mode automatically for high priority
sequence transmission and after its completion, the interrupted sequence
will resume transmission in transmit only mode.
• MCTL1, MCTL2 and CSIHnMRWP0 registers are allowed to be accessed
when there is an ongoing communication only when PWR is set.
•
Manual transmission is possible only in Direct Access and FIFO modes.
However user has to implement his own ISRs for SPI. In case he wants to
use Renesas SPI driver transmission in parallel, he has to call Renesas SPI
ISRs functions from his custom ISRs (e.g. use different interrupt category
mode).
23
Chapter 4 Forethoughts •
The file Interrupt_VectorTable.c provided is just a Demo and not all
interrupts will be mapped in this file. So the user has to update the
Interrupt_VectorTable.c as per his configuration.
•
The notifications should be called from user’s complex driver ISRs
•
High values for parameter ‘SpiCsHoldTiming’should not be used with
Synchronous Transmit function but if it is used, user should make sure that
next consecutive SPI action happens after CS hold time expired.
•
The parameter SpiTimeOut generates a scalar value that decides the
number of times a loop will be executed while polling. If exceeded the loop
breaks reporting a production error.
•
This information is valid only for Static Configuration
•
The parameter SpiPersistentHWConfiguration decides whether Hardware
configuration is static or dynamic. This is applicable for both CSIG and CSIH
and both Synchronous and Asynchronous communication and all memory
modes.
•
If SpiPersistentHWConfiguration is “True”, then HW configuration is static
(configuration is performed in the function Spi_Init ()function and not during
each transmission.
•
Static Configuration, allows the user to manually start transmission without
invoking SPI module APIs after Spi driver was initialized.
•
In Static configuration, all parameters in channel/job/external devices
containers linked to a hardware unit should be same. Refer Table 4-2, 4-3
and 4-4 for the list of parameters
Table 4-2 List of parameters in Channel container that are linked to the registers. Parameter in Registers linked channel container CSIH-CSIG SpiDataWidth
CSIHnCFGx.CSIHnDLSx
CSIHnCFGx0.CSIHnDLS[3:
0]
SpiTransferStart
CSIHnCFGx.CSIHnDIRx
CSIHnCFGx0.CSIHnDLS[3:
0]
Table 4-3 List of parameters in Job container that are linked to the registers. Parameter in job Registers linked container CSIH-CSIG SpiPortPinSelect
CSIHnTXOW.CSIHnCSx
-
CSIHnCTL1.CSIHnCSx
24
Forethoughts Chapter 4 Table 4-4 List of parameters in External Device container that are linked to the registers. Parameter in Registers linked channel container CSIH CSIG SpiCsPolarity
CSIHnCTL1.CSIHnCSx
-
SpiCsInactive
CSIHnCTL1.CSIHnCSRI
-
SpiCsIdleEnforcem
CSIHnCFGx.CSIHnIDLx
-
ent
SpiCsIdleTiming
CSIHnCFGx.CSIHnIDx[2:0
-
]
SpiCsHoldTiming
CSIHnCFGx.CSIHnHDx[3:
-
0]
SpiCsInterDataDel
CSIHnCFGx.CSIHnINx[3:0
-
ay
]
SpiCsSetupTime
CSIHnCFGx.CSIHnSPx[3:
-
0]
SpiDataShiftEdge
CSIHnCFGx.CSIHnDAPx
CSIGnCFG0.CSIGnDAP
SpiShiftClockIdleL
CSIHnCTL1.CSIHnCKR
CSIGnCTL1.CSIGnCKR
evel
SpiBaudrateConfig
CSIHnBRSy.CSIH0BRS[1
CSIGnCTL2.CSIGnBRS
uration
1:0]
SpiBaudrateRegist
CSIHnCFGx.CSIHnBRSS
-
erSelect
x[11:0]
SpiInputClockSele
CSIHnCTL2.CSIHnPRS[2:
CSIGnCTL2.CSIGnPRS[2:0
ct
0]
]
SpiInterruptDelayM
CSIHnCTL1.CSIHnSIT
CSIGnCTL1.CSIGnSLIT
ode
SpiParitySelection
CSIHnCFGx.CSIHnPSx[1:
CSIGnCFG0.CSIGnPS[1:0]
0]
SpiFifoTimeOut
CSIHnMCTL0.CSIHnTO[4:
-
0]
SpiBroadcastingPri
CSIHnCFGx.CSIHnRCBx
-
ority
•
Integrator has to ensure that the critical section protection is configured
correctly.
•
User should invoke Spi_GetErrorInfo before the buffer limit exceeds.
•
The user must calculate proper SpiTimeOut value based on the data size
configured.
•
The failure of self test indicates hardware failure.
•
When using DMA, 'SpiDataWidthSelection' in 'General' container shall be
'BITS_16', the user shall setup the buffer(EB or IB) in the application as type
25
Chapter 4 Forethoughts 'Spi_DataType' for channels that are configured for DMA and fill required
data(8 or 16) as configured in 'SpiDataWidth' in 'SpiChannel' container and
fill remaining with zeros.
•
When configuring DMA mode, the number of buffers configured shall be
greater than 1 in the case of Direct Access Mode and Fifo Mode.
•
The accesses to HW registers is possible only in the low level driver layer.
The user shall never write or read directly from any register, but shall use
the AUTOSAR standard API provided by the MCAL.
•
When using Interruptible Sequences, the caller must be aware that if the
multiple Sequences access the same Channels, the data for these
Channels may be overwritten by the highest priority Job accessing each
Channel.
•
For EB Channels the application shall provide the buffering and shall take
care of the consistency of the data in the buffer during transmission.
•
SPI peripherals may depend on the system clock, prescaler(s) and PLL.
Thus, changes of the system clock may also affect the clock settings of the
SPI hardware.
•
The SPI Handler/Driver module does not take care of setting the registers
which configure the clock, prescaler(s) and PLL in its init function. This has
to be done by the MCU module.
•
Depending on microcontrollers, the SPI peripheral could share registers
with other peripherals. In this typical case, the SPI Handler/Driver has a
relationship with MCU module for initialising and de-initialising those
registers.
•
If
SpiInternalErrorBufferSize
parameter
is
configured
as
Zero,
Spi_GetErrorInfo feature will be disabled. A Non zero value should be
configured to enable this feature.
•
Spi Driver status shall be ensured as SPI_IDLE by calling Spi_GetStatus
API, before calling Spi_GetErrorInfo API to avoid simultaneous access of
Global Error Buffer.
•
For Configuring the Parameter SpiTimeOut, User must consider these
factors:
1. Data transmission time strongly depends on the data length and
baudrate configured.
2. The parameter SpiTimeOut should be big enough to cover the worst
case scenario in the driver configuration.
3. MCU clock.
4. Compiler optimization level.
5. It is recommended to add additional margin to the timeout based on
user experience.
Example to consider:
Let’s say, if we are configuring the baud rate as 1 KHz:
1. For Data length of 16 bit and default data transmission is 8 or 16 bit i.e.
0x10 or 0x5639, the minimum timeout value can be configured as 0xED8.
2. If user is Configuring Data width selection of 32 bit and default data
transmission is 32 bit i.e. 0x5A5A5A5A or 0xFEDCFEDC the maximum
26
Forethoughts Chapter 4 Timeout value can be configured as 0xFFFF which is the worst case
needed for the transmission buffer to empty or receiving buffer to get filled
In that time.
4.2. Preconditions Following preconditions have to be adhered by the user, for proper functioning
of the SPI Driver Component:
•
The Spi_Lcfg.c, Spi_PBcfg.c, Spi_Cbk.h and Spi_Cfg.h files generated by
the SPI Driver Component Code Generation Tool must be compiled and
linked along with SPI Driver Component source files.
•
The application has to be rebuilt, if there is any change in the Spi_Lcfg.c,
Spi_PBcfg.c, Spi_Cbk.h and Spi_Cfg.h files generated by the SPI Driver
Component Generation Tool.
•
File Spi_PBcfg.c generated for single configuration set or multiple
configuration sets using SPI Driver Component Generation Tool can be
compiled and linked independently.
•
The authorization of the user for calling the software triggering of a hardware
reset is not checked in the SPI Driver. This is the responsibility of the upper
layer.
•
The SPI Driver Component needs to be initialized before accepting any
request. The API Spi_Init should be invoked to initialize SPI Driver
Component.
•
The user should ensure that SPI Driver Component API requests are
invoked in the correct and expected sequence and with correct input
arguments.
•
Input parameters are validated only when the static configuration parameter
SPI_DEV_ERROR_DETECT is enabled. Application should ensure that the
right
parameters
are
passed
while
invoking
the
APIs
when
SPI_DEV_ERROR_DETECT is disabled.
•
Errors checked in the Development Error Detection area are only static
configuration checks. No runtime errors are checked here.
•
A mismatch in the version numbers of header and the source files results in
compilation error. User should ensure that the correct versions of the header
and the source files are used.
•
The ISR functions and the corresponding handler addresses are provided
in Table ISR Handler Addresses. User should ensure that Interrupt Vector
table configuration is done as per the information provided in the table.
•
User have the responsibility to enable or disable the critical protection using
the parameter SpiCriticalSectionProtection. By enabling parameter
SpiCriticalSectionProtection, Microcontroller HW registers which suffer from
concurrent access by multiple tasks are protected.
•
Within the callback notification functions only following APIs are allowed.
Spi_ReadIB
Spi_WriteIB
Spi_SetupEB
Spi_GetJobResult
27
Chapter 4 Forethoughts Spi_GetSequenceResult
Spi_GetHWUnitStatus
Spi_Cancel
All other SPI Handler/Driver API calls are not allowed.
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-5 User Mode and Supervisory Mode Interrupt mode
Polling mode
Known
limitation in
Sl. No.
API name
User Mode
user
supervisor
user
supervisor
mode
mode
mode
mode
The IMR and
1.
Spi_Init
-
x
-
x
INTC registers
are accessed
inside this
function. Hence
it should not be
2.
Spi_DeInit
-
x
-
x
invoked in User
mode.
3.
Spi_WriteIB
x
x
x
x
The IMR and
INTC registers
are accessed
inside this
4.
Spi_AsyncTransmit
-
x
-
x
function. Hence
it should not be
invoked in User
mode.
5.
Spi_ReadIB
x
x
x
x
6.
Spi_SetupEB
x
x
x
x
7.
Spi_GetStatus
x
x
x
x
8.
Spi_GetJobResult
x
x
x
x
Spi_GetSequenceRes
9.
x
x
x
x
ult
10.
Spi_GetVersionInfo
x
x
x
x
The IMR and
INTC registers
are accessed
inside this
11.
Spi_SyncTransmit
-
x
-
x
function. Hence
it should not be
invoked in User
mode.
The IMR and
INTC registers
are accessed
inside this
12.
Spi_Cancel
-
x
-
x
function. Hence
it should not be
invoked in User
mode.
28
Forethoughts Chapter 4 Interrupt mode
Polling mode
Known
limitation in
Sl. No.
API name
User Mode
user
supervisor
user
supervisor
mode
mode
mode
mode
The IMR and
INTC registers
are accessed
inside this
13.
Spi_SetAsyncMode
-
x
-
x
function. Hence
it should not be
invoked in User
mode.
The IMR and
INTC registers
are accessed
Spi_MainFunction_Ha
inside this
14.
-
-
-
x
ndling
function. Hence
it should not be
invoked in User
mode
15.
Spi_GetHWUnitStatus
x
x
x
x
16.
Spi_GetErrorInfo
x
x
x
x
The IMR and
INTC registers
are accessed
inside this
17.
Spi_SelfTest
-
x
-
x
function.
Hence it
should not be
invoked in
User mode
The IMR and
INTC registers
are accessed
inside this
18.
All ISRs
-
x
-
-
function. Hence
it should not be
invoked in User
mode
Note1: 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. Memory modes The SPI Driver will use different memory modes depending on the HW units
selected. If the HW unit configured is CSIG then only direct access mode has
to be configured. If the HW unit configured is CSIH then any of the following
four modes can be configured.
Table 4-6 HW unit and Memory Mode Selection HW unit Memory mode CSIG0
Direct Access Mode
CSIH(0-3)
Direct Access Mode
FIFO Mode
Dual Buffer mode
Transmit Only Mode
29
Chapter 4 Forethoughts 4.5. Data Consistency To support the re-entrance and interrupt services, the AUTOSAR SPI
component will ensure the data consistency while accessing its own RAM
storage
or
hardware
registers.
The
SPI
component
will
use
SchM_Enter_Spi_<Exclusive Area> and SchM_Exit_Spi_<Exclusive Area>
functions. The SchM_Enter_Spi_<Exclusive Area> function is called before the
data needs to be protected and SchM_Exit_Spi_<Exclusive Area> function is
called after the data is accessed.
The following exclusive area along with scheduler services is used to provide
data integrity for shared resources:
•
CHIP_SELECT_PROTECTION
•
RAM_DATA_PROTECTION
The
functions
SchM_Enter_Spi_<Exclusive
Area>
and
SchM_Exit_Spi_<Exclusive Area> can be disabled by disabling the
configuration parameter 'Spi_CriticalSectionProtection'. The flowchart will
indicate the flow with the pre-compile option 'Spi_CriticalSectionProtection'
enabled.
The information about the API’s and the protected resources by the critical
section are given in the following table.
Table 4-7 SPI Driver Protected Resources List API Name Exclusive Area Type Protected Resources Spi_AsyncTransmit SPI_RAM_DATA_PROTECTION
Global Variable:
Spi_GaaSeqCancel,,
Spi_GddDriverStatus,
Spi_GaaSeqResult,
Spi_GucHwUnitStatus,
Spi_GddQueueIndex,
Spi_GblQueueStatus,
Spi_GusAllQueueSts,
Spi_GaaSeqQueue,
Spi_GddQueueIndex,
Spi_GblQueueStatus
Spi_GaaJobQueue
Spi_GaaJobResult
Spi_GaaJobCount
Spi_GaaHighPriorityCommRequest
AtIdle
Spi_GaaHighPriorityCommRequest
AtIdle
Spi_GaaHighPriorityCommActive
Spi_GaaHighPriorityCommRequest
Spi_GaaHighPrioritySequence
Spi_GucHWFifoBufferSts
Spi_GstFifoCurrentCommData
HW Registers:
IMR and INTC registers
30
Forethoughts Chapter 4 API Name Exclusive Area Type Protected Resources Spi_AsyncTransmit
HW Register:
SPI_CHIP_SELECT_PROTECTION Port PSR Register.
Spi_SyncTransmit
SPI_RAM_DATA_PROTECTION
Global Variables:
Spi_GusHwStatus
HW Registers:
INTC registers
Spi_SyncTransmit
SPI_CHIP_SELECT_PROTECTION HW Register:
Port PSR Register.
Spi_Cancel
SPI_RAM_DATA_PROTECTION
Global Variable:
Spi_GaaSeqCancel
Note: The highest measured duration of a critical section is 2.10 micro
seconds measured for Spi_AsyncTransmit API.
4.6. Deviation List Table 4-8 SPI Driver Deviation List Sl. No. Description AUTOSAR Bugzilla 1.
The parameter
48763
"SpiHwUnitSynchronous" is moved
to SpiJob container from
SpiChannel container.
2.
The total number of SPI Hardware
24328
Units is published as
“SPI_MAX_HW_UNIT”.
3.
The parameter “SPI_BAUDRATE”
-
is not used since the value
configured for this parameter
cannot be mapped directly to the
register value. Hence, a parameter
”SpiBaudrateSelection” is used to
select input frequency source.
4.
The parameter 'SpiTimeClk2Cs' is
-
not used since the value of this
parameter is configured as count
value. Hence, the parameter
'SpiClk2CsCount' is provided to
configure the wait loop count to add
delay between clock and chip
select.
5.
Type of the parameter SpiHwUnit is -
ENUMERATION-PARAM-DEF with
a list of all possible hardware units.
6.
The inclusion or deletion of the
-
hardware units will not be possible
in the post-build time. But the
reassignment of configured HW
unit for different jobs is possible.
31
Chapter 4 Forethoughts Sl. No. Description AUTOSAR Bugzilla 7.
Type of the parameter SpiCs is
-
ENUMERATION-PARAM-DEF with
a list of all possible port lines.
8.
If the parameter "DataBufferPtr"
-
passed through the API
“Spi_ReadIB” is null pointer, then
the error
SPI_E_PARAM_POINTER will be
reported to DET.
9.
The channel parameters
-
“SpiChannelType”, “SpiIbNBuffers”
and “SpiEbMaxLength” are pre-
compile time parameters.
10.
A queue will be implemented and
-
maintained if there are more than
one sequence is requested for
transmission. The length of the
queue will be number of configured
jobs minus 1.
11.
If a sequence is requested for
-
transmission while already one
uninterruptible sequence is on-
going, the requested sequence will
be put on queue.
12.
The upper and lower multiplicity of -
the parameter ‘SpiCsIdentifier’ is ‘1’
i.e. mandatory and the default value
is NULL. The upper and
lower multiplicity of the parameter
‘SpiEnableCS’ is ‘1’ i.e. mandatory
and the default value is false.
13.
The parameters SpiMaxChannel,
-
SpiMaxJob and SpiMaxSequence
in SpiDriverConfiguration is made
as mandatory in the Parameter
Definition File of SPI Driver
Component.
14.
Notification related functions and
-
parameters configuration class
are changed from Link time to
Post Build, vice versa Spi_
Lcfg.c and Spi
_Pbcfg.c files
structures are updated.
15.
Memory size measurements
-
(RAM/ROM usage,Stack,
Throughput) are not as per
requirements.
32
Architecture Details Chapter 5 Chapter 5 Architecture Details To minimize the effort and to optimize the reuse of developed software on
different platforms, the SPI driver is split as High Level Driver and Low Level
Driver. The SPI Driver architecture is shown in the following figure:
SPI User SPI High-level Driver (Microcontroller Independent) SPI Low Level Driver MICROCONTROLLER CSIH CSIG
Figure 5-1 SPI Driver Architecture The High Level Driver exports the AUTOSAR API towards upper modules and
it will be designed to allow the compilation for different platforms without or only
slight modifications, i.e. that no reference to specific microcontroller features or
registers will appear in the High Level Driver. All these references are moved
inside a µC specific Low Level Driver. The Low Level Driver interface extends
the High Level Driver types and methods in order to adapt it to the specific
target microcontroller.
SPI Driver component: The SPI Driver provides services for reading and writing to devices connected
via SPI busses. It provides access to SPI communication to several users like
EEPROM, Watchdog, I/O ASICs. It also provides the required mechanism to
configure the on chip SPI peripheral.
The SPI Driver component is divided into the following sub modules based on
the functionality required:
•
Initialization and De-initialization
•
Buffer Management
•
Communication
•
Status information
33
Chapter 5 Architecture Details •
Module version information
•
Communication Error Diagnosis
The basic architecture of the SPI Driver component is illustrated in the
following Figure:
APPLICATION LAYER
n n ro atiorr nt atione neicatio rmn tioform iotuffer unagemm InfoaBn ciiti aliza tionanot ifications N- nir InMomt us Inso e eCI nitiali zaDStaersio
Vmmugnor Lay Cdiarive SP I H ig h Le v e l Dr ive r SPI D Updates the Error
Setting of
De -
Transmit and
Sequen
Information
HW
Return the
ce and
buffer with the
register
initialization
receive the jobs
status of
of SPI HW
and channels
job
error details
Disabling
module, job,
units
notifica
(Error Type, HW
the
sequence
tion
interrupts
unit,Sequence id,
Job id)
SP I L ow Le v e l Dr ive r
Figure 5-2 Component Overview Of SPI Driver Component SPI Driver Initialization and De-Initialization module This module initializes and de-Initializes the SPI driver. It provides the
Spi_Init() and Spi_DeInit() APIs. The Spi_Init() API should be invoked before
the usage of any other APIs of Watchdog Driver Module.Spi-Init should be
called prior to Port_Init. De-initialization function puts all microcontroller SPI
peripherals in the same state such as Power On Reset.
Buffer Management
This module provides the services for reading and writing the internal buffers
and setting up the external buffer. The type of buffer for each channel is
configurable as either internal or external
The APIs related to this module are Spi_WriteIB(), Spi_ReadIB() and
Spi_SetupEB().
Communication This module provides the services for the transmission of data on the SPI bus
both synchronously and asynchronously, cancelling the ongoing transmission
and setting the asynchronous transfer mode.
The synchronous mode is based on polling mechanism. But for the
asynchronous mode, the possible mechanisms are Polling and Interrupt mode.
34
Architecture Details Chapter 5 One of these modes is selectable during execution by one of the services
provided by this sub-module.
The APIs related to this module are Spi_SyncTransmit(), Spi_AsyncTransmit(),
Spi_SetAsyncMode() and Spi_Cancel().
Status Information
This module provides the services for getting the status of the SPI Driver and
hardware unit. It also provides the services for getting the result of the specified
job and specified sequence.
The APIs related to this module are Spi_GetStatus(), Spi_GetHWUnitStatus(),
Spi_GetJobResult() and Spi_GetSequenceResult().
Module Version Information This module provides APIs for reading module Id, vendor Id and vendor
specific version numbers.
The API related to this module is Spi_GetVersionInfo().
Communication Error Diagnosis
This module provides the services for collecting the error details when the
transmission of data on the SPI bus is failed. A buffer and the size of the buffer
shall be passed as arguments to this module. This module provides following
detailes of the communication error :
1. Type of the Hardware Error (parity, data consistency, overflow, overrun)
2. HW unit in which error is reported (eg. CSIG0, CSIH3, etc.)
3. Sequence id for which error is reported
4. Job id for which error is reported
These details will be stored in to the passed buffer. This module is implemented
for getting error details whenever a hardware error is reported.
The API related to this module is Spi_GetErrorInfo().
There are 2 approaches for using by upper layer.
1.
Polling Method The upper layer calls Spi_GetSequenceResult() API and when the return value
is SPI_SEQ_FAILED then call to Spi_GetErrorInfo() API can be done to get the
detailed information as to why the sequence failed.
2.
Application Callback Function Executed from SPI Error ISR The user can be informed each time a SPI error occurred through the DEM error.
User can invoke Spi_GetErrorInfo API to get the error details when the DEM is
reported.
If call out from DEM is not possible, user can check the error detailed information
by calling API Spi_GetErrorInfo after confirmation of failure from
Spi_SyncTransmit API.
Note : •
For each error, the error details will be stored in the eror buffer.So it is
not a must to invoke Spi_GetErrorInfo every time the error occurs.
•
User can decide to call Spi_GetErrorInfo after multiple errors or for each
error depending on the application requirement.
•
The maximum number of error details that can be hold by the error buffer
can be configured by the user.
35
Chapter 5 Architecture Details •
To store the Errors generated, error ISR will be invoked in the case
Asynchronous transmission only.
•
In synchronous transmission case, the internal function used for
reporting error in synchronous transmission will be invoked to report the
Error.
•
All the other steps and approaches are same for both Sync and Async
Transmit case.
•
The latest communication errors info will be always stored in error buffer
and it will not be cleared when it is read.
•
Any elements of error buffer will not be changed (not cleared /not shifted)
when it is read including partial read.
•
The error information from the status register STCR0 is cleared in Error
ISR and internal function used for reporting error in synchronous
transmission after reading it,to avoid the possibility of reporting multiple
errors.
•
Whenever an error interrupt occurs, SPI driver will check for all the
possible errors one by one and will report separately.
For Example, if an overflow and parity error is reported simultaneously
for a data transmission, corresponding index of the error buffer will
contain Overflow Error and other index will store Parity Error.
•
No variables used in SPI driver are modified in Spi_GetErrorInfo API.
•
Copying the error information from error buffer into the user buffer is
done without modifying any Global array.
36
Registers Details Chapter 6 Chapter 6 Registers Details This section describes the register details of SPI Driver Component.
Table 6-1 Register Details Config Register API Name Registers Macro/Variable Parameter Access R/W/RW Spi_Init
CSIGnCTL0
SpiMemoryModeSelection
W
SPI_ZERO
CSIHnCTL0
W
SPI_ZERO
DCSTCn
-
W
SPI_DMA_STR_CLEAR
DCSTn
-
R
-
DCENn
-
W
SPI_DMA_DCEN_DISABLE
DSAn
SpiDma
W
LpDmaConfig-
>ulTxRxRegAddress
DTCTn
SpiTxDmaChannel/
W
SPI_DMA_16BIT_TX_SETTI
SpiRxDmaChannel
NGS
SPI_DMA_16BIT_RX_SETTI
NGS
DDAn
SpiDma
W
LpDmaConfig-
>ulTxRxRegAddress
DTFRn
SpiTxDmaChannel/
W
LpDmaConfig-
SpiRxDmaChannel
>usDmaDtfrRegValue
CSIGnCTL1
SpiCsInactiveAfterLastDat
W
LunDataAccess1.ulRegData
a, SpiDataWidth
CSIHnCTL1
W
LunDataAccess1.ulRegData
EICn
-
W
SPI_CLR_INT_REQ
IMRn
SpiHwUnitSelection
W
Spi_GstHWUnitInfo[LddHWU
and
nit].usRxImrMask,
SpiMemoryModeSelection
Spi_GstHWUnitInfo[LddHWU
nit].pTxImrAddress,
Spi_GstHWUnitInfo[LddHWU
nit].pErrorImrAddress,
Spi_GstHWUnitInfo[LddHWU
nit].usRxImrMask,
Spi_GstHWUnitInfo[LddHWU
nit].pTxImrAddress,
LpHWUnitInfo-
>usTxCancelImrMask,
Spi_GstHWUnitInfo[LddHWU
nit].pErrorImrAddress
CSIHnTX0W
-
W
LunDataAccess1.ulRegData
SELCSIHDMA
-
W
SPI_SELECT_CSIH_DMA_
REG_VAL
CSIGnCTL2
SpiInputClockSelect
W
LpJobConfig->usCtl2Value
SpiBaudrateConfiguration
37
Chapter 6 Registers Details Config Register API Name Registers Macro/Variable Parameter Access R/W/RW CSIGCFG0
SpiDataWidth
W
LunDataAccess1.ulRegData
SpiParitySelection
SpiTransferStart
SpiDataShiftEdge
SpiShiftClockIdleLevel
CSIHnSTCR0
-
W
SPI_CSIH_CLR_STS_FLAG
S
CSIGnSTCR0
-
W
SPI_CSIG_CLR_STS_FLAG
S
CSIHnSTR0
-
R
-
CSIGnSTR0
-
R
-
CSIHnCTL2
SpiInputClockSelect
W
LpJobConfig->usCtl2Value
SpiBaudrateConfiguration
& SPI_CSIH_PRE_MASK
CSIHnMCTL0
SpiMemoryModeSelection
W
LpJobConfig->usMCtl0Value
CSIHnBRSy
SpiInputClockSelect
W
(LpJobConfigCSConfig-
SpiBaudrateConfiguration
>usCtl2Value) &
SPI_CSIH_BRS_MASK
CSIHnCFGx
SpiDataWidth
W
LunDataAccess1.ulRegData
SpiParitySelection
SpiTransferStart
SpiDataShiftEdge
SpiShiftClockIdleLevel
ECCCSIHnCTL SpiECCSelfTest
R/W
SET_EC1EDIC_EC2EDIC
ECC_CTL_ECEMF_SET
ECC_CTL_ECER1F_ECER
2F_CLEAR
CTL_ERRCLR_FLAG
CTL_2BIT_ERRCLR_FLAG
CTL_1BIT_ERR_FLAG
ECCCSIHnTM
SpiECCSelfTest
W
SET_TMC_BITS
C
SET_TEST_DISABLE
ECCCSIHnTRC SpiECCSelfTest
W
TRC_ERDB_INITIALIZE
ECCCSIHnTED SpiECCSelfTest
R/W
RAM_INITIALIZE,
ALL_ZERO_PATTERN,
ALL_ONE_PATTERN,
TWO_BIT_PATTERN
38
Registers Details Chapter 6 Config Register API Name Registers Macro/Variable Parameter Access R/W/RW CSIHnRX0H
-
R
-
CSIGnRX0
-
R
-
CSIGnTX0H
-
W
SPI_LOOPBACK_DATA
CSIHnMCTL1
SpiMemoryModeSelection
W
SPI_CTL_32BIT_REG_VAL
CSIHnMCTL2
SpiMemoryModeSelection
W
SPI_CTL_32BIT_REG_VAL
CSIGBCTL0
-
W
SPI_BCTL0_SET_SCE
Spi_DeInit
CSIGnCTL0
SpiMemoryModeSelection
W
SPI_ZERO
CSIHnCTL0
W
SPI_ZERO
CSIGnCTL1
-
W
SPI_ZERO
CSIHnCTL1
-
W
SPI_ZERO
CSIGnCTL2
-
W
SPI_CTL2_16BIT_REG_DEI
NIT
CSIHnCTL2
-
W
SPI_CTL2_16BIT_REG_DEI
NIT
CSIGBCTL0
-
W
SPI_CTL_8BIT_REG_MASK
CSIHnMCTL0
-
W
SPI_MCTL0_16BIT_REG_D
EINIT
CSIHnMCTL1
-
W
SPI_CTL_32BIT_REG_MAS
K
CSIHnMCTL2
-
W
SPI_CTL_32BIT_REG_MAS
K
CSIGnSTCR0
-
W
SPI_CTL_16BIT_REG_DEIN
IT
CSIHnSTCR0
-
W
SPI_CTL_16BIT_REG_DEIN
IT
39
Chapter 6 Registers Details Config Register API Name Registers Macro/Variable Parameter Access R/W/RW CSIHMRWP0
-
W
SPI_CTL_32BIT_REG_MAS
K
CSIHnBRSy
-
W
SPI_CTL_16BIT_REG_DEIN
IT
DSAn
-
W
SPI_DMA_DEINIT
DDAn
-
W
SPI_DMA_DEINIT
DCENn
-
W
SPI_DMA_DCEN_DISABLE
DTCTn
-
W
SPI_DMA_DEINIT
CSIGCFG0
-
W
SPI_CTL_32BIT_REG_MAS
K
CSIHCFG0
-
W
SPI_CTL_32BIT_REG_MAS
K
DTFRRQCn
-
W
SPI_DMA_DRQ_CLEAR
DCSTCn
-
W
SPI_DMA_STR_CLEAR
DTFRRQn
-
R
-
DCSTn
-
R
-
DTFRn
-
W
SPI_DMA_DEINIT
CSIHnMRWP0 -
W
SPI_CTL_32BIT_REG_VAL
CSIHnCFGx
W
SPI_CTL_32BIT_REG_VAL
IMRn
SpiHwUnitSelection
W
Spi_GstHWUnitInfo[LddHWU
and
nit].usRxImrMask,
SpiMemoryModeSelection
Spi_GstHWUnitInfo[LddHWU
nit].pTxImrAddress,
Spi_GstHWUnitInfo[LddHWU
nit].pErrorImrAddress,
Spi_GstHWUnitInfo[LddHWU
nit].usRxImrMask,
Spi_GstHWUnitInfo[LddHWU
nit].pTxImrAddress,
LpHWUnitInfo-
>usTxCancelImrMask,
Spi_GstHWUnitInfo[LddHWU
nit].pErrorImrAddress
EICn
-
W
SPI_CLR_INT_REQ
PORTPSRx
SpiPortPinSelect
LpJobConfiguration-
>ulPortPinMask
Spi_WriteIB
CSIHMCTL0
SpiMemoryModeSelection
W
LusMctlData
SPI_TX_ONLY_MODE_SET
SPI_DUAL_BUFFER_MOD
E_SET
CSIHnMRWP0 -
RW
ulRegData
LunDataAccess1.ulRegData
CSIHnTX0W
-
W
LunDataAccess1.ulRegData
40
Registers Details Chapter 6 Config Register API Name Registers Macro/Variable Parameter Access R/W/RW Spi_AsyncTransmit
CSIHnMCTL0
-
W
LpJobConfig->usMCtl0Value
CSIGnCFG0
-
W
LpJobConfig-
>ulConfigRegValue
CSIGnCTL0
SpiMemoryModeSelection
W
SPI_RESET_PWR
SPI_SET_DIRECT_ACCES
S
SPI_SET_MEMORY_ACCE
SS
CSIHnCTL0
W
SPI_RESET_PWR
SPI_SET_DIRECT_ACCES
S
SPI_SET_MEMORY_ACCE
CSIGnSTCR0
-
W
SPI_CLR_STS_FLAGS
SS
CSIHnSTCR0
-
W
SPI_CLR_STS_FLAGS
CSIHnSTR0
-
R
-
CSIGnSTR0
-
R
-
CSIGnCTL1
SpiCsInactiveAfterLastDat
W
LunDataAccess1.ulRegData
a, SpiDataWidth
LpJobConfig-
>ulMainCtl1Value
SPI_SET_SLIT
CSIHnCTL1
W
LunDataAccess1.ulRegData
LpJobConfig-
>ulMainCtl1Value
SPI_SET_SLIT
DCSTCn
-
W
SPI_DMA_STR_CLEAR
DCSTn
-
R
-
DCENn
-
W
SPI_DMA_DCEN_DISABLE
DTCTn
-
W
SPI_DMA_FIXED_TX_SETT
INGS
SPI_DMA_INV_TX_SETTIN
GS
LddNoOfBuffers
SPI_DMA_STR_REQ
SPI_DMA_ONCE
SPI_DMA_FIXED_RX_SET
TINGS
DSAn
-
W
SPI_
(uin D
t3 M
2 A_
)Lp IN
Tx V_
Da R
ta X_
SETTIN
GS
DTFRn
-
W
(uint32)SPI_ZERO
SPI_DMA_ONCE
(uint32)(LpDmaConfig->
usDmaDtfrRegValue
DCSTSn
-
W
SPI_DMA_STR
DTCn
-
W
SPI_ONE
DTFRRQCn
-
W
SPI_DMA_DRQ_CLEAR
DCENn
-
W
SPI_DMA_DCEN_ENABLE
DDAn
-
W
(uint32)(&Spi_GddDmaRxD
ata)
CSIGnCTL2
SpiBaudrateRegisterSelect
W
LpJobConfig->usCtl2Value
CSIHnCTL2
SpiFifoTimeOut
W
LpJobConfig->usCtl2Value
CSIHnMCTL2
-
W
LunDataAccess1.ulRegData
41
Chapter 6 Registers Details Config Register API Name Registers Macro/Variable Parameter Access R/W/RW CSIHnTX0W
-
W
LunDataAccess1.ulRegData,
LunDataAccess2.ulRegData,
LpDataAccess->ulRegData
CSIHnTX0H
-
W
LddData,
LunDataAccess2.usRegData
5[SPI_ZERO]
CSIGnTX0H
-
W
LddData,
LunDataAccess2.usRegData
5[SPI_ZERO]
CSIHnCFGx
SpiCsIdleTiming,
W
LunDataAccess1.ulRegData
SpiCsHoldTiming,
SpiCsInterDataDelay,
SpiCsSetupTime,
SpiCsIdleEnforcement
CSIGnTX0W
-
W
LunDataAccess1.ulRegData,
LpDataAccess->ulRegData
CSIHnBRS[0]
SpiBaudrateConfiguration
W
LpCsihOsBaseAddr-
>usCSIHBRS[0]
CSIHnBRS[1]
-
W
LpCsihOsBaseAddr-
>usCSIHBRS[1]
CSIHnBRS[2]
-
W
LpCsihOsBaseAddr-
>usCSIHBRS[2]
CSIHnBRS[3]
-
W
LpCsihOsBaseAddr-
>usCSIHBRS[3]
IMRn
SpiHwUnitSelection
W
LpHWUnitInfo-
and
>usRxImrMask,
SpiMemoryModeSelection
LpHWUnitInfo-
>usTxImrMask,
LpHWUnitInfo-
>usErrorImrMask,
LpHWUnitInfo-
>usRxImrMask,
LpHWUnitInfo-
>usTxImrMask,
LpHWUnitInfo-
>usTxCancelImrMask,
LpHWUnitInfo-
>usErrorImrMask
EICn
-
W
SPI_CLR_INT_REQ
DTFRRQn
-
R
-
PORTPSRx
SpiPortPinSelect
W
LulPinMskVal &
SPI_PORT_REG_MASK,
LulPinMskVal
CSIHnRX0H
-
R
-
CSIGnRx0
-
R
-
CSIHnRX0W
-
R
-
Spi_ReadIB
CSIHnRX0W
-
W
LunDataAccess2.ulRegData
42
Registers Details Chapter 6 Config Register API Name Registers Macro/Variable Parameter Access R/W/RW CSIHnRX0H
-
W
LunDataAccess2.usRegData
5[SPI_ONE],
LunDataAccess2.usRegData
5[SPI_ZERO]
CSIHnMRWP0 -
RW
LunDataAccess1.ulRegData
Spi_SetupEB
-
-
-
-
Spi_GetStatus
-
-
-
-
Spi_GetJobResult
-
-
-
-
Spi_GetSequenceRes -
-
-
-
ult
Spi_SyncTransmit
CSIHnMCTL0
-
W
LpJobConfig->usMCtl0Value
CSIGnCTL0
-
W
SPI_RESET_PWR
SPI_SET_DIRECT_ACCES
S
LunDataAccess1.ulRegData
CSIHnCTL0
-
W
SPI_RESET_PWR
SPI_SET_DIRECT_ACCES
S
SPI_SET_PWR
SPI_ZERO
CSIGnTX0W
-
W
LunDataAccess2.ulRegData
LunDataAccess1.ulRegData
CSIHnRX0H
-
RW
LunDataAccess3.ulRegData,
Spi_GusSynDataAccess
CSIGnCFG0
-
RW
Spi_GusAsynDataAccess
LddData
LpJobConfig-
>ulConfigRegValue,
LunDataAccess1.ulRegData
CSIGnSTR0
-
R
-
CSIHnSTR0
-
R
-
CSIGnSTCR0
-
W
SPI_PE_ERR_CLR,
SPI_DCE_ERR_CLR,
SPI_OFE_ERR_CLR
CSIHnSTCR0
-
W
SPI_DCE_ERR_CLR,
SPI_PE_ERR_CLR,
SPI_OFE_ERR_CLR
CSIGnCTL1
-
W
LpJobConfig-
>ulMainCtl1Value,
LpMainOsBaseAddr-
>ulMainCTL1 |
SPI_SET_SLIT
CSIHnCTL1
SpiCsInactiveAfterLastDat
W
LunDataAccess1.ulRegData,
a, SpiDataWidth
(LpMainOsBaseAddr-
>ulMainCTL1 |
~SPI_CSRI_AND_MASK
CSIGnCTL2
SpiBaudrateRegisterSelect
W
LunDataAccess1.ulRegData,
LpJobConfig->usCtl2Value,
CSIHnCTL2
SpiFifoTimeOut
W
LpJobConfig->usCtl2Value
CSIHnTX0W
-
W
LpJobConfig->usCtl2Value,
LunDataAccess3.ulRegData
43
Chapter 6 Registers Details Config Register API Name Registers Macro/Variable Parameter Access R/W/RW CSIHnCFG
SpiCsIdleTiming,
RW
LunDataAccess1.ulRegData
SpiCsHoldTiming,
LpJobConfig-
SpiCsInterDataDelay,
>ulConfigRegValue
SpiCsSetupTime,
SpiCsIdleEnforcement
CSIGnRX0
-
R
-
CSIHnBRS[0]
SpiBaudrateConfiguration
W
LpCsihOsBaseAddr-
>usCSIHBRS[0],
LpJobConfig->usCtl2Value &
SPI_CSIH_BRS_MASK
CSIHnBRS[1]
W
LpCsihOsBaseAddr-
>usCSIHBRS[1],
LpJobConfig->usCtl2Value)
& SPI_CSIH_BRS_MASK
CSIHnBRS[2]
W
LpCsihOsBaseAddr-
>usCSIHBRS[2],
LpJobConfig->usCtl2Value)
& SPI_CSIH_BRS_MASK
CSIHnBRS[3]
W
LpCsihOsBaseAddr-
>usCSIHBRS[3],
LpJobConfig->usCtl2Value)
& SPI_CSIH_BRS_MASK
EICn
-
W
SPI_CLR_INT_REQ
PORTPSRx
SpiPortPinSelect
W
LulPinMskVal, LulPinMskVal
& SPI_PORT_REG_MASK
Spi_GetHWUnitStatus CSIGnSTR0
-
R
-
CSIHnSTR0
-
R
-
Spi_Cancel
CSIHnCTL0
-
R/W
SPI_SET_JOBE
IMRn
-
W
LpHWUnitInfo-
>ucTxCancelImrMask
EICn
-
W
SPI_CLR_INT_REQ
Spi_SetAsyncMode
IMRn
SpiHwUnitSelection
W
Spi_GstHWUnitInfo[LddHWU
and
nit].usRxImrMask,
SpiMemoryModeSelection
Spi_GstHWUnitInfo[LddHWU
nit].usTxImrMask,
Spi_GstHWUnitInfo[LddHWU
nit].usErrorImrMask,
Spi_GstHWUnitInfo[LddHWU
nit].usRxImrMask,
Spi_GstHWUnitInfo[LddHWU
nit].usTxImrMask,
Spi_GstHWUnitInfo[LddHWU
nit].usTxCancelImrMask
Spi_GstHWUnitInfo[LddHWU
nit].usErrorImrMask
EICn
-
w
SPI_CLR_INT_REQ
Spi_MainFunction_Ha CSIGnCTL0
-
W
SPI_SET_PWR
ndling
CSIHnCTL0
-
W
SPI_SET_PWR
44
Registers Details Chapter 6 Config Register API Name Registers Macro/Variable Parameter Access R/W/RW CSIGnRX0
-
R
-
CSIHnRX0H
-
R
-
CSIGnTX0W
-
W
LunDataAccess1.ulRegData
CSIHnTX0W
-
W
LunDataAccess1.ulRegData
CSIGnTX0H
-
W
LddData
LunDataAccess2.usRegData
5[0]
CSIHnTX0H
-
W
LddData
LunDataAccess2.usRegData
5[0]
CSIHnRX0W
-
R
-
CSIHnMCTL2
SpiMemoryModeSelection
W
LunDataAccess1.ulRegData
EICn
-
W
SPI_CLR_INT_REQ
DCSTCn
-
W
SPI_DMA_STR_CLEAR
DCSTn
-
R
-
DCENn
-
W
SPI_DMA_DCEN_DISABLE
DTCTn
-
W
SPI_DMA_FIXED_TX_SETT
INGS
DSAn
-
W
SPI_
(uin D
t3 M
2 A_
)Lp IN
Tx V_
Da TX_
ta
SETTIN
GS
DTFRn
-
W
(uint32)SPI_ZERO
LddNoOfBuffers
(uint32)(LpDmaConfig->
SPI_DMA_STR_REQ
usDmaDtfrRegValue
SPI_DMA_ONCE
DCSTSn
-
W
SPI_
SPI_D
DMA_
MA_FI
S XED_
TR
RX_SET
TINGS
DTCn
-
W
SPI_ONE
SPI_DMA_INV_RX_SETTIN
DTFRRQCn
-
W
GS
SPI_DMA_DRQ_CLEAR
SPI_DMA_ONCE
DCENn
-
W
SPI_DMA_DCEN_ENABLE
DDAn
-
W
(uint32)(&Spi_GddDmaRxD
ata)
CSIGnSTCR0
-
W
SPI_CLR_STS_FLAGS
CSIHnSTCR0
-
W
SPI_CLR_STS_FLAGS
CSIHnSTR0
-
R
-
CSIGnSTR0
-
R
-
CSIGnCTL1
SpiCsInactiveAfterLastDat
W
LunDataAccess1.ulRegData
a, SpiDataWidth
LpJobConfig-
>ulMainCtl1Value
SPI_SET_SLIT
CSIHnCTL1
-
W
LunDataAccess1.ulRegData
LpJobConfig-
>ulMainCtl1Value
SPI_SET_SLIT
CSIGnCTL2
SpiBaudrateRegisterSelect
W
LpJobConfig->usCtl2Value
CSIHnCTL2
SpiFifoTimeOut
W
LpJobConfig->usCtl2Value
CSIHnMCTL2
-
W
LunDataAccess1.ulRegData
45
Chapter 6 Registers Details Config Register API Name Registers Macro/Variable Parameter Access R/W/RW CSIHnCFGx
SpiCsIdleTiming,
W
LunDataAccess1.ulRegData
SpiCsHoldTiming,
SpiCsInterDataDelay,
SpiCsSetupTime,
SpiCsIdleEnforcement
CSIHnBRS[0]
SpiBaudrateConfiguration
W
LpCsihOsBaseAddr-
>usCSIHBRS[0]
CSIHnBRS[1]
-
W
LpCsihOsBaseAddr-
>usCSIHBRS[1]
CSIHnBRS[2]
-
W
LpCsihOsBaseAddr-
>usCSIHBRS[2]
CSIHnBRS[3]
-
W
LpCsihOsBaseAddr-
>usCSIHBRS[3]
CSIHnMCTL0
-
W
LpJobConfig->usMCtl0Value
DTFRRQn
-
R
-
PORTPSRx
SpiPortPinSelect
W
LulPinMskVal, LulPinMskVal
& SPI_PORT_REG_MASK
Spi_GetVersionInfo
-
-
-
-
Spi_GetErrorInfor
-
-
-
-
Spi_SelfTest
CSIGnRX0
-
R
-
CSIHnRX0H
-
R
-
CSIGnCTL0
SpiLoopBackSelfTest
W
SPI_SET_DIRECT_ACCES
S
SPI_ZERO
CSIHnCTL0
SpiLoopBackSelfTest
W
LpJobConfig->usMCtl0Value
SPI_ZERO
CSIGnCTL1
SpiLoopBackSelfTest
W
SPI_LOOPBACK_ENABLE
SPI_ZERO
SPI_SET_SLIT
CSIHnCTL1
SpiLoopBackSelfTest
W
SPI_LOOPBACK_ENABLE
SPI_ZERO SPI_SET_SLIT
LunDataAccess1.ulRegData
CSIGnCTL2
SpiLoopBackSelfTest
W
SPI_LOOPBACK_CNTRL2_
VALUE
SPI_ZERO
LpJobConfig->usCtl2Value
CSIHnCTL2
SpiLoopBackSelfTest
W
SPI_LOOPBACK_CSIH_CN
TRL2_VALUE
SPI_ZERO
((LpJobConfig->usCtl2Value)
& SPI_CSIH_PRE_MASK)
46
Registers Details Chapter 6 Config Register API Name Registers Macro/Variable Parameter Access R/W/RW CSIGnCFG0
SpiLoopBackSelfTest
W
SPI_LOOPBACK_DLS_SET
TING
SPI_ZERO
LunDataAccess1.ulRegData
CSIGnSTCR0
SpiLoopBackSelfTest
W
SPI_PE_ERR_CLR
SPI_ZERO
CSIHnSTCR0
SpiLoopBackSelfTest
W
SPI_CSIH_CLR_STS_FLAG
S
SPI_PE_ERR_CLR
SPI_ZERO
CSIGnTX0H
SpiLoopBackSelfTest
W
SPI_LOOPBACK_DATA
SPI_ZERO
CSIHnCFG0
SpiLoopBackSelfTest
W
SPI_LOOPBACK_DLS_SET
TING SPI_ZERO
LunDataAccess1.ulRegData
CSIHnBRSy
SpiLoopBackSelfTest
W
SPI_LOOPBACK_CSIH_BR
S0_VALUE
SPI_ZERO
((LpJobConfigCSConfig-
>usCtl2Value) &
SPI_CSIH_BRS_MASK)
CSIHnTX0W
SpiLoopBackSelfTest
W
SPI_LOOPBACK_DATA
SPI_ZERO
CSIHnSTR0
SpiLoopBackSelfTest
R
-
CSIGnSTR0
SpiLoopBackSelfTest
R
-
ECCCSIHnCTL SpiECCSelfTest
R/W
SET_EC1EDIC_EC2EDIC
ECC_CTL_ECEMF_SET
ECC_CTL_ECER1F_ECER
2F_CLEAR
CTL_ERRCLR_FLAG
CTL_2BIT_ERRCLR_FLAG
CTL_1BIT_ERR_FLAG
ECCCSIHnTM
SpiECCSelfTest
W
SET_TMC_BITS
C
SET_TEST_DISABLE
ECCCSIHnTRC SpiECCSelfTest
W
TRC_ERDB_INITIALIZE
ECCCSIHnTED SpiECCSelfTest
R/W
RAM_INITIALIZE,
ALL_ZERO_PATTERN,
ALL_ONE_PATTERN,
TWO_BIT_PATTERN
IMR
SpiHwUnitSelection
W
Spi_GstHWUnitInfo[LddHWU
and
nit].usRxImrMask,
SpiLoopBackSelfTest
Spi_GstHWUnitInfo[LddHWU
nit].pTxImrAddress,
Spi_GstHWUnitInfo[LddHWU
nit].pErrorImrAddress,
Spi_GstHWUnitInfo[LddHWU
nit].usRxImrMask,
LpHWUnitInfo-
>usTxCancelImrMask
EICn
-
W
SPI_CLR_INT_REQ
47
Chapter 6 Registers Details 48
Interaction Between The User And SPI Driver Component Chapter 7 Chapter 7 Interaction Between The User And SPI
Driver Component The details of the services supported by the SPI 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 SPI Driver Component To The User The SPI Driver Component provides the following functions to upper layer: -
•
To provide the required mechanism to configure the on-chip SPI peripheral.
•
To initialize and de-initialize the SPI driver.
•
To read and write to devices connected through SPI buses.
•
To provide the transmission of data on the SPI bus both synchronously and
asynchronously.
•
To cancel an ongoing transmission.
•
To set the asynchronous transfer mode.
•
To get the status of the SPI Driver and hardware unit.
•
To get the result of the specified job and specified sequence.
•
To provide access to SPI communication to several users(for example,
EEPROM, I/O ASICs).
•
To read the SPI Driver Component version information.
•
To copy Hardware Error Details to User Buffer.
49
Chapter 7 Interaction Between The User And SPI Driver Component 50
SPI Driver Component Header And Source File Description Chapter 8 Chapter 8 SPI Driver Component Header And
Source File Description This section explains the SPI Driver Component’s source and header
files. These files have to be included in the project application while integrating
with other modules.
The C header file generated by SPI Driver Generation Tool:
•
Spi_Cfg.h
•
Spi_Cbk.h
The C source file generated by SPI Driver Generation Tool:
•
Spi_PBcfg.c
•
Spi_Lcfg.c
The SPI Driver Component C header files:
•
Spi_Driver.h
•
Spi_PBTypes.h
•
Spi_LTTypes.h
•
Spi_Ram.h
•
Spi.h
•
Spi_Irq.h
•
Spi_Scheduler.h
•
Spi_Version.h
•
Spi_Types.h
•
Spi_RegWrite.h
The SPI Driver Component C source files:
•
Spi_Driver.c
•
Spi.c
•
Spi_Irq.c
•
Spi_Ram.c
•
Spi_Scheduler.c
•
Spi_Version.c
The Stub C header files:
•
Compiler.h
•
Compiler_Cfg.h
•
MemMap.h
•
Platform_Types.h
•
rh850_Types.h
•
Dem.h
51
Chapter 8 SPI Driver Component Header And Source File Description •
SchM_Spi.h
•
Det.h
•
Os.h
•
Rte.h
•
Std_Types.h
The description of the SPI Driver Component files is provided in the table
below:
Table 8-1 Description Of The SPI Driver Component Files File Details Spi_Cfg.h
This file is generated by the SPI Driver Component Code Generation Tool for
various SPI Driver component pre-compile time parameters. This file contains
macro definitions for the configuration elements and exclusive areas for data
protection. The macros and the parameters generated will vary with respect to the
configuration in the input XML file.
This file is generated by the SPI Driver Component Code Generation Tool for
Spi_Cbk.h
provision of function prototype Declarations for SPI callback Notification
Functions.
Spi_PBcfg.c
This file contains post-build configuration data. The structures related to channel
configuration, job configuration and sequence configuration are provided in this
file. Data structures will vary with respect to parameters configured.
Spi_Lcfg.c
This file contains provision of SPI Link time Parameters. The structures related
to hardware registers are provided in this file. Data structures will vary with
respect to parameters configured.
Spi_Driver.h
This file contains the Function Prototypes that are defined in Spi_Driver.c file.
Spi_PBTypes.h
This file contains the data structure definitions of the channel configuration,
job configuration and sequence configuration
Spi_LTTypes.h
This file contains the data structure definitions of CSIG and CSIH hardware
registers, Interrupt control registers, DMA hardware registers, Hardware unit
information, DMA unit information, storing current status of SPI communication,
channel for the link time parameters, function pointer for Callback notification
function for Jobs, processing sequence, storing external buffer attributes,
Scheduler and DMA Address.
Spi_Ram.h
This file contains the extern declarations for the global variables that are defined in
Spi_Ram.c file and the version information of the file.
Spi.h
This file provides extern declarations for all the SPI Driver Component APIs. This
file provides service Ids of APIs, DET Error codes and type definitions for SPI
Driver initialization structure. This header file shall be included in other modules
to use the features of SPI Driver Component.
Spi_Irq.h
This file contains the function prototypes that are defined in Spi_Irq.c file.
Spi_Scheduler.h
This file contains the function prototypes that are defined in Spi_Scheduler.c file.
Spi_Types.h
This file contains the common macro definitions and the data types required
internally by the SPI software component.
Spi_Version.h
This file contains the definitions of AUTOSAR version numbers of all modules
that are interfaced to SPI Driver.
Spi_RegWrite.h
This file is to have macro definitions for the register write verification.
Spi_Driver.c
This file contains the SPI Low Level Driver code.
Spi.c
This file contains the implementation of all APIs.
Spi_Irq.c
This file contains the ISR functions for SPI Driver Component.
Spi_Ram.c
This file contains the global variables used by SPI Driver Component.
52
SPI Driver Component Header And Source File Description Chapter 8 File Details Spi_Scheduler.c
This file contains the SPI Scheduler code. This contains function to schedule
the sequences according to the priority of the jobs.
Spi_Version.c
This file contains the code for checking version of all modules that are interfaced to
SPI Driver.
Compiler.h
This file 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.
rh850_Types.h
This file provides macros to perform supervisor mode (SV) write enabled Register
ICxxx and IMR register writing using OR/AND/Direct operation
Dem.h
This file is a stub for DEM Component
Det.h
This file is a stub for DET Component
Os.h
This file is a stub for Os Component
Rte.h
This file is a stub for Rte Component
SchM_Spi.h
This file is a stub for Spi SchM Component
Std_Types.h
This file is a stub for Standard types
53
Chapter 8 SPI Driver Component Header And Source File Description 54
Generation Tool Guide Chapter 9 Chapter 9 Generation Tool Guide For information on the SPI Driver Component Code Generation Tool,
please refer “R20UT3727EJ0101-AUTOSAR.pdf” document.
55
Chapter 9 Generation Tool Guide 56

Application Programming Interface Chapter 10 Chapter 10 Application Programming Interface
This section explains the Data types and APIs provided by the SPI Driver
Component to the Upper layers.
10.1 Imported Types This section explains the Data types imported by the SPI Driver Component
and lists its dependency on other modules.
In this section all types included from the Std_Types.h are listed:
•
Std_ReturnType
•
Std_VersionInfoType
10.1.1 Standard Types In this section all types included from the Std_Types.h are listed:
•
Std_ReturnType
•
Std_VersionInfoType
10.1.2 Other Module Types In this chapter all types included from the Dem_types.h are listed:
•
Dem_EventIdType
•
Dem_EventStatusType
10.2 Type Definitions Following are the type definitions of SPI Driver Component according to
AUTOSAR Specification.
Spi_ConfigType Name: Spi_ConfigType
Type: Structure
Implementation Specific
The contents of the initialization data
Range: structure are SPI specific
This type of the external data structure shall contain the initialization data for the SPI
Description: driver/Handler
Spi_StatusType Name: Spi_StatusType
Type: Enumeration
SPI_UNINIT
The SPI Handler/Driver is not initialized or not
usable
SPI_IDLE
The SPI Handler/Driver is not currently
Range: transmitting any job
57



Chapter 10 Application Programming Interface SPI_BUSY
The SPI Handler/Driver is performing a SPI
job(transmit)
Description: This type defines a range of specific status for SPI Handler/driver
Spi_JobResultType Name: Spi_JobResultType
Type: Enumeration
SPI_JOB_OK
The last transmission of the job has been
finished successfully
SPI_JOB_PENDING
The SPI Handler/Driver is performing a SPI
Range: Job. The meaning of this status is equal to
SPI_BUSY
SPI_JOB_FAILED
The last transmission of the job has failed
Description: This type defines a range of specific jobs status for SPI Handler/driver
Spi_SeqResultType Name: Spi_SeqResultType
Type: Enumeration
SPI_SEQ_OK
The last transmission of the Sequence has
been finished successfully
SPI_SEQ_PENDING
The SPI Handler/Driver is performing a SPI
Sequence The meaning of this status is equal to
SPI_BUSY
Range: SPI_SEQ_FAILED
The last transmission of the Sequence has
failed
SPI_SEQ_CANCELLED
The last transmission of the Sequence has
been cancelled by user.
Description: This type defines a range of specific sequences status for SPI Handler/driver
Spi_DataType Name: Spi_DataType
Type: uint8,uint16,uint32
0 to 255, 0 to 65535,
This is implementation specific but not all
0 to 4294967296.
values may be valid within the type This type
Range: shall be chosen in order to have the most
efficient implementation on a specific
microcontroller platform
Description: Type of application data buffer elements
Spi_NumberOfDataType Name: Spi_NumberOfDataType
Type: uint16
Range: 0 to 65535
Description: Type for defining the number of data elements of the type Spi_DataType to send
and/or receive by channel
58





Application Programming Interface Chapter 10 Spi_ChannelType Name: Spi_ChannelType
Type: uint8
Range: 0 to 255
Description: Specifies the identification(Id) for a channel
Spi_JobType Name: Spi_JobType
Type: uint16
Range: 0 to 65535
Description: Specifies the identification(Id) for a Job
Spi_SequenceType Name: Spi_SequenceType
Type: uint8
Range: 0 to 255
Description: Specifies the identification(Id) for a sequence of Jobs
Spi_HWUnitType Name: Spi_HWUnitType
Type: uint8
Range: 0 to 255
Description: Specifies the identification(Id) for a SPI Hardware microcontroller peripheral(unit)
Spi_AsyncModeType Name: Spi_AsyncModeType
Type: Enumeration
SPI_POLLING_MODE
The asynchronous mechanism is ensured
by polling, so interrupts related to SPI
Range: busses handled asynchronously are
disabled
SPI_INTERRUPT_MODE
Streaming access mode
Description: Specifies the asynchronous mechanism mode for SPI busses handled
asynchronously in LEVEL2.
Following are the internal type definitions used by the SPI Driver module.
Spi_CommErrorType Name: Spi_CommErrorType
Type: Structure
59


Chapter 10 Application Programming Interface Type Name Explanation Spi_HWErrorsType
ErrorType
This is the type of the
hardware error.
Spi_HWUnitType
HwUnit
This is the hardware
unit in which error is
reported.
Spi_SequenceType
SeqID
This is the sequence
Element: id for which error is
reported.
Spi_JobType
JobID
This is the job id for
which error is
reported.
Description: This type is used to provide the details regarding the type of hardware errors, hardware
unit, sequence and job in which the errors were reported.
Spi_HWErrorsType Name: Spi_HWErrorsType
Type: Enumeration
SPI_NO_ERROR
No hardware error has occured.
SPI_OVERRUN_ERROR
Over Run Error has occured.
SPI_PARITY_ERROR
Parity Error has occured.
SPI_DATA_CONSISTENCY_ERROR Data Consistency Error has occured
Range: SPI_OVERFLOW_ERROR
Over Flow Error has occured
SPI_ECC_1BIT_ERROR
1 Bit ECC Error has occured
Description: This type defines different types of hardware errors in SPI driver.
Spi_SelfTestType Name: Spi_SelfTestType
Type: uint8
Range: 0 to 255
Description: Specifies the type for self test functionality.
Spi_ReturnStatus Name: Spi_ReturnStatus
Type: Enumeration
SPI_SELFTEST_INVALID_MODE
When invalid argument other than
LoopBack_Init/ LoopBack_Init_RunTime/
Range: ECC_Init_RunTime/ ECC_Init are
passed.
SPI_SELFTEST_DRIVERBUSY
When SelfTest API is invoked during any
active transmission, i.e when driver is busy.
Range: SPI_SELFTEST_PASS
SelfTest functionality is successful.
SPI_SELFTEST_FAILED
SelfTest functionality is failed.
Description: This type defines the return status of the self test functionality.
60
Application Programming Interface Chapter 10 10.3 Function Definitions Table 10-1 The APIs provided by the SPI Driver Component SI. No API’s 1.
Spi_Init
2.
Spi_DeInit
3.
Spi_WriteIB
4.
Spi_AsyncTransmit
5.
Spi_ReadIB
6.
Spi_SetupEB
7.
Spi_GetStatus
8.
Spi_GetJobResult
9.
Spi_GetSequenceResult
10.
Spi_GetVersionInfo
11.
Spi_SyncTransmit
12.
Spi_Cancel
13.
Spi_SetAsyncMode
14.
Spi_MainFunction_Handling
15.
Spi_GetHWUnitStatus
16.
Spi_SelfTest
17.
Spi_GetErrorInfo
10.3.1 Spi_Init Name: Spi_Init
FUNC (void, SPI_PUBLIC_CODE) Spi_Init
Prototype: (
P2CONST(Spi_ConfigType, AUTOMATIC, SPI_APPL_CONST) ConfigPtr
)
Service ID: 0x00
Sync/Async: Synchronous
Reentrancy: Non-Reentrant
Type Parameter Value/Range Parameters In: Pointer to Spi_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 SPI Driver component.
Configuration None
Dependency: Preconditions: None
61
Chapter 10 Application Programming Interface 10.3.2 Spi_DeInit Name: Spi_DeInit
FUNC (Std_ReturnType, SPI_PUBLIC_CODE) Spi_DeInit
Prototype: (
void
)
Service ID: 0x01
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: Std_ReturnType
E_OK, E_NOT_OK
Description: This service performs De-initialization of the SPI Driver component.
Configuration None
Dependency: Preconditions: None
10.3.3 Spi_WriteIB Name: Spi_WriteIB
FUNC (Std_ReturnType, SPI_PUBLIC_CODE) Spi_WriteIB
Prototype: (
Spi_ChannelType Channel,
P2CONST(Spi_DataType, AUTOMATIC, SPI_APPL_CONST) DataBufferPtr
)
Service ID: 0x02
Sync/Async: Synchronous
Reentrancy: Reentrant
Type Parameter Value/Range Parameters In: Spi_ChannelType
Channel
Min: 0
Max: 255
Pointer to Spi_DataType
DataBufferPtr
NA
Parameters InOut: NA
NA
NA
Parameters out: NA
NA
NA
Type Possible Return Values Return Value: Std_ReturnType
E_OK, E_NOT_OK
Description: This service for writing one or more data to an IB SPI Handler/Driver channel specified
by parameter.
Configuration None
Dependency: Preconditions:
The SPI Handler/Driver should have been initialized before this service is called.
62
Application Programming Interface Chapter 10 10.3.4 Spi_AsyncTransmit Name: Spi_AsyncTransmit
FUNC (Std_ReturnType, SPI_PUBLIC_CODE) Spi_AsyncTransmit
Prototype:
(
Spi_SequenceType Sequence
)
Service ID: 0x03
Sync/Async: Asynchronous
Reentrancy: Reentrant
Type Parameter Value/Range Parameters In: Spi_SequenceType
Sequence
Min: 0
Max: 255
Parameters InOut: NA
NA
NA
Parameters out: NA
NA
NA
Type Possible Return Values Return Value: Std_ReturnType
E_OK, E_NOT_OK
Description: This service for transmitting data asynchronously
Configuration None
Dependency: Preconditions:
The SPI Handler/Driver should have been initialized before this service is called.
This method shall be called after a Spi_SetupEB method for EB Channels or
Spi_WriteIB method for IB Channels but before the Spi_ReadIB method.
10.3.5 Spi_ReadIB Name: Spi_ReadIB
FUNC (Std_ReturnType, SPI_PUBLIC_CODE) Spi_ReadIB
Prototype:
(
Spi_ChannelType Channel,
P2VAR(Spi_DataType, AUTOMATIC, SPI_APPL_DATA) DataBufferPtr
)
Service ID: 0x04
Sync/Async: Synchronous
Reentrancy: Reentrant
Type Parameter Value/Range Parameters In: Spi_ChannelType
Channel
Min: 0
Max: 255
Pointer to Spi_DataType
DataBufferPtr
NA
Parameters InOut: NA
NA
NA
Parameters out: NA
NA
NA
Type Possible Return Values Return Value: Std_ReturnType
E_OK, E_NOT_OK
Description: Service for reading one or more data from an IB SPI Handler/Driver Channel specified by
parameter.
63
Chapter 10 Application Programming Interface Configuration None
Dependency: Preconditions:
The SPI Handler/Driver should have been initialized before this service is called.
This method shall be called after one Transmit method call to have relevant data within
IB Channel.
10.3.6 Spi_SetupEB Name: Spi_SetupEB
FUNC (Std_ReturnType, SPI_PUBLIC_CODE) Spi_SetupEB
Prototype:
(
Spi_ChannelType Channel,
CONST(Spi_DataType, AUTOMATIC, SPI_APPL_DATA) SrcDataBufferPtr
P2VAR(Spi_DataType, AUTOMATIC, SPI_APPL_DATA) DesDataBufferPtr
Spi_NumberOfDataType Length,
)
Service ID: 0x05
Sync/Async: Synchronous
Reentrancy: Reentrant
Type Parameter Value/Range Parameters In: Pointer to Spi_DataType
SrcDataBufferPtr
NA
Spi_ChannelType
Channel
Min : 0
MAx: 255
Spi_NumberOfDataType
Length
Min : 0
MAx: 65535
Pointer to Spi_DataType
DesDataBufferPtr
NA
Parameters InOut: NA
NA
NA
Parameters out: NA
NA
NA
Type Possible Return Values Return Value: Std_ReturnType
E_OK, E_NOT_OK
Description: Service to setup the buffers and the length of data for the EB SPI Handler/Driver
Channel specified.
Configuration None
Dependency: Preconditions:
The SPI Handler/Driver should have been initialized before this service is called.
10.3.7 Spi_GetStatus Name: Spi_GetStatus
FUNC (Spi_StatusType, SPI_PUBLIC_CODE) Spi_GetStatus
Prototype:
(
void
)
Service ID: 0x06
64
Application Programming Interface Chapter 10 Sync/Async: Synchronous
Reentrancy: 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: Spi_StatusType
SPI_UNINIT/SPI_IDLE/SPI_BUSY
Description: This service shall return the SPI Handler/Driver software module status.
Configuration None
Dependency: Preconditions:
None
10.3.8 Spi_GetJobResult Name: Spi_GetJobResult
FUNC (Spi_JobResultType, SPI_PUBLIC_CODE) Spi_GetJobResult
Prototype:
(
Spi_JobType Job
)
Service ID: 0x07
Sync/Async: Synchronous
Reentrancy: Reentrant
Type Parameter Value/Range Parameters In: Spi_JobType
Job
Min: 0
Max: 65535
Parameters InOut: NA
NA
NA
Parameters out: NA
NA
NA
Type Possible Return Values Return Value: Spi_JobResultType SPI_JOB_OK/SPI_JOB_PENDING/SPI_JOB_FAILED
Description: This service shall return the last transmission result of the specified Job.
Configuration None
Dependency: Preconditions:
The SPI Handler/Driver should have been initialized before this service is called.
10.3.9 Spi_GetSequenceResult Name: Spi_GetSequenceResult
FUNC (Spi_SeqResultType, SPI_PUBLIC_CODE) Spi_GetSequenceResult
Prototype:
(
Spi_SequenceType Sequence
)
Service ID: 0x08
65
Chapter 10 Application Programming Interface Sync/Async: Synchronous
Reentrancy: Reentrant
Type Parameter Value/Range Parameters In: Spi_SequenceType Sequence
Min: 0
Max: 255
Parameters InOut: NA
NA
NA
Parameters out: NA
NA
NA
Type Possible Return Values Return Value: Spi_SeqResultType SPI_SEQ_OK/SPI_SEQ_PENDING/SPI_SEQ_FAILED/
SPI_SEQ_CANCELLED
Description: This service shall return the last transmission result of the specified Sequence.
Configuration None
Dependency: Preconditions:
The SPI Handler/Driver should have been initialized before this service is called.
10.3.10 Spi_SyncTransmit Name: Spi_SyncTransmit
FUNC (Std_ReturnType, SPI_PUBLIC_CODE) Spi_SyncTransmit
Prototype:
(
Spi_SequenceType Sequence
)
Service ID: 0x0A
Sync/Async: Asynchronous
Reentrancy: Reentrant
Type Parameter Value/Range Parameters In: Spi_SequenceType Sequence
Min: 0
Max: 255
Parameters InOut: NA
NA
NA
Parameters out: NA
NA
NA
Type Possible Return Values Return Value: Std_ReturnType
E_OK/E_NOT_OK
Description: This service is for transmitting data synchronously.
Configuration None
Dependency: Preconditions:
The SPI Handler/Driver should have been initialized before this service is called.
10.3.11 Spi_GetHWUnitStatus Name: Spi_GetHWUnitStatus
FUNC (Spi_StatusType, SPI_PUBLIC_CODE) Spi_GetHWUnitStatus
Prototype:
(
Spi_HWUnitType HWUnit
)
Service ID: 0x0B
66
Application Programming Interface Chapter 10 Sync/Async: Synchronous
Reentrancy: Reentrant
Type Parameter Value/Range Parameters In: Spi_HWUnitType
HWUnit
Min: 0
Max: 255
Parameters InOut: NA
NA
NA
Parameters out: NA
NA
NA
Type Possible Return Values Return Value: Spi_StatusType
SPI_UNINIT/SPI_IDLE/SPI_BUSY
Description: This service shall return the status of the specified SPI Hardware microcontroller
peripheral
Configuration SpiHwStatusApi should be Enabled
Dependency: Preconditions:
The SPI Handler/Driver should have been initialized before this service is called
10.3.12 Spi_Cancel Name: Spi_Cancel
FUNC (void, SPI_PUBLIC_CODE) Spi_Cancel
Prototype:
(
Spi_SequenceType Sequence
)
Service ID: 0x0C
Sync/Async: Asynchronous
Reentrancy: Reentrant
Type Parameter Value/Range Parameters In: Spi_SequenceType Sequence
Min: 0
Max: 255
Parameters InOut: NA
NA
NA
Parameters out: NA
NA
NA
Type Possible Return Values Return Value: NA
NA
Description: This service shall cancel the specified on-going sequence transmission.
Configuration SpiCancelApi should be Enabled
Dependency: Preconditions:
The SPI Handler/Driver should have been initialized before this service is called
10.3.13 Spi_SetAsyncMode Name: Spi_SetAsyncMode
FUNC (Std_ReturnType, SPI_PUBLIC_CODE) Spi_SetAsyncMode
Prototype:
(
Spi_AsyncModeType Mode
)
67
Chapter 10 Application Programming Interface Service ID: 0x0D
Sync/Async: Synchronous
Reentrancy: Non Reentrant
Type Parameter Value/Range Parameters In: Spi_AsyncModeType
Mode
SPI_POLLING_MODE /
SPI_INTERRUPT_MODE
Parameters InOut: NA
NA
NA
Parameters out: NA
NA
NA
Type Possible Return Values Return Value: Std_ReturnType
E_OK/E_NOT_OK
Description: Service to set the asynchronous mechanism mode for SPI buses handled
asynchronously.
Configuration None
Dependency: Preconditions:
The SPI Handler/Driver should have been initialized before this service is called
10.3.14 Spi_GetVersionInfo Name: Spi_GetVersionInfo
FUNC (void, SPI_PUBLIC_CODE) Spi_GetVersionInfo
Prototype:
(
P2VAR(Std_VersionInfoType, AUTOMATIC, SPI_APPL_DATA)
versionInfoPtr
)
Service ID: 0x09
Sync/Async: Synchronous
Reentrancy: Reentrant
Type Parameter Value/Range Parameters In: NA
NA
NA
Parameters InOut: NA
NA
NA
Parameters out: pointer to Std_VersionInfoType versionInfoPtr
NA
Type Possible Return Values Return Value: NA
NA
Description: This service returns the version information of this module. The version information
includes:
- Module Id
- Vendor Id
- Vendor specific version numbers
Configuration SpiVersionInfoApi should be Enabled
Dependency: Preconditions: None
68
Application Programming Interface Chapter 10 10.3.15 Spi_MainFunction_Handling Name: Spi_MainFunction_Handling
FUNC(void, SPI_PUBLIC_CODE) Spi_MainFunction_Handling
Prototype:
(
void
)
Service ID: 0x10
Sync/Async: NA
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: NA
NA
Description: This function is to be invoked in the scheduler loop for asynchronous transmission in
polling mode
Configuration None
Dependency: Preconditions:
This function should be invoked only when polling is selected by Spi_SetAsyncMode API
10.3.16 Spi_SelfTest Name: Spi_SelfTest
FUNC(Spi_ReturnStatus, SPI_PUBLIC_CODE) Spi_SelfTest
Prototype:
(
Spi_SelfTestType LucTestFeature
)
Service ID: 0x11
Sync/Async: Synchronous
Reentrancy: Reentrant
Type Parameter Value/Range Parameters In: Spi_SelfTestType
LucTestFeature
Min: 0
Max: 255
Parameters InOut: NA
NA
NA
Parameters out: NA
NA
NA
Type Possible Return Values Return Value: Spi_ReturnStatus
SPI_SELFTEST_DRIVERBUSY, SPI_SELFTEST_PASS,
SPI_SELFTEST_FAILED, SPI_SELFTEST_INVALID_MODE
Description: Function to Execute SPI Self Test
Configuration None
Dependency: Preconditions:
None
69
Chapter 10 Application Programming Interface 10.3.17 Spi_GetErrorInfo Name: Spi_GetErrorInfo
FUNC(uint8, SPI_PUBLIC_CODE) Spi_GetErrorInfo
Prototype:
(
P2VAR(Spi_CommErrorType, AUTOMATIC, SPI_CONFIG_DATA) LpUserBuffer,
uint8 LucBufferSize
)
Service ID: 0x12
Sync/Async: Synchronous
Reentrancy: Reentrant
Type Parameter Value/Range Parameters In: Pointer to Spi_CommErrorType LpUserBuffer
NA
unit8
LucBufferSize
Min: 0
Max: 255
Parameters InOut: NA
NA
NA
Parameters out: NA
NA
NA
Type Possible Return Values Return Value: uint8
0 to 255
Description: Function to Copy Hardware Error Details to User Buffer
Configuration None
Dependency: Preconditions:
None
70
Development And Production Errors Chapter 11 Chapter 11 Development And Production Errors In this section the development errors that are reported by the SPI Driver Component
are tabulated. The development errors will be reported only when the pre compiler option
SpiDevErrorDetect is enabled in the configuration. The production code errors are not
supported by SPI Driver Component.
11.1 SPI Driver Component Development Errors The following table contains the DET errors that are reported by SPI Driver
Component. These errors are reported to Development Error Tracer Module when the SPI
Driver Component APIs are invoked with wrong input parameters or without initialization of
the driver.
Table 11-1 DET Errors Of SPI Driver Component Sl. No. 1 Error Code
SPI_E_PARAM_CHANNEL
Related API(s)
Spi_WriteIB, SpiReadIB and Spi_SetupEB
Source of Error
When the API service is invoked with invalid channel Id and if incorrect type of
channel (IB or EB) is used with services.
Sl. No. 2 Error Code
SPI_E_PARAM_JOB
Related API(s)
Spi_GetJobResult
Source of Error
When the API service is invoked with invalid job Id.
Sl. No. 3 Error Code
SPI_E_PARAM_SEQ
Related API(s)
Spi_AsyncTransmit, Spi_GetSequenceResult, Spi_SyncTransmit and Spi_Cancel.
Source of Error
When the API service is invoked with invalid sequence Id.
Sl. No. 4 Error Code
SPI_E_PARAM_LENGTH
Related API(s)
Spi_SetupEB
Source of Error
When the API service is invoked with length greater than the configured length.
Sl. No. 5 Error Code
SPI_E_PARAM_UNIT
Related API(s)
Spi_GetHWUnitStatus
Source of Error
When the API service is invoked with invalid hardware unit Id.
Sl. No. 6 Error Code
SPI_E_SEQ_PENDING
Related API(s)
Spi_AsyncTransmit
Source of Error
When the API service is invoked in a wrong sequence.
Sl. No. 7 Error Code
SPI_E_SEQ_IN_PROCESS
Related API(s)
Spi_SyncTransmit, Spi_SelfTest
Source of Error
When the API service is invoked at wrong time.
Sl. No. 8 Error Code
SPI_E_ALREADY_INITIALIZED
Related API(s)
Spi_Init
71
Chapter 11 Development And Production Errors Source of Error
When the API Spi_Init is invoked when the SPI driver is already initialized.
Sl. No. 9 Error Code
SPI_E_INVALID_DATABASE
Related API(s)
Spi_Init
Source of Error
When the API service is invoked with invalid pointer.
Sl. No. 10 Error Code
SPI_E_UNINIT
Related API(s)
Spi_DeInit, Spi_AsyncTransmit, Spi_Cancel, Spi_GetStatus,
Spi_GetHWUnitStatus, Spi_GetJobResult, Spi_GetSequenceResult, Spi_WriteIB,
Spi_ReadIB, Spi_SetupEB, Spi_SyncTransmit, Spi_SetAsyncMode,
Spi_MainFunction_Handling and Spi_GetErrorInfo.
Source of Error
When the APIs are invoked without the initialization of SPI Driver Component.
Sl. No. 11 Error Code
SPI_E_PARAM_POINTER
Related API(s)
Spi_ReadIB and Spi_GetVersionInfo.
Source of Error
When the API service is invoked with null pointer.
Note: This error code (SPI_E_PARAM_POINTER) is applicable for Autosar R4.0
only.
Sl. No. 12 Error Code
SPI_E_PARAM_CONFIG
Related API(s)
Spi_Init
Source of Error
When the API invoked with null config pointer.
Sl. No. 13 Error Code
SPI_E_MAINFUNCTION_HANDLING_INVALIDMODE
Related API(s)
Spi_MainFunction_Handling
Source of Error
When the API invoked in SPI_INTERRUPT_MODE.
11.2 SPI Driver Component Production Errors In this section the DEM errors identified in the SPI Driver Component are listed. SPI Driver
Component reports these errors to DEM by invoking Dem_ReportErrorStatus API. This API is
invoked, when the processing of the given API request fails.
Table 11-2 DEM Errors Of SPI Driver Component Sl. No. 1 Error Code
SPI_E_HARDWARE_ERROR
Related API(s)
Spi_Init , Spi_SyncTransmit, Spi_MainFunction_Handling, Spi_ComErrorISR and
Spi_SelfTest
Source of Error
1. Overrun error: When previously received data still resides in the reception
register(RX), because it wasn’t read, and new data is received.
2. Data Consistency Check error: When data physically sent to the output pin is not
identical to the original data that was copied to the shift register.
3. Parity error: When parity check fails during data transmission.
Note: When DEM error 'SPI_E_HARDWARE_ERROR' occurs, corresponding
sequence result will be updated as failed and sequence will be suspended.
Sl. No. 2 Error Code
SPI_E_DATA_TX_TIMEOUT_FAILURE
Related API(s)
Spi_SyncTransmit, Spi_Init and Spi_SelfTest.
72
Development And Production Errors Chapter 11 Source of Error
When Hardware data transmit timeout error is detected, This error will be reported to
DEM
Sl. No. 3
Error Code
SPI_E_INT_INCONSISTENT
Related API(s)
All ISRs
Source of Error
DemEventParameter which shall be issued when Interrupt consistency error was
detected.
Sl. No. 4 Error Code
SPI_E_ECC_SELFTEST_FAILURE
Related API(s)
Spi_Init and Spi_SelfTest
Source of Error
DemEventParameter which shall be issued when Ecc selft test error was detected.
Sl. No. 5
Error Code
SPI_E_LOOPBACK_SELFTEST_FAILURE
Related API(s)
Spi_Init and Spi_SelfTest
Source of Error
DemEventParameter which shall be issued when loop back self test error was
detected.
Sl. No. 6
Error Code
SPI_E_REG_WRITE_VERIFY
Related API(s)
All APIs accessing the registers
Source of Error
DemEventParameter which shall be issued when a mismatch during write-verify
check is detected.
11.3 SPI Driver Hardware Errors 11.3.1 Data Consistency Check The purpose of the data consistency check is to ensure that the data physically sent to the output pin is
identical to the original data that was copied to the shift register.When the data consistency check is
active, the data transferred from CSIGnTX0W/CSIGnTX0H or CSIHnTX0W/CSIHnTX0H to the shift
register is copied to a separate register. In addition, the physical levels at CSIGTSO/ CSIHTSO are
capture and the logical interpretation is written to an own shift register.After completion of the
transmission, the data sent is compared with the original transmission data.
11.3.2 Parity Check
Parity is a mean to detect a single bit failure during data transmission. CSIG/CSIH can append a
parity bit to the last data bit.The parity bit is checked after reception is complete.When the extended
data length (EDL) function is used, a parity bit is added after the last bit of the data.
11.3.3 Overrun
This error occurs when previously received data still resides in the reception register
CSIGnRX0/CSIHnRX0, because it wasn’t read, and new data is received.The overrun error is not
generated if data reception is disabled.
Note:
In general, If any of the above error is occured,a DEM error 'SPI_E_HARDWARE_ERROR' is reported to
DEM .Also corresponding sequence result will be updated as failed and sequence will be suspended.
73
Chapter 11 Development And Production Errors 74
Memory Organization Chapter 12 Chapter 12 Memory Organization Following picture depicts a typical memory organization, which must be met
for proper functioning of SPI Driver Component software.
75





























Chapter 12 Memory Organization ROM Section SPI Driver Component RAM ect Library Object es SPI Driver code related to APIs are
Global RAM of unspecific size
placed in this memory.
required for SPI Driver functioning.
X1 Segment Name:
Segment Name:
Y1 SPI_PUBLIC_CODE_ROM NO_INIT_RAM_UNSPECIFIED Global 1- bit RAM initialized by
SPI Driver code related to internal
start-Up code.
functions are placed in this memory
Y2 X2 Segment Name:
Segment Name:
RAM_UNSPECIFIED SPI_PRIVATE_CODE_ROM Global 1-bit RAM to be initialized
by SPI Driver
SPI Driver code related to ISR functions
Segment Name:
are placed in this memory
NO_INIT_RAM_1BITX3 Y3 Segment Name:
SPI_FAST_CODE_ROM Global 8- bit R AM initialized by
SPI D river.
Segment Name:
Y4 NO_IN IT_RA M _8BIT
Global 16 -bit RAM initialized by
SPI Driver.
Segment Name:
Y5 NO_INIT_RAM_16BIT Global RAM variables of 16-bit size that are
initialized by start-up code
Segment Name:
Y6 RAM_16BIT Tool Generated Files The const section (other than SP I
Global RAM of unspecific size required
Configuration structure) in the file
for SPI Driver functioning. The
Spi_PBcfg.c is placed in this memory.
Generation tool allocates this RAM.
Y7 X4 Segment Name:
Segment name:
SPI_CFG_RAM_UNSPECIFIED SPI_CFG_DATA_UNSPECIFIED The const section in the file Spi_Lcfg.c,
is placed in this memory.
X5 Segment Name:
CONST_ROM_UNSPECIFIED Figure 12-1
SPI Driver Component Driver Organization
76
Memory Organization Chapter 12 ROM Section (X1, X2, X3,X4,X5 and X6):
SPI_PUBLIC_CODE_ROM (X1): API(s) of SPI Driver Component, which can
be located in code memory.
SPI_PRIVATE_CODE_ROM (X2): Internal functions of SPI Driver Component
code that can be located in code memory.
SPI_FAST_CODE_ROM(X3): SPI Driver code related to ISR
functions are placed in this memory Segment Name
SPI_CFG_DATA_UNSPECIFIED (X4): This section consists of SPI Driver
Component constant configuration structures. This can be located in code
memory.
CONST_ROM_UNSPECIFIED (X5): This section consists of SPI Driver
Component constant structures used for function pointers in SPI Driver
Component. This can be located in code memory.
RAM Section (Y1, Y2, Y3, Y4, Y5 and Y6): NO_INIT_RAM_UNSPECIFIED (Y1): This section consists of the global RAM
variables that are used internally by SPI Driver Component. This can be
located in data memory.
RAM_UNSPECIFIED (Y2): This section consists of the global RAM variables
of 1-bit size that are initialized by start-up code and used internally by SPI
Driver Component. This can be located in data memory.
RAM_1BIT (Y3): This section consists of the global RAM variables of 1-bit size
that are initialized by start-up code and used internally by SPI Driver
Component. The specific sections of respective software components will be
merged into this RAM section accordingly.
NO_INIT_RAM_8BIT (Y4): This section consists of the global RAM variables of
8-bit size that are used internally by SPI Driver Component. This can be
located in data memory.
NO_INIT_RAM_16BIT (Y5): This section consists of the global RAM variables
of 16-bit size that are used internally by SPI Driver Component. This can be
located in data memory.
RAM_16BIT (Y6): This section consists of the global RAM variables of 16-bit
size that are initialized by start-up code and used internally by SPI software
component and other software components. The specific sections of respective
software components will be merged into this RAM section accordingly.
SPI_CFG_RAM_UNSPECIFIED (Y7): This section consists of the global RAM
variables that are generated by SPI Driver Component Generation Tool. This
can be located in data memory.
77
Chapter 12 Memory Organization Remark
X1, X2, Y1, Y2, Y3, Y4, Y5, Y6 pertain to only SPI Driver Component and
do not include memory occupied by Spi_PBcfg.c or Spi_Lcfg.c file
generated by SPI Driver Component Generation Tool.
User must ensure that none of the memory areas overlap with each other.
Even ‘debug’ information should not overlap.
78
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 SPI Driver Component The details of the services supported by the SPI 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
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_SPI_P1M_04_05_12_13_20_21. 701304, 701305, 701312, 701313, 701320,
arxml
701321
79
Chapter 13 P1M Specific Information R403_SPI_P1M_10_11_14_15_18_19 701310, 701311, 701314, 701315, 701318,
_22_23.arxml
701319, 701322, 701323
13.1.3 ISR Function The table below provides the list of handler addresses corresponding to the
hardware unit ISR(s) in SPI Driver Component. The user should configure the
ISR functions mentioned below.
Table 13-2 Interrupt Handler Interrupt Source Name of the ISR Function INTCSIG0IRE
SPI_CSIG0_TIRE_ISR
SPI_CSIG0_TIRE_CAT2_ISR
INTCSIG0IR
SPI_CSIG0_TIR_ISR
SPI_CSIG0_TIR_CAT2_ISR
INTCSIG0IC
SPI_CSIG0_TIC_ISR
SPI_CSIG0_TIC_CAT2_ISR
INTCSIH0IRE
SPI_CSIH0_TIRE_ISR
SPI_CSIH0_TIRE_CAT2_ISR
INTCSIH0IR
SPI_CSIH0_TIR_ISR
SPI_CSIH0_TIR_CAT2_ISR
INTCSIH0IC
SPI_CSIH0_TIC_ISR
SPI_CSIH0_TIC_CAT2_ISR
INTCSIH0IJC
SPI_CSIH0_TIJC_ISR
SPI_CSIH0_TIJC_CAT2_ISR
INTCSIH1IRE
SPI_CSIH1_TIRE_ISR
SPI_CSIH1_TIRE_CAT2_ISR
INTCSIH1IR
SPI_CSIH1_TIR_ISR
SPI_CSIH1_TIR_CAT2_ISR
INTCSIH1IC
SPI_CSIH1_TIC_ISR
SPI_CSIH1_TIC_CAT2_ISR
INTCSIH1IJC
SPI_CSIH1_TIJC_ISR
SPI_CSIH1_TIJC_CAT2_ISR
INTCSIH2IRE
SPI_CSIH2_TIRE_ISR
SPI_CSIH2_TIRE_CAT2_ISR
INTCSIH2IR
SPI_CSIH2_TIR_ISR
SPI_CSIH2_TIR_CAT2_ISR
INTCSIH2IC
SPI_CSIH2_TIC_ISR
SPI_CSIH2_TIC_CAT2_ISR
INTCSIH2IJC
SPI_CSIH2_TIJC_ISR
SPI_CSIH2_TIJC_CAT2_ISR
INTCSIH3IRE
SPI_CSIH3_TIRE_ISR
SPI_CSIH3_TIRE_CAT2_ISR
INTCSIH3IR
SPI_CSIH3_TIR_ISR
80
P1M Specific Information Chapter 13 Interrupt Source Name of the ISR Function SPI_CSIH3_TIR_CAT2_ISR
INTCSIH3IC
SPI_CSIH3_TIC_ISR
SPI_CSIH3_TIC_CAT2_ISR
INTCSIH3IJC
SPI_CSIH3_TIJC_ISR
SPI_CSIH3_TIJC_CAT2_ISR
INTDMA[0-15]
SPI_DMA00_ISR
SPI_DMA00_CAT2_ISR
SPI_DMA01_ISR
SPI_DMA01_CAT2_ISR
SPI_DMA02_ISR
SPI_DMA02_CAT2_ISR
SPI_DMA03_ISR
SPI_DMA03_CAT2_ISR
SPI_DMA04_ISR
SPI_DMA04_CAT2_ISR
SPI_DMA05_ISR
SPI_DMA05_CAT2_ISR
SPI_DMA06_ISR
SPI_DMA06_CAT2_ISR
SPI_DMA07_ISR
SPI_DMA07_CAT2_ISR
SPI_DMA08_ISR
SPI_DMA08_CAT2_ISR
SPI_DMA09_ISR
SPI_DMA09_CAT2_ISR
SPI_DMA10_ISR
SPI_DMA10_CAT2_ISR
SPI_DMA11_ISR
SPI_DMA11_CAT2_ISR
SPI_DMA12_ISR
SPI_DMA12_CAT2_ISR
SPI_DMA13_ISR
SPI_DMA13_CAT2_ISR
SPI_DMA14_ISR
SPI_DMA14_CAT2_ISR
SPI_DMA15_ISR
SPI_DMA15_CAT2_ISR
Note: The functions with “INTERRUPT“ as pilot tag, provides an indication to
the compiler that the function following this tag is an interrupt function type.
The tag name can vary according to the compiler. User should take care of
the tag name with respect to compiler used.
81











Chapter 13 P1M Specific Information 13.2. Sample Application The Sample Application is provided as reference to the user to understand the
method in which the SPI APIs can be invoked from the application.
Generic
AUTOSAR
RH850 Types
ST
STUB
Common SPI
P1x
SchM
STUB
sample
Sample
DEM
application
application
STUB Os
STUB
MCU
Figure 13-1 Overview Of SPI Driver Sample Application 13.2.1 Sample Application Structure The Sample Application of the P1M is available in the path
The Sample Application consists of the following folder structure
X1X\P1x\modules\spi\definition\<AUTOSAR_version>\
<SubVariant>\R403_SPI_P1M_04_05_12_13_20_21.arxml
\R403_SPI_P1M_10_11_14_15_18_19_22_23.arxml
X1X\P1x\modules\spi\sample_application\<SubVariant>\<AUTOSAR_version>
\src\Spi_Lcfg.c
\src\Spi_PBcfg.c
\inc\Spi_Cfg.h
\inc\Spi_Cbk.h
/config/App_SPI_P1M_701304_Sample.arxml
/config/App_SPI_P1M_701305_Sample.arxml
/config/App_SPI_P1M_701310_Sample.arxml
/config/App_SPI_P1M_701311_Sample.arxml
/config/App_SPI_P1M_701312_Sample.arxml
/config/App_SPI_P1M_701313_Sample.arxml
/config/App_SPI_P1M_701314_Sample.arxml
82
P1M Specific Information Chapter 13 /config/App_SPI_P1M_701315_Sample.arxml
/config/App_SPI_P1M_701318_Sample.arxml
/config/App_SPI_P1M_701319_Sample.arxml
/config/App_SPI_P1M_701320_Sample.arxml
/config/App_SPI_P1M_701321_Sample.arxml
/config/App_SPI_P1M_701322_Sample.arxml
/config/App_SPI_P1M_701323_Sample.arxml
In the Sample Application all the SPI APIs are invoked in the following
sequence:
•
The API Spi_Init is invoked with a valid database address for the proper
initialization of the SPI Driver, all the SPI Driver control registers and RAM
variables will get initialized after this API is called.
•
The API Spi_GetVersionInfo is invoked to get the version of the SPI Driver
module with a variable of Std_VersionInfoType, after the call of this API the
passing parameter will get updated with the SPI Driver version details.
•
The API Spi_GetHWUnitStatus will return the status of the specified SPI
Hardware microcontroller peripheral.
•
The API Spi_SyncTransmit will transmit data on the SPI bus synchronously.
•
This module will take the passing parameter and set the SPI Driver status to
SPI_BUSY. Also it sets the sequence result to SPI_SEQ_PENDING and first
job result to SPI_JOB_PENDING and performs the transmission.
•
The API Spi_SetAsyncMode will set the asynchronous mechanism mode for
SPI busses handled asynchronously.
•
The API Spi_GetErrorInfo copies Hardware Error Details to User Buffer
•
The API Spi_MainFunction_Driving is used for Asynchronous transmission
of the sequences in polling mode. This service is should be invoked in a
scheduler loop if the asynchronous transmission mode is selected as
SPI_POLLING_MODE.
•
The API Spi_Cancel will cancel the specified on-going sequence
transmission without canceling any Job transmission and the SPI Driver will
set the sequence result to SPI_SEQ_CANCELLED.
•
The API Spi_DeInit is invoked for de-initialization of the all the controls
registers and RAM variables.
83
Chapter 13 P1M Specific Information 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_SPI_P1M_<Device_name>_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 Spi 4.0.3 <Device_name>.
•
After this, the tool output files will be generated with the configuration as
mentioned in App_SPI_P1M_<Device_Name>_Sample.arxml file available
in the path:
“X1X\P1x\modules\spi\sample_application\<SubVariant>\<AUTOSAR_ver
sion>\config\App_SPI_P1M_<Device_Name>_Sample.arxml”
•
After this, all the object files, map file and the executable file
App_Spi_P1M_Sample.out will be available in the output folder:
(“X1X\P1x\modules\spi\sample_application\<SubVariant>
\obj\<Compiler>”)
• The executable can be loaded into the debugger and the sample application
can be executed.
Remark Executable files with ‘*.out’ extension can be downloaded into the target
hardware with the help of Green Hills debugger.
• If any configuration changes (only post-build) are made to the ECU
Configuration Description files
“X1X\P1x\modules\spi\sample_application\<SubVariant>
\<AUTOSAR_version>\config\App_SPI_P1M_<Device_Name>_Sample.arx
ml”
• The database alone can be generated by using the following commands.
make –f App_SPI_P1M_Sample.mak generate_spi_config
make –f App_SPI_P1M_Sample.mak App_SPI_P1M_Sample.s37
After this, a flash able Motorola S-Record file App_SPI_P1M_Sample.s37 is
available in the output folder.
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
84
P1M Specific Information Chapter 13 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-3 ROM/RAM Details without DET Sl. No. ROM/RAM Segment Name Size in bytes for 701318 1.
ROM
SPI_PUBLIC_CODE_ROM
730
SPI_PRIVATE_CODE_ROM
6312
CONST_ROM_UNSPECIFIED
100
SPI_CFG_DATA_UNSPECIFIED
212
SPI_FAST_CODE_ROM
1108
ROM.RAM_UNSPECIFIED
20
2.
RAM
RAM_UNSPECIFIED
20
NO_INIT_RAM_1BIT
2
NO_INIT_RAM_8BIT
0
NO_INIT_RAM_16BIT
6
NO_INIT_RAM_UNSPECIFIED
103
SPI_CFG_RAM_UNSPECIFIED
0
The details of memory usage for the typical configuration, with DET
enabled and all other configurations as provided in13.2.2.1
Configuration
Example are provided in this section.
Table 13-4 ROM/RAM Details with DET Sl. No. ROM/RAM Segment Name Size in bytes for 701318 1.
ROM
SPI_PUBLIC_CODE_ROM
1672
SPI_PRIVATE_CODE_ROM
6494
CONST_ROM_UNSPECIFIED
100
SPI_CFG_DATA
_UNSPECIFIED
212
SPI_FAST_CODE_ROM
1108
ROM.RAM_UNSPECIFIED
20
85
Chapter 13 P1M Specific Information 2.
RAM
RAM_UNSPECIFIED
20
NO_INIT_RAM_1BIT
2
NO_INIT_RAM_8BIT
0
NO_INIT_RAM_16BIT
6
NO_INIT_RAM_UNSPECIFIED
103
SPI_CFG_RAM_UNSPECIFIED
0
13.3.2 Stack Depth The worst-case stack depth for Driver Component is 88 bytes for the
typical configuration provided in Section 13.2.2.1
Configuration Example.
13.3.3 Throughput Details The throughput details of the APIs for the configuration mentioned in
the Section13.2.2.1
Configuration Example. The clock frequency used to
measure the throughput is 160 MHz for all APIs.
Table 13-5 Throughput Details Of The APIs Sl. No. API Name Throughput in Remarks microseconds
for 701318 1.
Spi_Init
4.000
-
2.
Spi_DeInit
4.550
-
3.
Spi_WriteIB
0.612
-
4.
Spi_AsyncTransmit
11.250
-
-
5.
Spi_ReadIB
0.437
-
-
6.
Spi_SetupEB
0.287
-
7.
Spi_GetStatus
0.870
-
8.
Spi_GetJobResult
0.100
-
9.
Spi_GetSequenceResult
0.100
-
10.
Spi_GetVersionInfo
0.150
-
11.
Spi_SyncTransmit
13.950
-
12.
Spi_GetHWUnitStatus
0.362
-
13.
Spi_Cancel
0.662
-
14.
Spi_SetAsyncMode
0.262
SPI_INTERRUPT
_ MODE
15.
Spi_SetAsyncMode
2.862
SPI_POLLING_
MODE
16.
Spi_MainFunction_Handling
1.462
-
17.
Spi_SelfTest
2227.500
SPI_LOOP_BACK
_SELF_TEST
18.
Spi_SelfTest
57.275
SPI_ECC_SELF_T
EST
19.
Spi_GetErrorInfo
0.225
-
86
Release Details Chapter 14 Chapter 14 Release Details SPI Driver Software Version: 1.6.6
87
Chapter 14 Release Details 88
Revision History Sl.No. Description Version Date 1.
Initial Version
1.0.0
25-Oct-2013
2.
Following changes are made.
1.0.1
28-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 assembler and linker details.
4. Section 13.3 is updated for naming convention change of
parameter definition files.
5. Chapter 14 is updated for SPI driver component version
information.
3.
Following changes are made.
1. In section 13.4.3,Throughput Details are updated.
2. In Section 13.4.1,ROM/RAM Usage are updated.
1.0.2
02-May-2014
3. In Section13.3.1,Sample Application Structure API details are
updated.
4. In chapter 5, Architecture Details Spi API are updated.
5. In chapter 14, Release Details Spi software version is updated.
4.
Following changes are made.
1.0.3
12-May-2014
1.Unwanted Device names are removed.
2.In page no 47, header is updated.
5.
Following changes are made.
1.0.4
27-Oct-2014
1. Chapter 4 is updated for CS logs and note is added
regarding general limitation of the serial controllers.
2. Note is added regarding the usage of the parameter
‘SpiCsHoldTiming’ for synchronous transmission.
3. Name of Table 4-4 and 4-5 is updated.
4. Table 4-3, Table 4-4 and Table 4-5 are updated for
Static configuration.
5. Section 4.1, description of parameter ‘SpiTimeOut’ is updated.
6. In Section 4.1 Note is added regarding extended data size
supported by FIFO.
7. Sections 13.4, ROM/RAM and Throughput Details are
updated.
8. Section 4.6 Deviation list is updated.
9. Section 13.2.1, 13.2.2 and 13.2.3 are updated for compiler, linker
and assembler details.
10. Chapter 14, Release Details are updated.
11. Section 11.2 is updated to delete error code
‘SPI_E_SELF_TEST_FAILURE’ for Self-Test and
SPI_E_READBACK_FAILURE for readback.
12. Chapter 12 Memory Organization is updated to correct section
name SPI_START_SEC_CODE_FAST to
SPI_FAST_CODE_ROM.
13. Section 13 is updated for device names and to add Parameter
Definition files section.
14. Chapter 8 is update to include rh850_types.h file
15. In chapter 4 note is added regarding the DMA access for local RAM
area.
89
Sl.No. Description Version Date 6.
Following changes are made.
1.0.5
19-Nov-2014
1. Section 4.1 is updated to correct the notes and spell checks.
2. Revision history points are corrected
7.
Following changes are made:
1.0.6
29-April-2015
1.Updated Chapter 2 ‘Reference Documents’ to correct the name and
version of device manual.
2.Information regarding Interrupt vector table has been provided in
section 4.1 ‘General’.
3.In Chapter 13, ’P1M Specific Information’ P1M 4.0.3 supported
devices are updated.
4.Table 13-1 PDF information updated for P1M 4.0.3 supported
devices.
5.Section 13.1.1 has been updated to include the translation header file
for all P1M 4.0.3 supporting devices.
6.Updated section 13.3.1 ‘Sample Application Structure’ to add all the
supported devices for P1M 4.0.3.
7.Updated section 13.3.2 ‘Building the Sample Application’ to add
configuration details for the device 701310.
8.Updated section 13.4 ‘Memory and Throughput’ for the device
R7F701310.
9.Updated chapter 14 ‘Release Details’ to correct the SPI driver
version.
10.Removed section ‘Compiler, Linker and Assembler’ from chapter 13.
8.
11.Up
As p d
e ate
r P d
1 t
x ab
V4le
.0 6
0 .1
.0 i
5 n Ch
rele a
a p
s t
e e
f r 6
oll ‘
o Re
wing
gi s
cte
h rs
a De
nge ta
s i
a ls’
re .
made:
1.0.7
29-Jan-2016
1. Section 4.1 General forethoughts are updated.
2. Section 4.3 User mode/ supervisor mode is updated as per
JIRA#ARDAAAE-1426 to add ISR related information.
3. Section 4.6 Deviation list is updated for the memory size
measurement mismatches.
4. Section 6 Register details are updated for new added APIs
Spi_SelfTest and Spi_GetErrorInfo.
5. Section 10.3 Function definitions is updated for new added APIs
Spi_SelfTest and Spi_GetErrorInfo.
6. Section 11.2 Component production errors
SPI_E_INT_INCONSISTENT,
SPI_E_ECC_SELFTEST_FAILURE,
SPI_E_LOOPBACK_SELFTEST_FAILURE and
SPI_E_REG_WRITE_VERIFY are added.
7. Section 13.3 Memory and Throughput details are updated.
8. Section 14 S/W driver version is updated.
9. Chapter 11, As per JIRA#ARDAAAE-1419, new development
error SPI_E_MAINFUNCTION_HANDLING_INVALIDMODE is
added for Spi_MainFunction_Handling API.
10. Section 4.3, as per JIRA#ARDAAAE-1335, “-“ is marked for
Spi_AsyncTransmit API for interrupt mode in user mode.
11. In section 4.1 As per JIRA#ARDAAAE-1452, Information for 16 bit
datawidth selection is added when DMA is configured.
12. Table – 6.1 Register details, 8bit and 32bit settings when DMA is
configured are removed.
13. Table 4-5 User Mode and Supervisory Mode is updated.
90
Sl.No. Description Version Date 9.
Following changes are made:
1.0.8
07-Apr-2016
1. Section 4.1 is updated for adding a note when CsIdleEnforcement
is configured as False as per the JIRA ticket #ARDAAAE-1549.
2. Section 4.1 is updated for adding a note about the usage of HW
registers.
3. Section 13.4.1 is updated for removing memory section
SPI_CFG_DBTOC_UNSPECIFIED as part of ticket ARDAAAE-
1672.
4. Software patch version is updated in Chapter4.
10.
Following changes are made:
1.0.9
12-Jul-2016
1. Software patch version is updated in Chapter 14.
2. Section 4.1 is updated for adding the notes as part of requirement
analysis.
3. Section 4.3, User mode and Supervisor mode details are updated
for Spi_SetAsyncMode.
4. Tables, figures links and numbering is corrected.
5. Stub header files heading is updated and missing header files are
added.
6. Section 13.3.1, sample application file structure is updated and
Section 13.3.2, Building sample application is updated.
7. Updated Table 6-1 to rename global variable
‘Spi_GusDataAccess’ as ‘Spi_GusSynDataAccess’ or
‘Spi_GusAsynDataAccess’ for synchronous and asynchronous
transmission respectively.
8. Updated section 13.3.1 Sample Application Structure to add
details about Spi_GetErrorInfo API.
9. Added Spi_GetErrorInfo API in section 11.1 under Related API(s)
corresponding to the error SPI_E_UNINIT.
10. Updated 4.1 ‘General’ to add a caution regarding usage of buffers
for transmission/reception during DMA operation.
11. Updated Chapter 12 to correct the INIT policy of memory sections
from NOINIT to NO_INIT.
12. Chapter 13.1.3 ISR Function “Interrupt Handler” table is updated
with note.
13. Updated 4.1 ‘General’ to add the information regarding the
number of buffers to be configured in Direct Access or FIFO
mode when DMA is configured.
14. Chapter 6, Register access details are updated.
15. Spi_GetErrorInfo details have been added. Chapter 4, 5 and 7
are updated for the same.
16. Section 4.2 Preconditions and Section 4.5 Data Consistency is
updated for information about critical section protection.
17. Chapter 6, Register access details are updated.
18. Updated Table 4-1 for information regarding user mode and
supervisor mode.
19. Section 3.1.1 is updated to add the header file Spi_RegWrite.h as
part of implementing the register write functionality as part of
ticket ARDAAAE-1685.
20. Section 4.3, A note is added regarding the critical section usage.
21. Spi_RegWrite.h is added to the folder structure in the section
3.1.1.
22. Chapter 11 is updated for the API details of the DET and DEM
errors.
23. Updated Section 10.2 to add details regarding
Spi_CommErrorType, Spi_HWErrorsType, Spi_SelfTestType and
Spi_ReturnStatus type definitions.
91
Sl.No. Description Version Date 11.
Following changes are made:
1.0.10
28-Oct-2016
1. Software patch version is updated in Chapter 14.
2. Chapter 13.3 updated for ROM/RAM Usage,Stack Depth and
Throughput Details.
12.
Following changes are made:
1.0.11
21-Feb-2017
1. Section 11.2 is updated and 11.3 is added with the hardware
errors description details
2. Section 10.3 is updated with the detailed description of the
functions
3. Section 3.1.1 is updated with the deletion of the redundant
mentioned Driver.h file name
4. Throughput details, RAM/ROM Usage and stack depth values are
updated in the section 13.3
5. Section 4.1 is updated with the SpiTimeOut configuring details.
6. The unused segment SPI_CFG_DBTOC_UNSPECIFIED details
are removed from the chapter 12.
7. Abbreviations and Acronyms section is updated
8. Chapter 14 is updated with the release details.
9. R-number is updated
10. Notice and Company addresses are updated
11. Copyright information is updated
13.
Following changes are made:
1.0.12
15-Mar-2017
1. Throughput details, RAM/ROM Usage and stack depth values are
updated in the section 13.3
2. Software patch version is updated in Chapter 14.
3.
92
93
AUTOSAR MCAL R4.0.3 User's Manual SPI Driver Component Ver.1.0.12 Embedded User’s Manual Publication Date: Rev.1.01, March 15, 2017
Published by: Renesas Electronics Corporation

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

AUTOSAR MCAL R4.0.3
User’s Manual
R20UT3726EJ0101
Document Outline
4 - R20UT3727EJ0101-AUTOSAR
AUTOSAR MCAL R4.0 User's Manual6 - R20UT3727EJ0101-AUTOSARs


AUTOSAR MCAL R4.0.3
User’s Manual
SPI Driver Component Ver.1.0.12
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
CSIH
Enhanced Queued Clocked Serial Interface.
DEM
Diagnostic Event Manager
EB
External Buffer
ECU
Electronic Control Unit
e.g
Example
Hz
Hertz
HW
Hardware
IB
Internal Buffer
Id
Identifier
MCAL
MicroController Abstraction Layer
MCU
Micro Controller Unit
PCLK
Peripheral Clock
Rx
Receive
SPI
Serial Peripheral Interface
Tx
Transmit
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 SPI Driver Generation Tool. It is generated by ECU
File
Configuration Editor.
Sl.No
Serial Number.
Translation XML File
This file contains the translation and device specific header file path.
5
6
Table of Contents Chapter 1 Introduction ...................................................................................... 9 1.1 Document Overview .......................................................................................................... 9 Chapter 2 Reference ....................................................................................... 11 2.1 Reference Documents ..................................................................................................... 11 2.2 Trademark Notice ............................................................................................................ 11 Chapter 3 SPI 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 .......................................................................................................... 41 8.3 Information Messages ..................................................................................................... 43 Chapter 9 Notes ............................................................................................... 47 7
List of Figures Figure 3-1 Overview of SPI Driver Generation Tool .................................................................... 13 List of Tables
Table 5-1 Output Files Description ....................................................................................................... 17 Table 8-1 Parameters and Containers related to ERR083004 ................................................................... 23 Table 8-2 Parameters and Containers related to ERR083024 ................................................................... 28 Table 8-3 Parameters and Containers related to ERR083084 ................................................................... 36 Table 8-4 Parameters and Containers related to ERR083085 ................................................................... 37 Table 8-5 Parameters and Containers related to ERR083091 ................................................................... 38 Table 8-6 Parameter values related to INF083003 ................................................................................. 44
8
Introduction Chapter 1 Chapter 1 Introduction The SPI Driver component provides the service for initializing the whole SPI
structure of the microcontroller.
The SPI 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 SPI Driver Generation Tool. SPI
Driver Generation Tool is a command line tool that extracts information from
ECU Configuration Description File and generates SPI Driver C Source and C
Header files (Spi_Cfg.h, Spi_Cbk.h, Spi_PBcfg.c and Spi_Lcfg.c).
This document contains information on the options, input and output files of
the SPI 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 SPI
configuration.
1.1 Document Overview This user manual is organized as given in the table below:
Section Contents Section 1 (Introduction)
Provides an introduction to the document and explains how information
is organized in this manual.
Section 2 (Reference)
Provides a list of documents referred while developing this document.
Section 3 (SPI Driver
Provides the component overview of SPI 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 SPI 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 SPI 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_SPIHandlerDriver.pdf
3.2.0
2.
P1M Parameter Definition File 1.0.8
R403_SPI_P1M_04_05_12_13_20_21.arxml
3.
P1M Parameter Definition File 1.0.8
R403_SPI_P1M_10_11_14_15_18_19_22_23.arxml
2.2 Trademark Notice Microsoft and Windows are trademarks/registered trademarks of Microsoft
Corporation.
11
Chapter 2 Reference 12
SPI Driver Generation Tool Overview Chapter 3 Chapter 3 SPI Driver Generation Tool Overview SPI Driver Generation Tool overview is shown below.
ECU Configuration Description Spi_Cfg.h, File, BSWMDT SPI Driver Spi_Cbk.h, File, Translation Generation Spi_Lcfg.c, XML File and Tool Spi_PBcfg.c Configuration XML File Figure 3-1 Overview of SPI Driver Generation Tool SPI Driver Generation Tool is a command line tool that extracts, analyzes the
configuration details provided in the input file and validates correctness of the
data and provides scalability and configurability for SPI Driver module. It
accepts ECU Configuration Description File(s), BSWMDT File, Translation
XML File and Configuration XML File as input and displays appropriate
context sensitive error messages for wrong input and exits. Tool creates the
Log file Spi.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:
Spi_Lcfg.c, Spi_PBcfg.c, Spi_Cfg.h and Spi_Cbk.h.
Spi_Cfg.h and Spi_Cbk.h will be compiled and linked with SPI Driver
Component. Spi_Lcfg.c and Spi_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.
Remark • In case of errors the generation tool returns a 1, in case of no errors the
generation tool returns a 0.
• SPI Driver Generation Tool uses “Common Published Information” from SPI
module specific BSWMDT File. SPI module specific BSWMDT File should
not be updated manually since it is ”Static Configuration” file.
13
Chapter 3 SPI Driver Generation Tool Overview 14
Input Files Chapter 4
Chapter 4 Input Files SPI Driver Generation Tool accepts ECU Configuration Description File(s),
BSWMDT File, Translation XML File and Configuration XML File as input.
SPI Driver Generation Tool needs information about SPI Driver module.
Hence ECU Configuration Description File should contain configuration of
SPI Driver module. Generation Tool ignores any other AUTOSAR component
configured in the ECU Configuration Description File. ECU Configuration
Description File can be generated using configuration editor.
ECU Configuration Description File must comply with AUTOSAR standard
ECU Configuration Description File format
Remark The detailed explanation about the parameters and containers are found in
P1x Parameter Definition File referred in Reference Documents section.
15
Chapter 4 Input Files 16
Output Files Chapter 5
Chapter 5 Output Files SPI Driver Generation Tool generates configuration details in C Header and C
Source files (Spi_Lcfg.c, Spi_PBcfg.c, Spi_Cbk.h and Spi_Cfg.h).
The content of each output file is given in the table below:
Table 5-1 Output Files Description Output File Details Spi_Cfg.h
This file contains pre-compile time parameters and handles.
Spi_Cbk.h
This file contains callback function prototype declarations to be used by application.
Spi_PBcfg.c
This file contains post-build time parameters.
Spi_Lcfg.c
This file contains structures of link time parameters.
Remark Output files generated by SPI 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 SPI Driver module.
• Default Translation XML File (Spi_X1x.trxml) should be present in same
location of Spi_X1x.dll when the variant specific trxml file is not given as input
in command line.
• Default Configuration XML File (Spi_X1x.cfgxml) must be present in same
location of Spi_X1x.dll.
• If Translation XML File is not provided on the command line,
Spi_X1x.trxml which is present in same location of Spi_X1x.dll is
considered as ‘default’ Translation XML File.
• If Configuration XML File is not provided on the command line,
Spi_X1x.cfgxml which is present in same location of Spi_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 SPI 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 SPI Driver Generation
Tool. Otherwise Tool may not produce the expected results or may lead to
errors/warnings/information messages.
• User has to make sure that the respective device specific configuration file is
used, otherwise Tool may not produce the expected results or may 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 SPI Component User Manual for deviations from AUTOSAR
specifications, if any.
19
Chapter 6 Precautions 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 SPI Driver Generation Tool. It
ensures conformance of input file with syntax and semantics. It also performs
validation on the input file for correctness of the data.
For more details on list of Error/Warning/Information messages that are
displayed as a result of input file(s) validation, refer Chapter 8 “
Messages”.
The Generation Tool displays error or warning or information when the user
has configured incorrect inputs. The format of Error/Warning/Information
message is as shown below.
• ERR/WRN/INF<mid><xxx>: <Error/Warning/Information Message>.
where,
<mid>: 083 - SPI Driver Module Id (083) 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 ERR083001: 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.
ERR083002: 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.
ERR083003: 'SPI Driver/MCU Driver/DEM' Component is not present in
the input file(s).
This error will occur, if SPI Driver or MCU Driver or DEM component is not
present in the input ECU Configuration Description File(s).
ERR083004: 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 Containers related to ERR083004 Parameter Name Container Name SpiCancelApi
SpiChannelBuffersAllowed
SpiDevErrorDetect
SpiHwStatusApi
SpiInterruptibleSeqAllowed
SpiGeneral
SpiLevelDelivered
SpiSupportConcurrentSyncTransmit
SpiVersionInfoApi
SpiDmaMode
SpiDataConsistencyCheckEnable
SpiDataWidthSelection
SpiMaxBaudrate
SpiSyncSeqEndNotificationEnable
SpiPersistentHWConfiguration
SpiDmaTypeUsed
SpiHighPriorityHwHandlingEnable
SpiCriticalSectionProtection
23
Chapter 8 Messages Parameter Name Container Name
SpiDeviceName
Spi General SpiAlreadyInitDetCheck
SpiVersionCheckExternalModules
SpiGeneral
SpiSeqStartNotificationEnable
SpiTimeOut
SpiLoopBackSelfTest
SpiECCSelfTest
SpiInterruptConsistencyCheck
SpiCSIGHWriteVerify
SpiDMAWriteVerify
SpiMaxChannel
SpiMaxJob
SpiDriver
SpiMaxSequence
SpiChannelId
SpiChannelType
SpiDataWidth
SpiChannel
SpiEbMaxLength
SpiIbNBuffers
SpiTransferStart
SpiCsPolarity
SpiDataShiftEdge
SpiShiftClockIdleLevel
SpiCsIdentifier
SpiEnableCs
SpiHwUnit
SpiTimeClk2Cs
SpiExternalDevice
SpiClk2CsCount
SpiBaudrateConfiguration
SpiInputClockSelect
SpiInterruptDelayMode
SpiParitySelection
SpiBroadcastingPriority
SpiClockFrequencyRef
SpiBaudrate
SpiJobId
SpiJob
SpiJobPriority
SpiDeviceAssignment
SpiInterruptibleSequence
SpiSeqStartNotification
SpiSequence
SpiSequenceId
SpiHighPriorityHwSequence
SpiJobAssignment
SpiHwUnitSelection
SpiMemoryMode
SpiMemoryModeSelection
SpiTxDmaChannel
SpiRxDmaChannel
SpiDma
SpiDmaHwUnit
24
Messages Chapter 8 Parameter Name Container Name
SPI_E_HARDWARE_ERROR
SpiS
Gpi
eD
neem
ralEv
entParameterRefs
SPI_E_DATA_TX_TIMEOUT_FAILURE
SpiChannelIndex
SpiChannelList
SpiChannelAssignment
SpiMaxHwUnit
SpiPublishedInformation
Remark If the containers SpiMemoryMode and SpiDmaMode are configured, then
the respective parameters which are mandatory should be configured.
ERR083005: In general per configuration set, the value of
'SpiChannelId' should be unique and less than 'SpiMaxChannel' in
'SpiDriver' container This error occurs, if the value for parameter SpiChannelId present in the
SpiChannel is not unique or not less than the value present in the
SpiMaxChannel.
ERR083006: The value of the parameter 'SpiChannelType' in the
container 'SpiChannel' should be same for SPI Channels (having
same channel Id) across multiple configuration sets. This error occurs, if the value of parameter SpiChannelType in the
container SpiChannel is not same for SPI Channels (having same
channel Id) across multiple configuration sets.
ERR083007: The number of SPI channels configured should be
same across the multiple configurations set container 'SpiDriver'. This error occurs, if the number of SPI channels configured is not same
across the multiple configurations set container SpiDriver.
ERR083008: The value of the parameters 'SpiEbMaxLength' and 'SpiIbNBuffers' in the container 'SpiChannel' should be same for
SPI Channels (having same channel Id) across multiple
configuration sets. This error occurs, if the value for parameters SpiEbMaxLength and
SpiIbNBuffers are not same for all SPI Channels (having same channel
Id) across multiple configuration sets in ECU Configuration Description
File.
ERR083009: The short name of the container 'SpiChannel' should be
same for channel having same 'SpiChannelId' <value for
SpiChannelId> across multiple configurations set container
'SpiDriver'. This error occurs, if the short name of the container SpiChannel is not
same for channel having same SpiChannelId across multiple
configurations set in the container SpiDriver.
ERR083010: The value of the parameter 'SpiChannelType' in the
container 'SpiChannel' should be configured as <EB>, since the
value of the parameter 'SpiChannelBuffersAllowed' in the container
'SpiGeneral' is configured as <1>. This error occurs, if SpiChannelBuffersAllowed in the container
25
Chapter 8 Messages SpiGeneral is configured as 1 and the parameter SpiChannelType in the
container SpiChannel is not configured as EB.
ERR083011: The value of the parameter 'SpiChannelType' in the
container 'SpiChannel' should be configured as <IB>, since the value
of the parameter 'SpiChannelBuffersAllowed' in the container
'SpiGeneral' is configured as <0>.
This error occurs, If SpiChannelBuffersAllowed in the container
SpiGeneral is configured as 0 and the parameter SpiChannelType in the
container SpiChannel is not configured as IB.
ERR083012: The SPI channels configured for a specific job should
not be repeated when the parameter 'SpiMemoryModeSelection' in
the container 'SpiMemoryMode' is configured as
<DUAL_BUFFER_MODE/ TX_ONLY_MODE>. This error occurs, if the value for channels configured for a specific
job is repeated when the parameter SpiMemoryModeSelection in the
container SpiMemoryMode is configured as DUAL_BUFFER_MODE
or TX_ONLY_MODE.
ERR083013: The SPI channels configured for a specific job should
have same value for the parameters 'SpiDataWidth' and
‘SpiTransferStartof’ of container 'SpiChannel' since the parameter
'SpiMemoryModeSelection' in the container 'SpiMemoryMode' is
configured as <value of SpiMemoryModeSelection> within a
sequence. This error occurs, if the value configured for the parameters SpiDataWidth
or SpiTransferStart in the container SpiChannel for a specific job are
different and the parameter SpiMemoryModeSelection in the container
SpiMemoryMode is configured as DUAL_BUFFER_MODE or
TX_ONLY_MODE or FIFO_MODE.
ERR083014: The total number of buffers configured for all jobs
linked to one CSIH HW Unit should be less than or equal to <64/128>
since the value of the parameter 'SpiMemoryModeSelection' in the
container 'SpiMemoryMode' is configured as <TX_ONLY_MODE> and
the parameter 'SpiDataWidth' in the container 'SpiChannel' is
configured as less than or equal to <16>. This error occurs, if the total number of buffers configured for all jobs
linked to one CSIH HW Unit is more than 64/128 when the value of the
parameter SpiMemoryModeModeSelection in the container
SpiMemoryModeMode is configured as TX_ONLY_MODE and the
parameter SpiDataWidth in the container SpiChannel is configured as less
than or equal to 16.
ERR083015: The total number of buffers configured for all jobs
linked to one CSIH HW Unit should be less than or equal to <32/64>
since the value of the parameter 'SpiMemoryModeSelection' in the
container 'SpiMemoryMode' is configured as
<DUAL_BUFFER_MODE> and the parameter 'SpiDataWidth' in the
container 'SpiChannel' is configured as greater than <16>. This error occurs, if the total number of buffers configured for all jobs
linked to one CSIH HW Unit is more than 32/64 when the value of the
parameter SpiMemoryModeModeSelection in the container
SpiMemoryModeMode is configured as DUAL_BUFFER_MODE and the
26
Messages Chapter 8 parameter SpiDataWidth in the container SpiChannel is configured as
greater than 16.
ERR083016: The value of the parameter ‘SpiDataWidth’ in the
container ‘SpiChannel’ should be less than or equal to 8 since the
parameter ‘SpiDataWidthSelection’ in the container ‘SpiGeneral’ is
configured as <BITS_8>. This error occurs, if the value of the parameter SpiDataWidth in the
container SpiChannel is not less than or equal to 8
when the parameter
SpiDataWidthSelection in the container SpiGeneral is configured as
BITS_8.
ERR083017: The value of the parameter ‘SpiDataWidth’ in the
container ‘SpiChannel’ should be less than or equal to 16 since the
parameter ‘SpiDataWidthSelection’ in the container ‘SpiGeneral’ is
configured as <BITS_16>.
This error occurs, if the value of the parameter SpiDataWidth in the
container SpiChannel is not less than or equal to 16
when the parameter
SpiDataWidthSelection in the container SpiGeneral is configured as
BITS_16.
ERR083018: In general per configuration set, the value of 'SpiJobId'
should be unique and less than 'SpiMaxJob' in 'SpiDriver' container. This error occurs, if the value for parameter SpiJobId present in the
container SpiJob is not unique or not less than the value present in the
SpiMaxJob.
ERR083019: The number of SPI Jobs configured should be same
across the multiple configurations set container ‘SpiDriver’. This error occurs, if the number of SPI jobs configured is not same across
the multiple configurations set container SpiDriver.
ERR083020: The value of the parameter ‘SpiJobEndNotification’
configured in the container ‘SpiJob’ should be unique for jobs
with hardware units of different memory modes. This error occurs, if the parameter SpiJobEndNotification of the container
SpiJob is not unique for jobs with hardware units of different memory
modes.
ERR083021: The value of the parameter ‘SpiJobEndNotification’
present in the container ‘SpiJob’ should be same for SPI jobs
(having same Job Id). This error occurs, if the parameter SpiJobEndNotification in the
container SpiJob is not same for SPI jobs (having same Job Id)
across multiple configuration sets in ECU Configuration Description
File.
ERR083022: The value for the parameter ‘SpiHwUnitSynchronous’ in
the container ‘SpiJob' should be same for jobs that are associated
with same sequence. This error occurs, if the value for the parameter SpiHwUnitSynchronous in
the container SpiJob is not same for jobs that are associated with same
sequence. In general, the transfer mode of the jobs (that are associated
27
Chapter 8 Messages with same sequence) should be same.
ERR083023: The value of the parameter ‘SpiHwUnitSynchronous’ in
the container ‘SpiJob’ should be same for all jobs that are having
same value for the parameter ‘SpiHwUnit’ in the container
‘SpiExternalDevice’ within a configuration set. This error occurs, if the value of the parameter SpiHwUnitSynchronous in
the container SpiJob is different for all jobs that are having same value for
the parameter SpiHwUnit in the container SpiExternalDevice within a
configuration set.
ERR083024: The value configured for the parameter 'parameter
name' should follow C Syntax <[a-zA-Z][a-zA-Z0-9_]>.
This error occurs, if the value of configuration parameters mentioned
below does not adhere to C syntax i.e., the value should not contain
characters other than (a-z, A-Z, 0-9 or “_”) and it also should start with an
alphabet.
Table 8-2 Parameters and Containers related to ERR083024 Parameter Name Container Name SpiJobEndNotification
SpiJob
SpiSeqEndNotification
SpiSequence
ERR083025: The jobs configured for the parameter
'SpiJobAssignment' in the container ‘SpiSequence’ should not be
repeated since the parameter ‘SpiMemoryModeSelection’ in the
container ‘SpiMemoryMode’ is configured as
<DUAL_BUFFER_MODE/TX_ONLY_MODE>. This error occurs, if the parameter SpiMemoryModeSelection in the
container SpiMemoryMode is configured as DUAL_BUFFER_MODE or
TX_ONLY_MODE and the jobs configured for the parameter
SpiJobAssignment in the container SpiSequence is repeated.
ERR083026: The value of the parameter
‘SpiMemoryModeSelection’ in the container ‘SpiMemoryMode’
should be same across the multiple configurations set container
‘SpiDriver’.
This error occurs, if the value of the parameter SpiMemoryModeSelection
in the container SpiMemoryMode is not same across the multiple
configurations set container SpiDriver.
ERR083027: The value of the parameter ‘SpiHwUnit’ in the container ‘SpiExternalDevice’ should be same when the parameter ‘SpiMemoryModeSelection’ in the container ‘SpiMemoryMode’ is
configured as <value of the parameter SpiMemoryModeSelection>
within a sequence. This error occurs, if the value of the parameter SpiHwUnit in the container
SpiExternalDevice is not same when the parameter
SpiMemoryModeSelection in the container SpiMemoryMode is configured
as DUAL_BUFFER_MODE and TX_ONLY_MODE within sequence.
ERR083028: The short name of the container ‘SpiJob’ should be
same for job having same 'SpiJobId' <value for SpiJobId> across 28
Messages Chapter 8 multiple configurations set container ‘SpiDriver’. This error occurs, if the short name of the container SpiJob is not same for
SPI jobs (having same job Id) across multiple configurations set container
SpiDriver.
ERR083029: The value of the parameter ‘SpiHwUnit’ in the container ‘SpiExternalDevice’ is configured as <value of SpiHwUnit>. The value <value of SpiHwUnit> is not configured for the parameter ‘SpiHwUnitSelection’ in the container ‘SpiMemoryMode’. This error occurs, if the value of the parameter SpiHwUnit in the
container SpiExternalDevice is configured as CSIHn and the same
value is not configured to the parameter SpiHwUnitSelection in the
container SpiMemoryMode. Here n is integer numbers e.g. 0, 1, etc.
ERR083030: The value of the parameter 'SpiHwUnit' in the container ‘SpiExternalDevice’ is not configured for the same memory mode as
the memory mode of the other jobs in the respective sequence. This error occurs, if the value of the parameter SpiHwUnit in the container
SpiExternalDevice is not configured for the same memory mode as the
memory mode of the other jobs in the respective sequence.
ERR083031: The value <value of SpiHwUnitSelection> configured
for the parameter 'SpiHwUnitSelection’ present in the container 'SpiMemoryMode’ should be unique within configuration set
container 'SpiDriver'. This error occurs, if the value of the parameter SpiHwUnitSelection in
the container SpiMemoryMode is not unique within configuration set
container SpiDriver.
ERR083032: The same value should be configured for the parameter ‘SpiHwUnit’ in the container 'SpiExternalDevice' across the
multiple configuration sets. This error occurs, if the value configured for the parameter SpiHwUnit in
the container SpiExternalDevice is not same across multiple
configuration sets.
ERR083033: The value of the parameter 'SpiHwUnitSelection' in the
container 'SpiMemoryMode' is configured as <value for
SpiHwUnitSelection>, but none of the container 'SpiExternalDevice'
has configured 'SpiHwUnit' as <value for SpiHwUnitSelection>. This error occurs, if the hardware unit configured in the container
SpiMemoryMode is not present in any of the SpiExternalDevice container.
ERR083034: The number of SPI sequences configured should be
same across multiple configurations set container ‘SpiDriver’. This error occurs, if the numbers of SPI sequences configured are not
same across the multiple configurations set container SpiDriver.
ERR083035: The value of parameter 'SpiSeqEndNotification' present
in the container 'SpiSequence' should be unique for the sequences
having jobs with hardware units of different memory modes. This error occurs, if the value of parameter SpiSeqEndNotification present
29
Chapter 8 Messages in the container SpiSequence is not unique for the sequences having jobs
with hardware units of different memory modes.
ERR083036: The parameter ‘SpiSeqEndNotification’ in the container ‘SpiSequence’ should be same for sequences having same 'SpiSequenceId' <value for SpiSequenceId> across
multiple configurations set container ‘SpiDriver’.
This error occurs, if the parameter SpiSeqEndNotification in the container
SpiSequence is not same for SPI Sequences (having same Sequence Id)
across multiple configurations set container SpiSequence.
ERR083037: In general per configuration set, the value of
'SpiSequenceId' should be unique and less than 'SpiMaxSequence'
in 'SpiDriver' container. This error occurs, if the value for parameter SpiSequenceId present in
the container SpiSequence is not unique or not less than the value
present in the SpiMaxSequence.
ERR083038: The short name of the container ‘SpiSequence’ should
be same for sequence having same 'SpiSequenceId' <value for
SpiSequenceId> across multiple configurations set container
‘SpiDriver’. This error occurs, if the short name of the container SpiSequence is not
same for SPI Sequences (having same Sequence Id) across multiple
configurations set container ‘SpiDriver’.
ERR083039: The value of parameter ‘SpiPortPinSelect’ in the
container ‘SpiJob’ should not be configured as <value of the
parameter SpiPortPinSelect> since the value of the parameter
‘SpiCsSelection’ present in the container ’SpiExternalDevice’ is
configured as <value of the parameter SpiCsSelection>. This error occurs, if the value of the parameter SpiPortPinSelect in the
container SpiJob is configured as CSLn and the parameter
SpiCsSelection present in the container SpiExternalDevice is configured
as CS_VIA_GPIO. Here n is the integer number e.g. 0, 1, etc.
ERR083040: The value of parameter ‘SpiPortPinSelect’ in the
container ‘SpiJob’ should not be configured as <value of the
parameter SpiPortPinSelect> since the value of the parameter
‘SpiCsSelection’ present in the container ’SpiExternalDevice’ is
configured as <value of the parameter SpiCsSelection>. This error occurs, if the value of the parameter SpiPortPinSelect in the
container SpiJob is configured as Port group related pins and the
parameter SpiCsSelection present in the container SpiExternalDevice is
configured as CS_VIA_PERIPHERAL_ENGINE.
ERR083041: The value of parameter ‘SpiChannelType’ in the
container ‘SpiChannel’ should be configured as <IB> since the
parameter ‘SpiMemoryModeSelection’ in the container
‘SpiMemoryMode’ is configured with one of the values from
<value of the parameter SpiMemoryModeSelection>. This error occurs, if the value of the parameter
SpiMemoryModeSelection in the container SpiMemoryMode is
configured as DUAL_BUFFER_MODE or TX_ONLY_MODE and the
30
Messages Chapter 8 parameter SpiChannelType in the container SpiChannel is not
configured as IB.
The value of the parameter SpiChannelType in the SpiChannel
container can be configured as EB, if the parameter
SpiHighPriorityHwHandlingEnable is configured as true in SpiGeneral
container and if this channel is linked to a job which is linked to a high
priority sequence.
ERR083042: The parameter ‘SpiHwUnit’ present in the container ‘SpiExternalDevice’ is configured as <value of the parameter
SpiHwUnit> and all of the following parameters
(SpiCsIdleEnforcement, SpiCsIdleTiming, SpiCsHoldTiming,
SpiCsInterDataDelay and SpiCsSetupTime) should be configured. This error occurs, if the parameter SpiHwUnit present in the container
SpiExternalDevice is configured as CSIHm and any of the parameters
SpiCsIdleEnforcement, SpiCsIdleTiming, SpiCsHoldTiming,
SpiCsInterDataDelay and SpiCsSetupTime is not configured. Here m is
integer number e.g. 0, 1, etc.
ERR083043: The parameter ‘SpiPortPinSelect’ in the container
‘SpiJob’ configured should be only one unique value, since the
value of parameter ‘SpiHwUnit’ present in the container
‘SpiExternalDevice’ is configured as <value of the parameter
SpiHwUnit>. This error occurs, if the value of the parameter SpiHwUnit present in
the container SpiExternalDevice is configured as CSIGn and more
than one unique value is configured for the parameter
SpiPortPinSelect in the container SpiJob. Here n is integer number e.g.
0, 1, etc.
ERR083044: The value of the parameter ‘SpiMaxChannel’ should
be equal to the total number of 'SpiChannel' container configured
within each 'SpiDriver' container. This error occurs, if the value of the parameter SpiMaxChannel present in
container SpiDriver is not equal to total number of channels configured
within each SpiDriver container in ECU Configuration Description File.
ERR083045: The value of the parameter ‘SpiMaxJob’ should be equal
to the total number of 'SpiJob' container configured within each
'SpiDriver' container. This error occurs, if the value of the parameter SpiMaxJob in the
container SpiDriver is not equal to the total number of jobs configured
within each SpiDriver container in ECU Configuration Description File.
ERR083046: The value of the parameter ‘SpiMaxSequence’ should
be equal to the total number of 'SpiSequence' container configured
within each 'SpiDriver' container.
This error occurs, if the value of the parameter SpiMaxSequence in the
container SpiDriver is not equal to the total number of jobs configured
within each SpiDriver container in ECU Configuration Description File.
ERR083048: The value of the parameter
‘SpiMemoryModeSelection’ in the container ‘SpiMemoryMode’
should be configured as <DIRECT_ACCESS_MODE> since the 31
Chapter 8 Messages value configured for the parameter ‘SpiLevelDelivered’ in the
container ‘SpiGeneral’ is <0>. This error occurs, if the value configured for the parameter
SpiLevelDelivered in the container SpiGeneral is 0 and the value of the
parameter SpiMemoryModeSelection in the container SpiMemoryMode is
not configured as DIRECT_ACCESS_MODE.
ERR083049: At least one instance of the container 'SpiDma' should
be configured as the value of parameter 'SpiDmaMode' present in
the container 'SpiGeneral' is configured as <true>. This error occurs, if the parameter SpiDmaMode present in the container
SpiGeneral is configured as true and no instance of the container
SpiDma is configured.
ERR083050: The value configured for the parameters ‘SpiTxDmaChannel’ and ‘SpiRxDmaChannel’ should be unique
within a configuration set. This error occurs, if the same DMA channel is configured for
SpiTxDmaChannel or SpiRxDmaChannel of SpiDma container for
hardware units (SpiDmaHwUnit) within a configuration set. DMA channel
(Tx or Rx) should be unique within a configuration set.
ERR083051: The number of SPI DMA configured should be same
across multiple configurations set container ‘SpiDriver’. This error occurs, if the number of SPI DMA configured is not same
across multiple configurations set container SpiDriver.
ERR083052: The value configured in the parameters
‘SpiTxDmaChannel’ and ‘SpiRxDmaChannel’ in the container
‘SpiDma’ should be same across multiple configuration sets. This error occurs, if the value configured in the parameters
SpiTxDmaChannel and SpiRxDmaChannel in the container SpiDma is
not same across multiple configuration set.
ERR083053: The value configured for the parameter 'SpiDmaHwUnit'
in the container 'SpiDma' should be configured in any of the
hardware units selected for jobs.
This error occurs, if the value configured for the parameter SpiDmaHwUnit
in the container SpiDma is not configured in any of the hardware units
selected for jobs.
ERR083054: The 'SpiDataWidthSelection' parameter in 'SpiGeneral'
container, has to be fixed to 'BITS_16' as SpiDmaMode parameter is
configured as true.
This error occurs, if the configured value of the parameter
SpiDataWidthSelection in the container SpiGeneral is other than BITS_16
and the SpiDmaMode parameter is configured as true.
ERR083055: The value of parameter 'SpiPortPinSelect' <value of the
SpiPortPinSelect> in the container 'SpiJob' should not be same since
the hardware units configured for respective jobs are not same. This error occurs, if the value of parameter SpiPortPinSelect is configured
in the container SpiJob is same and the hardware units configured for
respective jobs are different. This error is applicable only for CSIG
32
Messages Chapter 8 hardware unit related jobs.
ERR083056: The DMA HW unit configured in 'SpiDmaHwUnit'
parameter of the container 'SpiDma' is invalid as 'SpiDmaMode'
parameter is configured as <true> and the same DMA HW unit is
configured as <SYNCHRONOUS> in the parameter
‘SpiHwUnitSynchronous’ of the container ‘SpiJob’. This error occurs, if the SpiDmaMode parameter is configured as true and
the same DMA HW unit is configured as SYNCHRONOUS in the
parameter SpiHwUnitSynchronous of the container SpiJob.
ERR083057: The value of the parameter ‘SpiChannelIndex’
configured in container ‘SpiChannelList’ should be <Expected value
of SpiChannelIndex>. In general per Spi Job, the value of
‘SpiChannelIndex’ parameter should start with <0> and should be
sequential without any gaps. This error occurs, if value of the parameter SpiChannelIndex in the
container SpiChannelList is not starting with 0 and not sequential for any
SpiJobId parameter in the container SpiJob.
ERR083058: The reference path <path> provided for the parameter ‘parameter name’ in the container ‘container name’, having short
name<container short name> is incorrect. This error occurs, if incorrect reference provided for any of the
reference parameters (SPI_E_HARDWARE_ERROR,
SpiClockFrequencyRef, SpiDemEventParameterRefs,
SpiDeviceAssignment, SpiChannelAssignment and
SpiJobAssignment).
ERR083059: The value of the parameter ‘SpiHwUnitSynchronous’ in
the container ‘SpiJob’ should be same for all jobs that are having
same value for the parameter ‘SpiHwUnit’ in the container
‘SpiExternalDevice’ across multiple configurations set container
‘SpiDriver’. This error occurs, if the value of the parameter SpiHwUnitSynchronous in
the container SpiJob is different for all jobs that are having same value for
the parameter SpiHwUnit in the container SpiExternalDevice across
multiple configurations set container SpiDriver.
ERR083061: The value of the parameter ‘SpiCsSelection’ in the
container ‘SpiExternalDevice’ should not be configured as <value of
the parameter SpiCsSelection> since the value of the parameter
‘SpiHwUnit’ is configured as <value of the parameter SpiHwUnit>. This error occurs, if the value of the parameter SpiHwUnit in the container
SpiExternalDevice is configured as CSIG<n> and the value of the
parameter SpiCsSelection in the container SpiExternalDevice is configured
as CS_VIA_PERIPHERAL_ENGINE. Here <n> is an integer number e.g. 0,
1 etc.
ERR083062: The value of the parameter ‘SpiCsSelection’ in the
container ‘SpiExternalDevice’ should be configured, since the value of
the parameter ‘SpiEnableCs’ in the container ‘SpiExternalDevice’ is
configured as <true>. This error occurs, if the value of the parameter SpiEnableCs in the
container SpiExternalDevice is configured as true and the parameter
33
Chapter 8 Messages SpiCsSelection in the container SpiExternalDevice is not configured.
ERR083063: The value of the parameter ‘SpiPortPinSelect’ in
the container ‘SpiJob’ should be configured, since the value
of the parameter ‘SpiEnableCs’ in the container
‘SpiExternalDevice’ is configured as <true>. This error occurs, if the value of the parameter SpiEnableCs in the
container SpiExternalDevice is configured as true and the parameter
SpiPortPinSelect in the container SpiJob is not configured.
ERR083064: The value of the parameter ‘SpiCsSelection’ in the
container ‘SpiExternalDevice’ should not be configured, since the
value of the parameter ‘SpiEnableCs’ in the container
‘SpiExternalDevice’ is configured as <false>. This error occurs, if the value of the parameter SpiEnableCs in the
container SpiExternalDevice is configured as false and the
parameter SpiCsSelection in the container SpiExternalDevice is
configured.
ERR083065: The value of the parameter ‘SpiPortPinSelect’ in
the container ‘SpiJob’ should not be configured, since the
value of the parameter ‘SpiEnableCs’ in the container
‘SpiExternalDevice’ is configured as <false>. This error occurs, if the value of the parameter SpiEnableCs in the
container SpiExternalDevice is configured as false and the parameter
SpiPortPinSelect in the container SpiJob is configured.
ERR083066: The DMA HW unit configured in ‘SpiDmaHwUnit’
parameter of ‘SpiDma’ container is invalid as the memory mode of
the respective hardware unit is configured as
<Configured memory mode> when the ‘SpiHighPriorityHwSequence’
in the container ‘SpiSequence' is configured as false in the
respective sequence. This error occurs, if DMA HW unit configured for the parameter
SpiDmaHwUnit in the container SpiDma is configured with the memory
mode DUAL_BUFFER_MODE or TX_ONLY_MODE and the
SpiHighPriorityHwSequence is configured as false in the respective
sequence.
ERR083067: The value of the parameter ‘SpiHwUnitSynchronous’ in
the container ‘SpiJob’ should be configured, since the value of the
parameter ‘SpiLevelDelivered’ in the container ‘SpiGeneral’ is
configured as <2>. This error occurs, if the value of the parameter SpiLevelDelivered in
the container SpiGeneral is configured as 2 and the parameter
SpiHwUnitSynchronous in the container SpiJob is not configured.
ERR083068: The value for the parameter ‘SpiLevelDelivered’ in
the container ‘SpiGeneral’ is configured as <2> and the
parameter ‘SpiMemoryModeSelection’ in the container
‘SpiMemoryMode’ should be configured as
<DIRECT_ACCESS_MODE>, since the respective HW Unit is
configured for <SYNCHRONOUS> in the parameter ‘SpiHwUnitSynchronous’ of the container ‘SpiJob’. This error occurs, if the value of the parameter
SpiMemoryModeSelection in the container SpiMemoryMode is
34
Messages Chapter 8 configured as DIRECT_ACCESS_MODE and the respective HW Unit is
configured for SYNCHRONOUS in the parameter
SpiHwUnitSynchronous of the container SpiJob with the value
configured for the parameter SpiLevelDelivered in the container
SpiGeneral is 2.
ERR083069: The SPI channel configured across jobs should not be
repeated when the parameter ' SpiMemoryModeSelection' in the
container ' SpiMemoryMode' is configured as
<DUAL_BUFFER_MODE/ TX_ONLY_MODE>.
This error occurs, if the value of the parameter
SpiMemoryModeSelection in the container SpiMemoryMode is
configured as DUAL_BUFFER_MODE or TX_ONLY_MODE and the
channels configured for respective jobs are repeated.
ERR083070: The parameter 'SpiInterruptibleSequence' in the container 'SpiSequence' should be configured as <false>, since the jobs
connected to the sequence having the value of the parameter 'SpiMemoryModeSelection' in the container
'SpiMemoryMode' is configured as
<DUAL_BUFFER_MODE/TX_ONLY_MODE>.
This error occurs, if the jobs connected to the sequence having the value
of the parameter SpiMemoryModeSelection in the container
SpiMemoryMode is configured as DUAL_BUFFER_MODE or
TX_ONLY_MODE and the value of the parameter
SpiInterruptibleSequence in the container SpiSequence is not configured
false.
ERR083072: The value of the parameter ‘SpiDataWidth’ in the
container ‘SpiChannel’ is not in the range of <2 to 32> since the value
of the parameter ‘SpiHwUnit’ in the container SpiExternalDevice’ is
configured as CSIHn.
This error will occur, if the value of the parameter SpiDataWidth in the
container SpiChannel is not in the range of 2 to 32 and the value of
the parameter SpiHwUnit in the container SpiExternalDevice is
configured as CSIH<n>. Here <n> is integer numbers e.g. 0, 1, etc.
ERR083075: The chip select for the job <SpiJob short name> should
not be configured as <Chip select value>, since this chip select is
associated with a sequence <SpiSequence short name> which is
having ‘SpiHighPriorityHwSequence' parameter is configured as
<true>. This error occurs, if the chip select for the job is configured as Chip
select value and this chip selects is associated with sequence which is
having SpiHighPriorityHwSequence parameter is configured as true.
ERR083076: Maximum acceptable baud rate for the Job
<SpiJob short name> should be less than or equal to PCLK/4 in
external device <SpiExternal device short name> in the
configuration set <SpiDriver short name>. This error occurs, when maximum acceptable baud rate for the job is
greater than PCLK/4.
ERR083078: The value of parameter ‘SpiHighPriorityHwSequence' 35
Chapter 8 Messages present in the container ‘SpiSequence' should be configured as
<true> for at least one of the sequences, since the parameter ‘SpiHighPriorityHwHandlingEnable' present in the container
'SpiGeneral' is configured as <true>. The error occurs, if the value of the parameter SpiHighPriorityHwSequence
present in the container SpiSequence is not configured as true for none of
the sequences and the value of parameter
SpiHighPriorityHwHandlingEnable present in the container SpiGeneral is
configured as true.
ERR083080: The value configured for the parameter
'SpiSeqStartNotification' should follow C Syntax < [a-zA-Z] [a-zA-Z0-
9_]>.
This error occurs, if the value of configuration parameters mentioned below
does not adhere to C syntax i.e., the value should not contain characters
other than (a-z, A-Z, 0-9 or “_”) and it also should start with an alphabet.
ERR083081: The value of parameter 'SpiSeqStartNotification' present
in the container 'SpiSequence' should be unique for the sequences
having jobs with hardware units of different memory modes. The error occurs, if the value configured for the parameter
'SpiSeqStartNotification' in the 'SpiSequence' container is same for the
sequences having jobs with hardware units of different memory modes.
ERR083082: The short name of the container ‘SpiSequence’ should be
same for sequence having same 'SpiSequenceId' <value for
SpiSequenceId> across multiple configurations set container
‘SpiDriver’. This error occurs, if the short name of the container SpiSequence is not
same for SPI Sequences (having same Sequence ID) across multiple
configurations set container ‘SpiDriver’.
ERR083084: The parameter ‘SpiSeqStartNotification’ in the container
‘SpiSequence’ should be same for sequences having same
'SpiSequenceId' <value for SpiSequenceId> across multiple
configurations set container ‘SpiDriver’. This error will occur, if the parameter SpiSeqStartNotification in the
container SpiSequence is not same for SPI Sequences (having same
Sequence ID) across multiple configurations set container SpiSequence.
Table 8-3 Parameters and Containers related to ERR083084 Parameter Name Container Name SpiSeqStartNotificationEnable
SpiGeneral
SpiSeqStartNotification
SpiSequence
ERR083085: The parameter 'SpiSeqEndNotification' in the container
'SpiSequence' should not be configured, when the parameter
'SpiHwUnitSynchronous' in the container ‘SpiJob’ is configured with
value 'SYNCHRONOUS' since the pre-compile parameter 36
Messages Chapter 8 'SpiSyncSeqEndNotificationEnable' in the 'SpiGeneral' container is
configured as false.
This error will occur if value of the parameter SpiHwUnitSynchronous in
the container ‘SpiJob’ is configured as ‘Synchronous’ , when the
parameter ‘SpiSyncSeqEndNotificationEnable’ in SpiGeneral container is
FALSE and the sequence to which the ‘SpiJob’ belongs has Sequence
end notification configured.
Table 8-4 Parameters and Containers related to ERR083085 Parameter Name Container Name SpiSyncSeqEndNotificationEnable
SpiGeneral
SpiSeqEndNotification
SpiSequence
ERR083086: The value of the parameter 'SpiInputClockSelect' in the
container '/Renesas/Spi0/SpiDriverx/SpiExternalDevicex' should be
same for all Jobs using the same SpiHwUnit 'CSIHx'. The error occurs, if value of the parameter ‘SpiInputClockSelect’ in the
container SpiExternalDevice is not same for all jobs using the same
SpiHwUnit.
ERR083087: The value of the parameter 'SpiBaudrateConfiguration' for
'CSIH_BAUDRATE_REGISTER_x' in the container
'/Renesas/Spi0/SpiDriverx/SpiExternalDevicex' should be same for all
Jobs using the same SpiHwUnit 'CSIHx' The error occurs, if value of the parameter ‘SpiBaudrateConfiguration’ for a
baudrate register in the container SpiExternalDevice is not same for all
SpiExternalDevices using the same baudrate register for all jobs using the
same SpiHwUnit.
ERR083088: The value of the parameter 'SpiPortPinSelect' in the
container '/Spi0/SpiDriverx/SpiJobz' used for
'/Renesas/Spi0/SpiDriverx/SpiExternalDevicex' should not be used for
'/Renesas/Spi0/SpiDriverx/SpiExternalDevicey' in
'/Spi0/SpiDriver0/SpiJobw'.
The error occurs, if the same value of the parameter SpiPortPinSelect
used by an SpiExternalDevice in a SpiJob container is configured for an
another SpiPortPinSelect used by another SpiExternalDevice in an
another SpiJob.
ERR083089: The value of the parameter 'SpiCsPolarity' in the
Container 'SpiExternalDevicex' used for '<HardwareUnit_Name
SpiPortPinSelect_Name>’ should be same as the value of the
parameter 'SpiCsPolarity' in the container 'SpiExternalDevicey' used
for <HardwareUnit_Name SpiPortPinSelect_Name>’.
The error occurs, if the value of the parameter SpiCsPolarity in the
container SpiExternalDevice, is not same across all the external devices
using the same SpiHwUnit CSIHx using the same chipselect.
37
Chapter 8 Messages ERR083090: The value of the parameter <Parameter_Name> across the
containers 'SpiExternalDevicex' and 'SpiExternalDevicey' should be
same as they are referring the same SpiHw <HardwareUnit_Name>
when ‘SpiPersistentHWConfiguration’ or
‘SpiHighPriorityHwHandlingEnable’ is configured as <true>. This error occurs, if any of the parameters SpiCsInactiveAfterLastData,
SpiShiftClockIdleLevel, SpiInputClockSelect or SpiInterruptDelayMode in
the SpiExternalDevice container are not same across the External devices
mapped to the same SpiHwUnit when SpiPersistentHWConfiguration or
SpiHighPriorityHwHandlingEnable is configured as true.
ERR083091: The value of the parameter 'SpiTransferStart' across the
containers 'SpiChannelx' and 'SpiChannely' should be same as they
are referring the same SpiHw 'CSIHn'. The error occurs, if value of the parameters SpiDataWidth,
SpiTransferStart present in SpiChannel container are not same across all
the channel containers using the same SpiHw Unit and
SpiPersistentHWConfiguration is configured as true.
In case of CSIHx SpiHw Unit the values of the parameters SpiDataWidth,
SpiTransferStart present in SpiChannel container are not same across all
the channel containers using the same CSIHx SpiHw and the same
chipselect lines and SpiPersistentHWConfiguration is configured as true.
In case of CSIGn SpiHw Unit the values of the parameters SpiDataWidth,
SpiTransferStart present in SpiChannel container are not same across all
the channel containers using the same CSIGn SpiHw and
SpiPersistentHWConfiguration is configured as true.
Table 8-5 Parameters and Containers related to ERR083091 Container
Parameters
SpiDataWidth
SpiChannel
SpiTransferStart
SpiGeneral
SpiPersistentHWConfiguration
ERR083092: The reference path <path> provided for the parameter
‘parameter name’ in the container ‘container name’, having short name
<container short name> is incorrect. This error occurs, if incorrect reference provided for the reference
parameter (‘SPI_E_DATA_TX_TIMEOUT_FAILURE’).
ERR083093: The reference path <path> configured for the
parameters ‘parameter name’ and ‘parameter name’ in the container
‘container name’ should be unique.
This error occurs, if the reference path provided for the parameters
SPI_E_HARDWARE_ERROR and SPI_E_DATA_TX_TIMEOUT_FAILURE,
are not unique.
38
Messages Chapter 8 ERR083094: The reference path for parameter
'SPI_E_DATA_TX_TIMEOUT_FAILURE/ SPI_E_HARDWARE_ERROR'
in the container 'SpiDemEventParameterRefs' should be same
across multiple configuration set.
This error occurs, if the reference path provided for the parameters
'SPI_E_DATA_TX_TIMEOUT_FAILURE/ SPI_E_HARDWARE_ERROR is
not same across multiple configuration sets.
ERR083107: The value configured for the parameter
‘SpiDmaTrigCtrlOnCS’ should be same across multiple configuration
set.
This error occurs, when the value configured for the parameter
SpiDmaTrigCtrlOnCS is not same across multiple configuration set.
ERR083108: When the parameter ‘SpiDmaHwUnit’ is configured as
<value of parameter SpiDmaHwUnit> and the parameter
‘SpiDmaTrigCtrlOnCS’ is configured as <value of parameter
SpiDmaTrigCtrlOnCS> in the container ‘SpiDma’, then the chip selects
configured in ‘SpiDmaHwUnit’, ‘SpiDmaTrigCtrlOnCS’ and the
parameter ‘SpiPortPinSelect’ in the container SpiJob should match.
This error occurs, when the parameter SpiDmaHwUnit’ is configured as
<value of parameter SpiDmaHwUnit> and the parameter
SpiDmaTrigCtrlOnCS is configured as <value of parameter
SpiDmaTrigCtrlOnCS> and the chip selects configured in ‘SpiDmaHwUnit’,
‘SpiDmaTrigCtrlOnCS’ and the parameter ‘SpiPortPinSelect’ in the
container SpiJob does not match.
ERR083117: The value of parameter ‘SpiCsSelection‘ in the
container ‘SpiExternalDevice’ should not be configured as
<CS_VIA_GPIO> since the value of the parameter ‘SpiHwUnit’ is
configured as < CSIH>.
This error occurs, if the value of the parameter SpiHwUnit in the
container SpiExternalDevice is configured as CSIH<n> and the value
of the parameter SpiCsSelection in the container SpiExternalDevice is
configured as CS_VIA_GPIO. Here <n> is an integer number e.g. 0, 1
etc.
ERR083120: The parameter 'SpiPortPinSelect' value in the container
'SpiJob<x>', should be configured as CSL<n> since 'CSIH<x>' is
configured.
This error will occur if SpiPortPinSelect is not configured when
SpiHwUnit is configured with CSIHn device.
ERR083121: The value of the parameter ‘SpiDataWidth’ in the container ‘SpiChannel’ is not in the range of <7 to 32> since the
value of the parameter ‘SpiHwUnit’ in the container
‘SpiExternalDevice’ is configured as CSIGn.
This error will occur, if the value of the parameter SpiDataWidth in the
container SpiChannel is not in the range of 7 to 32 and the value of the
parameter SpiHwUnit in the container SpiExternalDevice is configured as
39
Chapter 8 Messages CSIG<n>. Here <n> is integer numbers e.g. 0, 1, etc.
ERR083122: The SPI channel having channel id <value of the
parameter SpiChannelId> configured in the container ‘SpiChannel’
should be referred by any of the SPI job. This error occurs, if configured SPI channel is not referred by any of the
SPI job.
ERR083123: "The value of parameter 'SpiEnableCs' in the container
'SpiExternalDevice' should not be configured as false, since the value
of the parameter 'SpiHwUnit' in the container 'SpiExternalDevice' is
configured as CSIH. This error occurs, if CSIH hardware unit is configured and 'SpiEnableCs' is
configured as false.
ERR083124: “The parameter 'SPI_E_ECC_SELFTEST_FAILURE' in the
container 'SpiDemEventParameterRefs’ to be configured when the
parameter 'SpiECCSelfTest' is configured as <ECC_Init> or
<ECC_Init_RunTime> in 'SpiGeneral' container.”
This error occurs when 'SpiECCSelfTest' is configured as <ECC_Init> or
<ECC_Init_RunTime> and reference path for the dem error
'SPI_E_ECC_SELFTEST_FAILURE' is not configured.
ERR083125: “The parameter 'SpiECCSelfTest'should not be
configured as <ECC_Init> or <ECC_Init_RunTime> in ‘SpiGeneral’
container when there are no <CSIH> hardware units configured.”
This error occurs when 'SpiECCSelfTest' is configured as <ECC_Init> or
<ECC_Init_RunTime> and there are no CSIH hardware units configured.
ERR083126: “The parameter 'SPI_E_INT_INCONSISTENT' in the
container 'SpiDemEventParameterRefs0' has to be configured when
the parameter 'SpiInterruptConsistencyCheck' is configured as true in
'SpiGeneral' container.”
This error occurs when 'SpiInterruptConsistencyCheck'
is configured as
true and reference path for the dem error 'SPI_E_INT_INCONSISTENT'
is
not configured.
ERR083127: “The parameter 'SPI_E_REG_WRITE_VERIFY' in the
container 'SpiDemEventParameterRefs0' has to be configured when
the parameter 'SpiCSIGHWriteVerify' or 'SpiDMAWriteVerify' are
enabled in 'SpiGeneral' container.”
This error occurs when 'SpiCSIGHWriteVerify' or 'SpiDMAWriteVerify'
is
configured as true and reference path for the dem error
SPI_E_REG_WRITE_VERIFY is not configured.
ERR083118: “The parameter
'SPI_E_LOOPBACK_SELFTEST_FAILURE' in the container
'SpiDemEventParameterRefs0' has to be configured when the
parameter 'SpiLoopBackSelfTest’ is configured as <LoopBack_Init>
or <LoopBack_Init_RunTime> in 'SpiGeneral' container.”
This error occurs when 'SpiLoopBackSelfTest’ is configured as
<LoopBack_Init> or <LoopBack_Init_RunTime> and reference path for the
dem error 'SPI_E_LOOPBACK_SELFTEST_FAILURE' is not configured.
40
Messages Chapter 8 ERR083128: “The SPI channels configured for a specific job should
be consecutive in order when the parameter
'SpiMemoryModeSelection' in the container 'SpiMemoryMode' is
configured as <DUAL_BUFFER_MODE/TX_ONLY_MODE>.”
This error occurs when multiple channels are configured for a specific job
and are not in consecutive order when the parameter
'SpiMemoryModeSelection' in the container 'SpiMemoryMode' is configured
as <DUAL_BUFFER_MODE/TX_ONLY_MODE>.
ERR083131: “The SPI jobs having Job Id <value of the parameter
‘SpiJobId’> configured in the container ‘SpiJob’ should be referred by
any of the SPI sequence.” This error occurs, if configured SPI job is not referred by any of the SPI
sequence in ECU Configuration Description File.
ERR083129: “The parameter 'Spi_UseWriteVerifyErrorInterface' in the 'SpiGeneral’ container should be configured when any of the
parameters 'SpiCSIGHWriteVerify' or 'SpiDMAWriteVerify' are enabled'. This error occurs, if 'Spi_UseWriteVerifyErrorInterface' is configured but
'SpiCSIGHWriteVerify' or 'SpiDMAWriteVerify' are not configured.
ERR083130: “The parameter 'SpiWriteVerifyErrorInterface' in the 'SpiGeneral' container should be configured when the parameters
'Spi_UseWriteVerifyErrorInterface' is configured as 'true'. This error occurs, if 'Spi_WriteVerifyErrorInterface' is not configured while
'Spi_UseWriteVerifyErrorInterface' is configured as 'true'.
ERR083095: The value configured for the parameter 'SpiDmaHwUnit' should be same across multiple configuration set. This error occurs, if 'SpiDmaHwUnit' is not configured with the same value
across multiple configurations. It should be same across multiple
configurations.
8.2 Warning Messages
WRN083002: The value of parameter 'SpiDeviceAssignment' from the container ‘short name of SpiJob container of one
SpiPortPinSelect’ and ‘short name of SpiJob container of another
SpiPortPinSelect’ should be same since the value of parameter
'SpiPortPinSelect' of respective jobs is same, the memory mode of
the respective Job's hardware unit is configured as
<DUAL_BUFFER_MODE or TX_ONLY_MODE> and the respective
jobs belong to the same sequence. This warning occurs, if SpiDeviceAssignment parameter in SpiJob is not
same for the jobs having same SpiHwUnit and SpiPortPinSelect with in the
same SpiSequence and the memory mode of the respective Job's
hardware unit is configured as DUAL_BUFFER_MODE or
TX_ONLY_MODE.
WRN083004: The value for ‘SpiDmaMode’ should be configured as <false> since the value of the parameter ‘SpiLevelDelivered’ is
configured as <0>. Hence configuration value for DMA will be ignored
for this configuration. 41
Chapter 8 Messages This warning occurs, if the value for parameter SpiLevelDelivered is 0 and
SpiDmaMode is configured as true.
WRN083005: The value of parameter 'SpiDataWidth' from 'SpiChannel' container is <value of parameter SpiDataWidth> and
the value of parameter 'SpiDefaultData' is <value of parameter
SpiDefaultData>. Hence only Least Significant Byte is considered
from the value of parameter 'SpiDefaultData'. This warning occurs, if the value configured in the parameter
SpiDefaultData of container SpiChannel is greater than the value
(2 SpiDataWidth – 1) of the same container when, the value of
SpiDataWidthSelection in the container SpiGeneral is configured as
BITS_8.
WRN083006: The value of parameter 'SpiDataWidth' from 'SpiChannel' container is <value of parameter SpiDataWidth> and
the value of parameter 'SpiDefaultData' is <value of parameter
SpiDefaultData>. Hence only Least Significant Word is considered
from the value of parameter 'SpiDefaultData'. This warning occurs, if the value configured in the parameter
SpiDefaultData of container SpiChannel is greater than the value
(2 SpiDataWidth – 1) of the same container when, the value of
SpiDataWidthSelection in the container SpiGeneral is configured as
BITS_16.
WRN083009: The value of parameter 'SpiDmaMode' from the
container 'SpiGeneral' is configured as <false> and the container 'SpiDma' is configured. In this case, the configuration provided in
'SpiDma' container is ignored. This warning occurs, if the value of parameter SpiDmaMode from the
container SpiGeneral is configured as false and the container SpiDma is
configured. In this case, the configuration provided in SpiDma container is
ignored.
WRN083010: The value for parameter ‘SpiCsPolarity’,
‘SpiCsInactive’, ‘SpiInterruptDelayMode’, ‘SpiInputClockSelect’
or ‘SpiBaudrateConfiguration' from the container
'SpiExternalDevice' should be same since the memory mode of the respective hardware unit is configured as <DUAL_BUFFER_MODE or TX_ONLY_MODE> and the respective jobs belong to the same sequence. Only the configured value(s) for the first Job is considered. This warning occurs, if the value for parameter SpiCsPolarity,
SpiCsInactive, SpiInterruptDelayMode, SpiInputClockSelect or
SpiBaudrateConfiguration from the container SpiExternalDevice is not
same, the memory mode of the respective hardware unit is configured as
DUAL_BUFFER_MODE or TX_ONLY_MODE and the respective jobs
belong to the same sequence. Only the configured value(s) for the first
Job is considered.
WRN083012: SpiMemoryModeSelection for Spi jobs value of the SpiJob short name of the value of the SpiSequence should be <TX_ONLY_MODE>, since the parameter
SpiHighPriorityHwSequence in the SpiSequence container is configured as <true> for this sequence. Hence the generation 42
Messages Chapter 8 tool ignores the value configured for the parameter SpiHighPriorityHwSequence for this sequence. This warning occurs, if the SpiMemoryModeSelection for Spi jobs value of
the SpiJob short name of the value of the SpiSequence should be
<TX_ONLY_MODE>, since the parameter SpiHighPriorityHwSequence in
the SpiSequence container is configured as <true> for this sequence.
Hence the generation tool ignores the value configured for the parameter
SpiHighPriorityHwSequence for this sequence.
WRN083079: The parameter 'SpiSeqStartNotification' in the container 'SpiSequence' should not be configured, since the pre-compile
parameter, SpiSeqStartNotificationEnable' in the 'SpiGeneral'
container is configured as false.
The warning occurs if value is configured for the parameter
'SpiSeqStartNotification ‘in the container 'SpiSequence' when the
parameter 'SpiSeqStartNotificationEnable' in the 'SpiGeneral' container is
configured as false.
WRN083081: The value of the parameter 'SpiCsInactiveAfterLastData' in the container 'SpiExternalDevice' is ignored for any CSIH HW Unit
as 'SpiCsIdleEnforcement' is configured as true. The warning will occur if the values are configured for parameters
SpiCsIdleEnforcement is true and SpiCsInactiveAfterLastData is false in
the container SpiExternalDevice for a CSIH HW Unit.
WRN083084: The parameter ‘SpiLevelDelivered’ is configured as <0>
and ‘SpiInterruptibleSeqAllowed’ in the container ‘SpiGeneral’ is
configured as <true>. Hence the value of parameter
‘SpiInterruptibleSeqAllowed’ in the container ‘SpiGeneral’ is ignored. This warning occurs, if the parameter SpiLevelDelivered is configured as
0 (SPI Level 0 Driver) and SpiInterruptibleSeqAllowed in the container
SpiGeneral is configured as true. Hence value of the parameter
SpiInterruptibleSeqAllowed in the container SpiGeneral is ignored.
WRN083085: The parameter 'SpiHighPriorityHwSequence' in the
container ‘SpiSequence’ should not be configured as <true>. Since
the pre-compile parameter 'SpiHighPriorityHwHandlingEnable' in
the ‘SpiGeneral’ container is configured as <false>. Hence the
generation tool ignores the value configured for the parameter
'SpiHighPriorityHwSequence'. This warning occurs, if the value of the parameter
SpiHighPriorityHwSequence configured in the container SpiSequence
is not to be configured as true. And the parameter
SpiHighPriorityHwHandlingEnable in the container SpiGeneral should be
false. On that moment Generation tool ignores the value configured for
the parameter SpiHighPriorityHwSequence.
8.3 Information Messages
INF083001: The value of the parameter ‘SpiShiftClockIdleLevel’ in the
container ‘SpiExternalDevice’ configured is ignored since the value of
parameter ‘SpiHwUnit’ present in the container 'SpiExternalDevice' is
configured as <CSIGn>.
43
Chapter 8 Messages This information occurs, if the value of parameter SpiHwUnit present in the
container SpiExternalDevice is configured as CSIG<n> and the value of
the parameter SpiShiftClockIdleLevel in the container SpiExternalDevice is
configured. In this case the value of SpiShiftClockIdleLevel in the
container SpiExternalDevice is ignored. Here <n> is integer number e.g. 0,
1, etc.
INF083003: Calculated SPI baud rate for job ‘SpiJob’ in configuration
set ‘SpiDriver’ should be equal to <Calculated
Buadrate Hz>. This information occurs to provide the calculated SPI baud rate for job
(SpiJob) in configuration set SpiDriver.
The calculation of baud rate is done as follows:
Baudrate = (Referred peripheral clock from MCU) /
[(2^m) * SpiBaudrateConfiguration * 2]
Table 8-6 Parameter values related to INF083003 SpiInputClockSelect m PCLK
0
PCLK_DIVBY_2
1
PCLK_DIVBY_4
2
PCLK_DIVBY_8
3
PCLK_DIVBY_16
4
PCLK_DIVBY_32
5
PCLK_DIVBY_64
6
INF083005: The parameters 'SpiCsIdleEnforcement', 'SpiCsIdleTiming',
'SpiCsHoldTiming', 'SpiCsInterDataDelay' and 'SpiCsSetupTime' from
the container 'SpiExternalDevice' should not be configured since the
parameter 'SpiHwUnit' present in the container 'SpiExternalDevice' is
configured as <CSIGn>.
This information occurs, if the parameters SpiCsIdleEnforcement,
SpiCsIdleTiming, SpiCsHoldTiming, SpiCsInterDataDelay and
SpiCsSetupTime are configured when the parameter SpiHwUnit in the
container SpiExternalDevice is configured as CSIG<n>. Here <n> is
integer number e.g. 0, 1, etc.
INF083006: The HW unit <value of the parameter SpiSynchHwUnit> published in the parameter ‘SpiSynchHwUnit’ of the container ‘SpiCsig<m>/SpiCsih<n>’ is not configured as <SYNCHRONOUS>
for any of the hardware units selected for jobs. This information occurs, if the value of the parameter SpiSynchHwUnit
configured in the container SpiCsig<m> or SpiCsih<n> is not configured
as SYNCHRONOUS for hardware units selected for any of the jobs.
Here <m> and <n> are integer numbers e.g. 0, 1, etc.
INF083008: The DMA trigger configured for hardware unit "CSIH1"
mentioned in the parameter 'SpiDmaTrigCtrlOnCS' does not match
with the hardware unit "CSIH0" of the parameter 'SpiDmaHwUnit' in
the container 'SpiDma', hence the value configured for the
parameter 'SpiDmaTrigCtrlOnCS' is ignored.
This information occurs, if the hardware unit configured in the parameter
SpiDmaTrigCtrlOnCS does not match with the hardware unit configured in
44
Messages Chapter 8 the parameter SpiDmaHwUnit of SpiDma container.
INF083009: The expected CS behavior may not be observed at high
baud rates in case of Direct Access Mode due to general limitation of
the serial controllers. A work around at high baud rates is to use FIFO
mode.
This information occurs when ever Direct Access Mode is configured to
notify the user that, at chip select behavior may not be as expected at
higher baud rate in Direct Access Mode.
INF083010: When the parameter <SpiCsPolarity> in the container
<SpiExternalDevice> is configured as high, then the setting of the
parameter <SpiDmaTrigCtrlOnCS> in the container <SpiDma> shall be
ignored. This information occurs whenever the chip select polarity is high when DMA
is enabled and SpiDmaTrigCtrlOnCS is having values other than
<CSIHn>_<CSLn>_IC0_IR0_00.
Note: n = 0 or 1.
45
Chapter 8 Messages 46
Notes Chapter 9 Chapter 9 Notes “Generation Tool” and “Tool” terminologies are used interchangeably to
refer SPI Driver Generation Tool.
47
Chapter 9 Notes 48
Revision History Sl.No. Description Version Date 1.
Initial Version
1.0.0
24-Oct-2013
2.
Error message numbers updated.
1.0.1
28-Jan-2014
3.
Error message ERR083093 and ERR083094 are updated and
1
.0
.2
29-Apr-2014
ERR083118 and ERR083119 are added.
4.
The information message INF083003 is updated for baud rate
1.0.3
12-May-2014
formula.
5.
1. Parameter SpiReadBackConfiguration is removed from table of Error 1.0.4
23-Jul-2014
message ERR083004.
2. The information message INF083008 is added.
3. Parameter SpiLoopBackSelfTest is added in table of Error message
ERR083004.
4. Error message ERR083119 is removed, INF083004 is made as
WRN083084,
ERR083072 is updated and ERR083121 is added.
5. INF083007 is made as
WRN083085, Error message ERR083085 is
reformulated and for ERR083084 table is added.
6.
ERR083120 is added.
6.
1. Error message ERR083118 is removed.
1.0.5
22-Oct-2014
2. Description of error message ERR083041 is updated.
3. Reference Documents section is updated.
4. Chapter 4 remark section is updated.
5. Chapter 6 is updated for the precautions.
6. Parameter SpiLoopBackSelfTest is removed in table of Error
message ERR083004.
7. Parameter SPI_E_SELF_TEST_FAILURE is removed from error
messages ERR083093 and ERR083094.
7.
1. Error messages ERR083005, ERR083018 and ERR083037 are
1.0.6
19-Nov-2014
rephrased.
8.
Following changes are made:
1.0.7
16-May-2015
1. Updated section 2.1 ‘Reference Documents’ to correct the name and
version of Parameter Definition Files.
2. Section 8.1 and Section 8.2 is modified for removing warning and
adding error message ( WRN083001 to ERR083122)
9.
Following changes are made:
1.0.8
28-Jan-2016
1. Updated Pdf versions in section 2.1 ‘Reference Documents’.
2. Mandatory parameters list updated to remove SpiFifoTimeOut
parameter in section 8.1.
3. Mandatory parameters list updated to add SpiLoopBackSelfTest,
SpiECCSelfTest, SpiInterruptConsistencyCheck, SpiWriteVerify and
SpiDmaWriteVerify parameters
4. Error messages ERR083118, ERR083124, ERR083125,
ERR083126, and ERR083127 are added.
5. Information message INF083009 is added for chip select behavior
with high baudrate.
6. ERR083054 is modified as part of fixing the ticket ARDAAAE-1452
7. ERR083090 is updated to remove ‘SpiFifoTimeOut' as per JIRA#
ARDAAAE-1334.
49
Sl.No. Description Version Date 10.
Following changes are made:
1.0.9
07-Apr-2016
1. ERR083013 is updated to add the validation for the parameter
SpiTransferStart as per ticket ARDAAAE1699.
2. ERR083128 is added for validating the order of channels.
3. As per ticket ARDAAAE-1584, ERR083090 message is updated for
the description.
4. As part of ticket ARDAAAE-1699 fixing, ERR083089 is updated to
brief the description in detail.
5. WRN083002 has been converted to error message ERR0830131.
11
Following changes are made:
1.0.10
15-Jul-2016
1. ERR083127 error message is updated.
2. Error messages ERR083129 and ERR083130 are added.
3. R-number is updated.
4. Removed the error messages ERR083109, ERR083110,
ERR083111, ERR083113, ERR083115, ERR083116, ERR083114
and ERR083112 and updated the error description of ERR083108.
5. Added information message INF083010.
6. Updated error description of ERR083066.
7. Renamed the macros SpiWriteVerify and SpiDmaWriteVerify to
SpiCSIGHWriteVerify and SpiDMAWriteVerify.
8. Removed the warning message WRN083080.
12
Following changes are made:
1.0.11
28-Oct-2016
1. Table numbers are added for tables present in Chapter 8.
2. Updated error description of ERR083016 and ERR083017.
13
Following changes are made:
1.0.12
17-Feb-2017
1.Updated Pdf versions in section 2.1 ‘Reference Documents’
2.Error messages ERR083005, ERR083018 and ERR083037 are
rephrased in the section 8.1
3.Error Message, ERR083095 is added in the section 8.1
4.R-number is updated.
5.Notice and Company addresses are updated
6.Copyright information is updated.
50
51
AUTOSAR MCAL R4.0.3 User's Manual SPI Driver Component Ver.1.0.12 Generation Tool User's Manual 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 detailed information.
Renesas Electronics America Inc.
2801 Scott Boulevard Santa Clara, CA 95050-2549, U.S.A.
Tel: +1-408-588-6000, Fax: +1-408-588-6130
Renesas Electronics Canada Limited
9251 Yonge Street, Suite 8309 Richmond Hill, Ontario Canada L4C 9T3
Tel: +1-905-237-2004
Renesas Electronics Europe Limited
Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, U.K
Tel: +44-1628-585-100, Fax: +44-1628-585-900
Renesas Electronics Europe GmbH
Arcadiastrasse 10, 40472 Düsseldorf, Germany
Tel: +49-211-6503-0, Fax: +49-211-6503-1327
Renesas Electronics (China) Co., Ltd.
Room 1709, Quantum Plaza, No.27 ZhiChunLu Haidian District, Beijing 100191, P.R.China
Tel: +86-10-8235-1155, Fax: +86-10-8235-7679
Renesas Electronics (Shanghai) Co., Ltd.
Unit 301, Tower A, Central Towers, 555 Langao Road, Putuo District, Shanghai, P. R. China 200333
Tel: +86-21-2226-0888, Fax: +86-21-2226-0999
Renesas Electronics Hong Kong Limited
Unit 1601-1611, 16/F., Tower 2, Grand Century Place, 193 Prince Edward Road West, Mongkok, Kowloon, Hong Kong
Tel: +852-2265-6688, Fax: +852 2886-9022
Renesas Electronics Taiwan Co., Ltd.
13F, No. 363, Fu Shing North Road, Taipei 10543, Taiwan
Tel: +886-2-8175-9600, Fax: +886 2-8175-9670
Renesas Electronics Singapore Pte. Ltd.
80 Bendemeer Road, Unit #06-02 Hyflux Innovation Centre, Singapore 339949
Tel: +65-6213-0200, Fax: +65-6213-0300
Renesas Electronics Malaysia Sdn.Bhd.
Unit 1207, Block B, Menara Amcorp, Amcorp Trade Centre, No. 18, Jln Persiaran Barat, 46050 Petaling Jaya, Selangor Darul Ehsan, Malaysia
Tel: +60-3-7955-9390, Fax: +60-3-7955-9510
Renesas Electronics India Pvt. Ltd.
No.777C, 100 Feet Road, HAL II Stage, Indiranagar, Bangalore, India
Tel: +91-80-67208700, Fax: +91-80-67208777
Renesas Electronics Korea Co., Ltd.
12F., 234 Teheran-ro, Gangnam-Gu, Seoul, 135-080, Korea
Tel: +82-2-558-3737, Fax: +82-2-558-5141
© 2006-2017 Renesas Electronics Corporation. All rights reserved.
Colophon 1.0

AUTOSAR MCAL R4.0.3
User’s Manual
R20UT3727EJ0101
Document Outline
7 - R20UT3754EJ0101-AUTOSAR
RUCG Tool User's Manual9 - 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
10 - Spi Integration Manual
Integration Manual
For
Spi
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>