This is the multi-page printable view of this section. Click here to print.
SPI Handler Driver
1 - R20UT3659EJ0100-AUTOSAR
2 - R20UT3659EJ0100-AUTOSAR_ind
Page 1
Page 2
Page 3
Page 4
Page 5
Page 6
Page 7
Page 8
Page 9
Page 10
Page 11
Page 12
Page 13
Page 14
Page 15
Page 16
Page 17
Page 18
Page 19
Page 20
Page 21
Page 22
Page 23
Page 24
Page 25
Page 26
Page 27
Page 28
Page 29
Page 30
Page 31
Page 32
Page 33
Page 34
Page 35
Page 36
Page 37
Page 38
Page 39
Page 40
Page 41
Page 42
Page 43
Page 44
Page 45
Page 46
Page 47
Page 48
Page 49
Page 50
Page 51
Page 52
Page 53
Page 54
Page 55
Page 56
Page 57
Page 58
Page 59
Page 60
Page 61
Page 62
Page 63
Page 64
Page 65
Page 66
Page 67
Page 68
Page 69
Page 70
Page 71
Page 72
Page 73
Page 74
3 - R20UT3659EJ0100-AUTOSARs



AUTOSAR MCAL R4.0.3
User's Manual
SPI Driver Component Ver.1.0.2
Embedded User's Manual
Target Device:
RH850/P1x-C
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.00 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
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
CSIH/CSIG, CSIG
Enhanced Queued Clocked Serial Interface.
DEM
Diagnostic Event Manager
DET/Det
Development Error Tracer
DIO
Digital Input Output
DMA
Direct Memory Access
EB
External Buffer
ECU
Electronic Control Unit
EDL
Extended Data Length
EEPROM
Electrically Erasable Programmable Read-Only Memory
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
NA
Not Applicable
PLL
Phase Locked Loop
RAM
Random Access Memory
ROM
Read Only Memory
RTE
Run Time Environment
SPI
Serial Peripheral Interface
µs
Micro Seconds
Definitions
Term
Represented by
Sl. No.
Serial Number
5
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 ........................................................................................................................... 22
4.3.
User Mode and Supervisor Mode ........................................................................................... 23
4.4.
Memory modes ........................................................................................................................ 25
4.5.
Data Consistency ..................................................................................................................... 25
4.6.
Deviation List ........................................................................................................................... 26
Chapter 5
Architecture Details .......................................................... 29
Chapter 6
Registers Details ............................................................... 33
Chapter 7
Interaction Between The User And SPI Driver Component
............................................................................................ 41
7.1.
Services Provided By SPI Driver Component To The User................................................. 41
Chapter 8
SPI Driver Component Header And Source File
Description ............................................................................................ 43
Chapter 9
Generation Tool Guide ...................................................... 47
Chapter 10 Application Programming Interface ................................. 49
10.1.
Imported Types ........................................................................................................................ 49
10.1.1. Standard Types .......................................................................................................... 49
10.1.2. Other Module Types ................................................................................................... 49
10.2.
Type Definitions ....................................................................................................................... 49
10.2.1. Spi_ConfigType ........................................................................................................... 49
10.2.2. Spi_StatusType .......................................................................................................... 49
10.2.3. Spi_JobResultType..................................................................................................... 50
10.2.4. Spi_SeqResultType .................................................................................................... 50
10.2.5. Spi_DataType ............................................................................................................. 50
10.2.6. Spi_NumberOfDataType ............................................................................................ 50
10.2.7. Spi_ChannelType ....................................................................................................... 51
10.2.8. Spi_JobType ............................................................................................................... 51
7
10.2.9. Spi_SequenceType .................................................................................................... 51
10.2.10. Spi_HWUnitType ........................................................................................................ 51
10.2.11. Spi_AsyncModeType .................................................................................................. 51
10.2.12. Spi_CommErrorType .................................................................................................. 52
10.2.13. Spi_HWErrorsType ..................................................................................................... 52
10.2.14. Spi_SelfTestType ....................................................................................................... 52
10.2.15. Spi_ReturnStatus ........................................................................................................ 52
10.3.
Function Definitions ................................................................................................................ 53
Chapter 11 Development And Production Errors .............................. 55
11.1.
SPI Driver Component Development Errors ......................................................................... 55
11.2.
SPI Driver Component Production Errors............................................................................. 56
Chapter 12 Memory Organization ....................................................... 59
Chapter 13 P1x-C Specific Information ............................................... 61
13.1.
Interaction Between The User And SPI Driver Component ................................................. 61
13.1.1. ISR Function .................................................................................................................. 61
13.2.
Sample Application ................................................................................................................. 63
13.2.1. Sample Application Structure ........................................................................................ 63
13.2.2. Building Sample Application .......................................................................................... 64
13.2.2.1. Configuration Example ................................................................................ 64
13.2.2.2. Debugging The Sample Application ............................................................ 64
13.3.
Memory And Throughput ........................................................................................................ 65
13.3.1. ROM/RAM Usage .......................................................................................................... 65
13.3.2. Stack Depth ................................................................................................................... 66
13.3.3. Throughput Details ........................................................................................................ 66
Chapter 14 Release Details .................................................................. 69
8
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 5-1
SPI Driver Architecture .......................................................................................... 29
Figure 5-2
Component Overview Of SPI Driver Component .................................................. 30
Figure 12-1
SPI Driver Component Driver Organization ........................................................... 59
Figure 13-1
Overview Of SPI Driver Sample Application .......................................................... 63
List Of Tables
Table 4-1
Registers to be Configured for Static Configuration .............................................. 21
Table 4-2
Channel container parameters .............................................................................. 21
Table 4-3
Job container parameters ...................................................................................... 21
Table 4-4
User Mode and Supervisory Mode ........................................................................ 23
Table 4-5
HW unit and Memory Mode Selection ................................................................... 25
Table 4-6
SPI Driver Critical section protection List .............................................................. 25
Table 4-7
SPI Driver Deviation List ........................................................................................ 26
Table 6-1
Register Details...................................................................................................... 33
Table 8-1
Description Of The SPI Driver Component Files ................................................... 44
Table 10-1
The APIs provided by the SPI Driver Component ................................................. 53
Table 11-1
DET Errors Of SPI Driver Component ................................................................... 55
Table 11-2
DEM Errors Of SPI Driver Component .................................................................. 57
Table 13-1
Interrupt Vector Table ............................................................................................ 61
Table 13-2
ROM/RAM Details Without DET ............................................................................ 65
Table 13-3
ROM/RAM Details With DET ................................................................................. 66
Table 13-4
Throughput Details Of The APIs ............................................................................ 67
9
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-C 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
S
W
te
te
n
P
at
G
M
r
r
a
I
F
n
n
l
c
C
R
P
C
a
a
H
E
LI
C
le
P
P
h
o
AM
T
U
l
l
a
AN
x
A
I
D
O
d
E
N
re
F
F
n
R
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
l
D
y
T
s
s
e
r
D
v
D
iv
e
e
h
h
OM
i
D
D
r
v
r
D
D
D
e
r
e
s
s
i
r
r
i
v
r
t
t
D
D
D
e
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 -
E
F
G
W
C
o
x
L
M
U
U
L
EP
C
I
P
A
t.
S
S
IN
C
lo
w
PT
n
N D
n
C
A
M
C
A
W
D
P
D
e
controller
B
U
i
T
i
c
S
R
t
t
k
r
U
I
or
N
M
C
I
I
U
H
O
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_Hardware.c, Spi_Hardware.h, 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
User And SPI Driver Component) the 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
Description)
the 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
Programming Interface)
Component.
Section 11 (Development And
This section lists the DET and DEM errors.
Production Errors)
Section 12 (Memory
This section provides the typical memory organization, which must
Organization)
be met for proper functioning of component.
Section 13(P1X-C
This section provides P1x-C specific information like ISR Function, the
Specific information)
details of the P1x-C Sample Application and its folder structure and the
information about RAM/ROM usage, stack depth and throughput
details.
Section 14 (Release Details)
This section provides release details with version name and
base version.
13
Chapter 1 Introduction
14
Reference Documents
Chapter 2
Chapter 2
Reference Documents
Sl. No.
Title
Version
1.
AUTOSAR_SWS_SPIHandlerDriver.pdf
3.2.0
2.
AUTOSAR BUGZILLA (http://www.autosar.org/bugzilla)
-
Note: AUTOSAR BUGZILLA is a database, which contains concerns raised
against information present in AUTOSAR Specifications.
3.
r01uh0517ej0070_rh850p1x-c_Open.pdf
Rev.1.00
4.
Specification of Compiler Abstraction
3.2.0
(AUTOSAR_SWS_CompilerAbstraction.pdf)
5.
Specification of Memory Mapping
1.4.0
(AUTOSAR_SWS_MemoryMapping.pdf)
6.
Specification of Platform Types
2.5.0
(AUTOSAR_SWS_PlatformTypes.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
“R20UT3660EJ0100-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-C\modules\spi\sample_application\<SubVariant>\make\ghs
\App_Spi_P1x-C_Sample.mak
\App_Spi_P1x-C_Sample.ld
X1X\P1x-C\modules\spi\generator
\R403_SPI_P1x-C_BSWMDT.arxml
17
Chapter 3 Integration And Build Process
X1X\P1x-C\modules\spi\user_manual
(User manuals will be available in this folder)
Note: 1. <AUTOSAR_version> should be 4.0.3
2. <SubVariant> can be P1H-C, P1H-CE, P1M-C.
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 microcontroller pins used for chip select is directly accessed by the
SPI Driver component without using the APIs of DIO module.
•
Maximum number of channels and jobs configurable 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 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-
build time.
•
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.
19
Chapter 4 Forethoughts
•
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.
•
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
•
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 a particular configurations where CSIH HW units are configured, Spi_Init
function must be called before Port_Init function.
•
Only if "SpiCsInactive" 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 behaviour 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.
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.
20
Forethoughts Chapter 4
•
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 suppressedusing
‘SpiAlreadyInitDetCheck’ parameter when DET is enabled.When DET is
disabled there is no impact of “SpiAlreadyInitDetCheck” parameter.
• Hardware high priority sequence mechanism is not supported for P1x-C
devices.
• 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()), else it is dynamic.
• SpiTimeOut has been added to have the hold on functions and ongoing
process of APIs, SpiTimeOut keeps the track of time and breaks loop if it is
exceeds the defined time.
Table 4-1 Registers to be Configured for Static Configuration
CSIH HW Unit
CSIHnCTL0
CSIHnCTL1
CSIHnCTL2
CSIHnCFGx
CSIHnBRSy
Table 4-2 Channel container parameters
Parameter in
Registers linked
channel container
SpiDataWidth
CSIHnCFGx.CSIHnDLSx
SpiTransferStart
CSIHnCFGx.CSIHnDIRx
Table 4-3 Job container parameters
Parameter in job
Registers linked
container
SpiPortPinSelect
CSIHnTXOW.CSIHnCSx
CSIHnCTL1.CSIHnCSx
• Table 4-1 contains the registers that must be configured inside Spi_Init()
function.
• All the parameters in channel/job/external devices containers linked to a
hardware unit mentioned in Table 4-2 and 4-3 should be same for Static
Configuration.
• MCTL1, MCTL2 and CSIHnMRWP0 registers are allowed to be accessed
when there is an ongoing communication only when PWR is set.
21
Chapter 4 Forethoughts
•
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).
•
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 notifications should be called from user’s complex driver ISRs.
•
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 'Spi_DataType' for channels that are configured for DMA and fill
required data(8 or 16) as configured in 'SpiDataWidth' in 'SpiChannel'.
•
The SPI DMA type is specified by the parameter SPI_DMA_TYPE_USED.
•
The Buffers used for transmission/reception using DMA shall be initialized
and configured in Retention RAM or Global RAM.
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.)
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_Hardware.c, Spi_Hardware.h,
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_Hardware.c, Spi_Hardware.h,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.
22
Forethoughts Chapter 4
•
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.
•
The user shall configure the exact Module Short Name Spi in
configurations when reloading, as specified in config.xml file and the same
shall be given in command line.
•
Within the callback notification functions only following APIs are allowed.
Spi_ReadIB
Spi_WriteIB
Spi_SetupEB
Spi_GetJobResult
Spi_GetSequenceResult
Spi_GetHWUnitStatus
Spi_Cancel
All other SPI Handler/Driver API calls are not allowed.
•
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.
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-4 User Mode and Supervisory Mode
Interrupt mode
Polling mode
S
Known limitation
l.
in User Mode
N
API name
user
supervisor
user
supervisor
o
mode
mode
mode
mode
.
The IMR and INTC
1
Spi_Init
-
x
-
x
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
4.
Spi_AsyncTransmit
-
x
-
x
this function. Hence
it should not be
invoked in User
mode.
5.
Spi_ReadIB
x
x
x
x
23
Chapter 4 Forethoughts
Interrupt mode
Polling mode
S
Known limitation
l.
in User Mode
N
API name
user
supervisor
user
supervisor
o
mode
mode
mode
mode
.
6.
Spi_SetupEB
x
x
x
x
7.
Spi_GetStatus
x
x
x
x
8.
Spi_GetJobResult
x
x
x
x
9.
Spi_GetSequenceResult
x
x
x
x
10.
Spi_GetVersionInfo
x
x
x
x
The IMR and INTC
registers are
accessed inside
11.
Spi_SyncTransmit
-
x
-
x
this function. Hence
it should not be
invoked in User
mode.
The IMR and INTC
registers are
accessed inside
this function. Hence
12.
Spi_Cancel
-
x
-
x
it should not be
invoked in User
mode.
The IMR and INTC
registers are
accessed inside
13.
Spi_SetAsyncMode
-
x
-
x
this function. Hence
it should not be
invoked in User
mode.
The IMR and INTC
registers are
accessed inside
Spi_MainFunction_Handl
14.
-
-
-
x
this function. Hence
ing
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
18.
All ISRs
-
x
-
-
this function. Hence
it should not be
invoked in User
mode
Note: Implementation of Critical Section is not dependent on MCAL. Hence
Critical Section is not considered to the entries for User mode in the above
table.
24
Forethoughts Chapter 4
4.4. Memory modes
The SPI Driver will use different memory modes. The following four modes
can be configured.
Table 4-5 HW unit and Memory Mode Selection
HW unit
Memory
mode
CSIH(0-3)
Direct Access Mode
FIFO Mode
Dual Buffer mode
Transmit Only Mode
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:
•
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-6 SPI Driver Critical section protection List
API Name
Exclusive Area Type
Protected
Resources
Spi_AsyncTransmit
SPI_RAM_DATA_PROTECTION During communication the
status of sequence, job,
corresponding hardware unit
and communicating data are
protected.
Spi_SyncTransmit
SPI_RAM_DATA_PROTECTION During communication the
status of sequence, job,
corresponding hardware unit
and communicating data are
protected.
25
Chapter 4 Forethoughts
API Name
Exclusive Area Type
Protected
Resources
Spi_Cancel
SPI_RAM_DATA_PROTECTION During cancelling the status
of sequence are protected.
Note: The highest measured duration of a critical section was 1.162 micro
seconds measured for Spi_AsyncTransmit API.
4.6. Deviation List
Table 4-7 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.
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.
26
Forethoughts Chapter 4
Sl. No.
Description
AUTOSAR Bugzilla
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
From the file Lcfg.c only
As per mantis #8421
notification related structure has
been removed.
15
There will be an inactive state in
As per JIRA ARDAAAF-383
between Chip Select during
communication, when channel
properties are different.
27
Chapter 4 Forethoughts
28
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
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
29
Chapter 5
Architecture Details
•
Module version information
The basic architecture of the SPI Driver component is illustrated in the
following Figure:
AP PL I C A T IO N L A Y ER
n
n
n
nt
atio
ation
tio
e
rm
icatio
iti aliza tion
uffer
form
agem
un
Info
In
B
n
e
an
m
ot ification
N
-
I nitiali za
D
M
om
t us In
C
ersio
Sta
V
r
e
r Lay
SP I H ig h Le v e l Dr ive r
rive
SPI D
Setting of
Sequen
HW
De -
Transmit and
ce and
Return the
register
initialization
receive the jobs
job
status of
Disabling
of SPI HW
and channels
notifica
module, job,
the
units
tion
sequence
interrupts
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. 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().
30
Architecture Details Chapter 5
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().
31
Chapter 5
Architecture Details
32
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
CSIHnCTL0
SpiMemoryModeSelection
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
CSIHnCTL1
SpiCsInactiveAfterLastDat
W
LunDataAccess1.ulRegData
a, SpiDataWidth
ICRn
-
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
CSIHnSTCR0
-
W
SPI_CSIH_CLR_STS_FLAG
S
CSIHnSTR0
-
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
33
Chapter 6
Registers Details
Config
Register
API Name
Registers
Macro/Variable
Parameter
Access
R/W/RW
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
ECCCSIHnTMC SpiECCSelfTest
W
SET_TMC_BITS
SET_TEST_DISABLE
ECCCSIHnTRC SpiECCSelfTest
W
TRC_ERDB_INITIALIZE
ECCCSIHnTED SpiECCSelfTest
R/W
RAM_INITIALIZE,
ALL_ZERO_PATTERN,
ALL_ONE_PATTERN,
TWO_BIT_PATTERN
CSIHnRX0H
-
R
-
CSIHnMCTL1
SpiMemoryModeSelection
W
SPI_CTL_32BIT_REG_VAL
CSIHnMCTL2
SpiMemoryModeSelection
W
SPI_CTL_32BIT_REG_VAL
CSIHnMRWP0 -
RW
LunDataAccess1.ulRegData
Spi_DeInit
CSIHnCTL0
SpiMemoryModeSelection
W
SPI_ZERO
CSIHnCTL1
-
W
SPI_ZERO
CSIHnCTL2
-
W
SPI_CTL2_16BIT_REG_DEI
NIT
CSIHnMCTL0
-
W
SPI_MCTL0_16BIT_REG_D
EINIT
CSIHnMCTL1
-
W
SPI_CTL_32BIT_REG_MAS
K
CSIHnMCTL2
-
W
SPI_CTL_32BIT_REG_MAS
K
CSIHnSTCR0
-
W
SPI_CTL_16BIT_REG_DEIN
IT
CSIHnMRWP0 -
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
DTFRRQCn
-
W
SPI_DMA_DRQ_CLEAR
DCSTCn
-
W
SPI_DMA_STR_CLEAR
DTFRRQn
-
R
-
34
Registers Details Chapter 6
Config
Register
API Name
Registers
Macro/Variable
Parameter
Access
R/W/RW
DCSTn
-
R
-
DTFRn
-
W
SPI_DMA_DEINIT
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
ICRn
-
W
SPI_CLR_INT_REQ
CSIHnSTR0
-
R
-
Spi_WriteIB
CSIHMCTL0
SpiMemoryModeSelection
W
LusMctlData
SPI_TX_ONLY_MODE_SET
SPI_DUAL_BUFFER_MOD
E_SET
CSIHnMRWP0
-
RW
LunDataAccess1.ulRegData
CSIHnTX0W
-
W
LunDataAccess1.ulRegData
Spi_AsyncTransmit
CSIHnMCTL0
-
W
LpJobConfig->usMCtl0Value
CSIHnCTL0
SpiMemoryModeSelection
W
SPI_RESET_PWR
W
SPI_SET_DIRECT_ACCES
S
SPI_SET_MEMORY_ACCE
SS
CSIHnSTCR0
-
W
SPI_CLR_STS_FLAGS
CSIHnSTR0
-
R
-
CSIHnCTL1
SpiCsInactiveAfterLastDat
W
LunDataAccess1.ulRegData
a, SpiDataWidth
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
SPI_DMA_INV_RX_SETTIN
GS
35
SPI_DMA_ONCE
Chapter 6
Registers Details
Config
Register
API Name
Registers
Macro/Variable
Parameter
Access
R/W/RW
DSAn
-
W
(uint32)LpTxData
DTFRn
-
W
(uint32)SPI_ZERO
(uint32)(LpDmaConfig->
usDmaDtfrRegValue
DCSTSn
-
W
SPI_DMA_STR
DTCn
-
W
SPI_ONE
DTFRRQCn
-
W
SPI_DMA_DRQ_CLEAR
DDAn
-
W
(uint32)(&Spi_GddDmaRxD
ata)
CSIHnCTL2
SpiBaudrateRegisterSelect
W
LpJobConfig->usCtl2Value
CSIHnMCTL2
-
W
LunDataAccess1.ulRegData
CSIHnTX0W
-
W
LunDataAccess1.ulRegData,
LunDataAccess2.ulRegData,
LpDataAccess->ulRegData
CSIHnTX0H
-
W
LddData,
LunDataAccess2.usRegData
5[SPI_ZERO]
CSIHnCFGx
SpiCsIdleTiming,
W
LunDataAccess1.ulRegData
SpiCsHoldTiming,
SpiCsInterDataDelay,
SpiCsSetupTime,
SpiCsIdleEnforcement
CSIHnBRSy
SpiBaudrateConfiguration
W
Csih_BaseAddress[LddHWU
nit]->BRSy
IMRn
SpiHwUnitSelection
W
Spi_GstHWUnitInfo[LddHWU
and
nit].ulRxImrMask,
SpiMemoryModeSelection
Spi_GstHWUnitInfo[LddHWU
nit].ulTxImrMask,
Spi_GstHWUnitInfo[LddHWU
nit].ulErrorImrMask,
Spi_GstHWUnitInfo[LddHWU
nit].ulTxCancelImrMask
ICRn
-
W
SPI_CLR_INT_REQ
DTFRRQn
-
R
-
CSIHnRX0H
-
R
-
CSIHnRX0W
-
R
-
Spi_ReadIB
CSIHnRX0W
-
W
LunDataAccess2.ulRegData
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
36
Registers Details Chapter 6
Config
Register
API Name
Registers
Macro/Variable
Parameter
Access
R/W/RW
CSIHnCTL0
-
W
SPI_RESET_PWR
W
SPI_SET_DIRECT_ACCES
S
SPI_SET_PWR
SPI_ZERO
CSIHnRX0H
-
RW
LunDataAccess3.ulRegData,
Spi_GusSynDataAccess
CSIHnSTR0
-
R
-
CSIHnSTCR0
-
W
SPI_DCE_ERR_CLR,
SPI_PE_ERR_CLR,
SPI_OFE_ERR_CLR
CSIHnCTL1
SpiCsInactiveAfterLastDat
W
LunDataAccess1.ulRegData,
a, SpiDataWidth
(LpMainOsBaseAddr-
>ulMainCTL1 |
~SPI_CSRI_AND_MASK
CSIHnCTL2
SpiBaudrateRegisterSelect
W
LunDataAccess1.ulRegData,
LpJobConfig->usCtl2Value
CSIHnTX0W
-
W
LpJobConfig->usCtl2Value,
LunDataAccess3.ulRegData
CSIHnBRSy
SpiBaudrateConfiguration
W
Csih_BaseAddress[LddHWU
nit]->BRSy , LpJobConfig-
>usCtl2Value &
SPI_CSIH_BRS_MASK
ICRn
-
W
SPI_CLR_INT_REQ
CSIHnCFGx
SpiCsIdleTiming,
W
LunDataAccess1.ulRegData
SpiCsHoldTiming,
SpiCsInterDataDelay,
SpiCsSetupTime,
SpiCsIdleEnforcement
Spi_GetHWUnitStatus CSIHnSTR0
-
R
-
Spi_Cancel
CSIHnCTL0
-
R/W
SPI_SET_JOBE
IMRn
-
W
Spi_GstHWUnitInfo[LddHW
Unit].ulTxCancelImrMask
ICRn
-
W
SPI_CLR_INT_REQ
Spi_SetAsyncMode
IMRn
SpiHwUnitSelection
W
Spi_GstHWUnitInfo[LddHWU
and
nit].ulRxImrMask,
SpiMemoryModeSelection
Spi_GstHWUnitInfo[LddHWU
nit].ulTxImrMask,
Spi_GstHWUnitInfo[LddHWU
nit].ulErrorImrMask,
Spi_GstHWUnitInfo[LddHWU
nit].ulTxCancelImrMask
ICRn
-
w
SPI_CLR_INT_REQ
Spi_MainFunction_Ha CSIHnCTL0
-
W
SPI_SET_PWR
ndling
CSIHnRX0H
-
R
-
CSIHnTX0W
-
W
LunDataAccess1.ulRegData
CSIHnTX0H
-
W
LddData
LunDataAccess2.usRegData
5[0]
37
Chapter 6
Registers Details
Config
Register
API Name
Registers
Macro/Variable
Parameter
Access
R/W/RW
CSIHnRX0W
-
R
-
CSIHnMCTL2
SpiMemoryModeSelection
W
LunDataAccess1.ulRegData
ICRn
-
W
SPI_CLR_INT_REQ
DCSTCn
-
W
SPI_DMA_STR_CLEAR
DCSTn
-
R
-
DCENn
-
W
SPI_DMA_DCEN_DISABLE
SPI_DMA_DCEN_ENABLE
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
DDAn
-
W
(uint32)(&Spi_GddDmaRxD
ata)
CSIHnSTCR0
-
W
SPI_CLR_STS_FLAGS
CSIHnSTR0
-
R
-
CSIHnCTL1
SpiCsInactiveAfterLastDat
W
LunDataAccess1.ulRegData
a, SpiDataWidth
LpJobConfig-
>ulMainCtl1Value
SPI_SET_SLIT
CSIHnCTL2
SpiBaudrateRegisterSelect
W
LpJobConfig->usCtl2Value
IMRn
SpiHwUnitSelection
W
Spi_GstHWUnitInfo[LddHWU
and
nit].ulRxImrMask,
SpiMemoryModeSelection
Spi_GstHWUnitInfo[LddHWU
nit].ulTxImrMask,
Spi_GstHWUnitInfo[LddHWU
nit].ulErrorImrMask,
Spi_GstHWUnitInfo[LddHWU
nit].ulTxCancelImrMask
CSIHnCFGx
SpiCsIdleTiming,
W
LunDataAccess1.ulRegData
SpiCsHoldTiming,
SpiCsInterDataDelay,
SpiCsSetupTime,
SpiCsIdleEnforcement
CSIHnBRSy
SpiBaudrateConfiguration
W
Csih_BaseAddress[LddHWU
nit]->BRSy
CSIHnMCTL0
-
W
LpJobConfig->usMCtl0Value
DTFRRQn
-
R
-
Spi_GetVersionInfo
-
-
-
-
Spi_GetErrorInfo
-
-
-
-
Spi_SelfTest
CSIHnRX0H
-
R
-
38
Registers Details Chapter 6
Config
Register
API Name
Registers
Macro/Variable
Parameter
Access
R/W/RW
CSIHnCTL0
SpiLoopBackSelfTest
W
SPI_SET_DIRECT_ACCES
S
SPI_ZERO
CSIHnCTL1
SpiLoopBackSelfTest
W
SPI_LOOPBACK_ENABLE
SPI_ZERO SPI_SET_SLIT
LunDataAccess1.ulRegData
CSIHnCTL2
SpiLoopBackSelfTest
W
SPI_LOOPBACK_CSIH_CN
TRL2_VALUE
SPI_ZERO
((LpJobConfig->usCtl2Value)
& SPI_CSIH_PRE_MASK)
CSIHnSTCR0
SpiLoopBackSelfTest
W
SPI_CSIH_CLR_STS_FLAG
S
SPI_PE_ERR_CLR
SPI_ZERO
CSIHnCFGx
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
-
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
ECCCSIHnTMC SpiECCSelfTest
W
SET_TMC_BITS
SET_TEST_DISABLE
ECCCSIHnTRC SpiECCSelfTest
W
TRC_ERDB_INITIALIZE
ECCCSIHnTED SpiECCSelfTest
R/W
RAM_INITIALIZE,
ALL_ZERO_PATTERN,
ALL_ONE_PATTERN,
TWO_BIT_PATTERN
IMRn
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
ICRn
-
W
SPI_CLR_INT_REQ
39
Chapter 6
Registers Details
Config
Register
API Name
Registers
Macro/Variable
Parameter
Access
R/W/RW
CSIHnMCTL0
SpiMemoryModeSelection
W
LpJobConfig->usMCtl0Value
40
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.
41
Chapter 7 Interaction Between The User And SPI Driver Component
42
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
•
Spi_Hardware.h
The C source file generated by SPI Driver Generation Tool:
•
Spi_PBcfg.c
•
Spi_Lcfg.c
•
Spi_Hardware.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
•
Det.h
•
Rte.h
•
SchM.h
•
SchM_Spi.h
•
Dem.h
•
Dem_cfg.h
The description of the SPI Driver Component files is provided in the table
below:
43
Chapter 8 SPI Driver Component Header And Source File Description
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_Hardware.h
This file contains the #define macros for the hardware registers to be used by the
driver.
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_Hardware.c
This file contains the reference objects for the structures of hardware register which
is defined in device header file.
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 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_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.
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.
44
SPI Driver Component Header And Source File Description
Chapter 8
File
Details
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.
Spi_RegWrite.h
This file contains macro for register write verify check.
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.
Det.h
This file is a stub for DET Component.
Rte.h
This file is a stub for Rte Component.
SchM.h
This file is a stub for Schm Component.
SchM_Spi.h
Header file information for Schm application.
Dem.h
This file is a stub for DEM component.
Dem_cfg.h
This file contains the stub values for Dem_Cfg.h.
45
Chapter 8 SPI Driver Component Header And Source File Description
46
Generation Tool Guide
Chapter 9
Chapter 9
Generation Tool Guide
For information on the SPI Driver Component Code Generation Tool, please
refer “R20UT3660EJ0100-AUTOSAR.pdf” document.
47
Chapter 9 Generation Tool Guide
48
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.
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
This section explains the type definitions of SPI Driver Component according
to AUTOSAR Specification.
10.2.1.
Spi_ConfigType
Name:
Spi_ConfigType
Type:
Structure
Implementation Specific
The contents of the initialization
Range:
data structure are SPI specific
Description:
This type of the external data structure shall contain the initialization data for the SPI
driver/Handler
10.2.2.
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
Range:
currently transmitting any job
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
49
Chapter 10 Application Programming Interface
10.2.3.
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
Range:
SPI 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
10.2.4.
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
Range:
equal to SPI_BUSY
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
10.2.5.
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
10.2.6.
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
50
Application Programming Interface Chapter 10
10.2.7.
Spi_ChannelType
Name:
Spi_ChannelType
Type:
uint8
Range:
0 to 255
Description:
Specifies the identification(IdId) for a channel
10.2.8.
Spi_JobType
Name:
Spi_JobType
Type:
uint16
Range:
0 to 65535
Description:
Specifies the identification(Id) for a Job
10.2.9.
Spi_SequenceType
Name:
Spi_SequenceType
Type:
uint8
Range:
0 to 255
Description:
Specifies the identification(Id) for a sequence of Jobs
10.2.10.
Spi_HWUnitType
Name:
Spi_HWUnitType
Type:
uint8
Range:
0 to 255
Description:
Specifies the identification(Id) for a SPI Hardware microcontroller peripheral(unit)
10.2.11.
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.
51
Chapter 10 Application Programming Interface
Following are the internal type definitions used by the SPI Driver module.
10.2.12.
Spi_CommErrorType
Name:
Spi_CommErrorType
Type:
Structure
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.
10.2.13.
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.
10.2.14.
Spi_SelfTestType
Name:
Spi_SelfTestType
Type:
uint8
Range:
0 to 255
Description:
Specifies the type for self-test functionality.
10.2.15.
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.
52
Application Programming Interface Chapter 10
10.3. Function Definitions
Table 10-1
The APIs provided by the SPI Driver Component
SI.No
API’s
API’s specific
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_MainFuncnction_Handling
-
15
Spi_GetHWUnitStatus
-
16
Spi_GetErrorInfo
-
17
Spi_SelfTest
-
53
Chapter 10 Application Programming Interface
54
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.
55
Chapter 11 Development And Production Errors
Sl. No.
8
Error Code
SPI_E_ALREADY_INITIALIZED
Related API(s)
Spi_Init
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.
56
Development And Production Errors
Chapter 11
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 and Spi_SelfTest.
Source of Error
When an overrun occurs when the next reception starts without performing a CPU
read of the value of the receive buffer, upon completion of the receive operation.
Sl. No.
2
Error Code
SPI_E_DATA_TX_TIMEOUT_FAILURE
Related API(s)
Spi_SyncTransmit, Spi_Init and Spi_SelfTest.
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 loop back self-test error was
detected.
57
Chapter 11 Development And Production Errors
58


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.
ROM Section
SPI D rive r Component Library /
R AM Section
Object Files
SPI Driver code related to APIs are placed in this
Global RAM of unspecific size required for SPI
memory.
Driver functioning.
X1
Y1
Segment Name:
Segment Name:
SPI_PUBLIC_CODE_ROM
NOINIT_RAM_UNSPECIFIED
SPI Driver code r elated to internal functions are
Global RAM of unspecific size initialized by
placed in this memory
Start-Up code.
Y2
X2
Segment Name:
Segment Name:
SPI_PRIVATE_CODE_ROM
RAM_UNSPECIFIED
Global 1-bit RAM initialized by SPI Driver.
SPI Driver code related to ISR functions
are placed in this memory
X3
Segment Name:
Y3
Segment Name:
NOINIT_RAM_1BIT
SPI_FAST_CODE_ROM
Tool Genera ted Files
The const section (for SPI configuration
Global 8- bit R AM initialized by SPI D rive r.
Structure) in the file Spi_PBcfg.c is placed in
this memory.
X4
Segment Name:
Y4
Segment Name:
N OIN IT _ RA M _8 B IT
SPI_CFG_DATA_UNSPECIFIED
The const section in the file Spi_Lcfg.c is placed in
Global 16 -bit RAM initialized by SPI Driver.
this memory.
X4
X5
Segment Name:
Segment Name:
NOINIT_RAM_16 BIT
Y5
CONST_ROM_UNSPECIFIED
.
Global RAM of unspecific size required for SPI Driver
functioning. The Generation tool
:
X6
allocates this RAM.
Y6
Segment Name:
SPI_CFG_RAM_UNSPECIFIED
Figure 12-1 SPI Driver Component Driver Organization
59
Chapter 12 Memory Organization
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):
NOINIT_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.
NOINIT_RAM_1BIT (Y3): This section consists of the global RAM variables of
1-bit size that are used internally by SPI Driver Component. The specific
sections of respective software components will be merged into this RAM
section accordingly.
NOINIT_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.
NOINIT_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.
SPI_CFG_RAM_UNSPECIFIED (Y6): This section consists of the global
RAM variables that are generated by SPI Driver Component Generation Tool.
This can be located in data memory.
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.
60
P1x-C Specific Information
Chapter 13
Chapter 13 P1x-C Specific Information
P1X-C supports following devices:
R7F701370A(CPU1(PE1)), R7F701371(CPU1(PE1)),
R7F701372(CPU1(PE1)), R7F701373, R7F701374.
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. 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-1 Interrupt Vector Table
Interrupt Source
Name of the ISR Function
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
61
Chapter 13
P1x-C Specific Information
Interrupt Source
Name of the ISR Function
INTCSIH3IR
SPI_CSIH3_TIR_ISR
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
INTDMA00
SPI_DMA00_ISR
SPI_DMA00_CAT2_ISR
INTDMA01
SPI_DMA01_ISR
SPI_DMA01_CAT2_ISR
INTDMA02
SPI_DMA02_ISR
SPI_DMA02_CAT2_ISR
INTDMA03
SPI_DMA03_ISR
SPI_DMA03_CAT2_ISR
INTDMA04
SPI_DMA04_ISR
SPI_DMA04_CAT2_ISR
INTDMA05
SPI_DMA05_ISR
SPI_DMA05_CAT2_ISR
INTDMA06
SPI_DMA06_ISR
SPI_DMA06_CAT2_ISR
INTDMA07
SPI_DMA07_ISR
SPI_DMA07_CAT2_ISR
INTDMA08
SPI_DMA08_ISR
SPI_DMA08_CAT2_ISR
INTDMA09
SPI_DMA09_ISR
SPI_DMA09_CAT2_ISR
INTDMA10
SPI_DMA10_ISR
SPI_DMA10_CAT2_ISR
INTDMA11
SPI_DMA11_ISR
SPI_DMA11_CAT2_ISR
INTDMA12
SPI_DMA12_ISR
SPI_DMA12_CAT2_ISR
INTDMA13
SPI_DMA13_ISR
SPI_DMA13_CAT2_ISR
INTDMA14
SPI_DMA14_ISR
SPI_DMA14_CAT2_ISR
INTDMA15
SPI_DMA15_ISR
SPI_DMA15_CAT2_ISR
62
P1x-C Specific Information
Chapter 13
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
C O M P I L E R
AUTOSAR
RH850 Types
Common SPI
P1x-C S P I
STUB
STUB
STUB
D et
sample
Sample
SchM
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 P1X-C is available in the path
X1X\P1x-C\modules\spi\sample_application
The Sample Application consists of the following folder structure
X1X\P1x-C\modules\spi\definition\<AUTOSAR_version>\common\
R403_SPI_P1x-C.arxml
X1X\P1x-C
\modules\spi\sample_application\<SubVariant>\<AUTOSAR_version>
\src\Spi_Lcfg.c
\src\Spi_PBcfg.c
\src\Spi_Hardware.c
\inc\Spi_Cfg.h
\inc\Spi_Cbk.h
\inc\Spi_ Hardware.h
\config\App_SPI_P1x-C_<Device_Name>_Sample.arxml
Note For P1x-C <Device_Name> can be 701370A, 701371, 701372,
701373, 701374.
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.
63
Chapter 13
P1x-C Specific Information
•
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 passed 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 passed 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_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.
•
The API Spi_GetErrorInfo copies Hardware Error Details to User
Buffer.
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_<SubVariant>_<Device_Name>_Sample.arxml.
Note For P1x-C <Device_Name> can be 701370A, 701371, 701372,
701373, 701374.
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-C\common_family\make\ghs\<Compiler>”
• Now execute the batch file SampleApp.bat with following parameters
SampleApp.bat Spi 4.0.3 <Device_name>
• After this, all the object files, map file and the executable file
App_Spi_P1x-C_Sample.out will be available in the output folder:
(“X1X\P1x-C\modules\spi\sample_application\<SubVariant>
\obj\<Compiler>”)
64
P1x-C Specific Information
Chapter 13
• 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-C\modules\spi\sample_application\<SubVariant>
\<AUTOSAR_version>\config\App_SPI_P1X-C_701372_Sample.arxml”
• The database alone can be generated by using the following
commands.
make –f App_SPI_P1x-C_Sample.mak generate_spi_config
make –f App_SPI_P1x-C_Sample.mak App_SPI_P1x-C_Sample.s37
• After this, a flash able Motorola S-Record file App_SPI_P1x-
C_Sample.s37 is available in the output folder.
Note: The <Device_name> indicates the device to be compiled, which
can be 701370A, 701371, 701372, 701373, 701374 and <SubVariant>
can be P1H-C, P1H-CE, P1M-C.
13.3. Memory And Throughput
Typical Configuration
DET OFF
DMA disabled
All other Pre-Compile Settings ON
2 16bit SPI channels
o with external buffers
o with internal buffers
2 SPI jobs
o CSIH in direct access mode
2 external devices configured
SpiLevelDelivered configured as 2
13.3.1. ROM/RAM Usage
The details of memory usage for the typical configuration, with DET
disabled as provided in Table 13-2
Table 13-2 ROM/RAM Details Without DET
Sl. No. ROM/RAM
Segment Name
Size in bytes
1
ROM
DEFAULT_CODE_ROM
7782
CONST_ROM_UNSPECIFIED
456
CONST_ROM_32BIT
32
65
Chapter 13
P1x-C Specific Information
Sl. No. ROM/RAM
Segment Name
Size in bytes
2
RAM
NOINIT_RAM_UNSPECIFIED
156
RAM_UNSPECIFIED
2
NOINIT_RAM_1BIT
8
NOINIT_RAM_8BIT
9
NOINIT_RAM_16BIT
22
RAM_8BIT
2
The details of memory usage for the typical configuration, with DET
enabled and all other configurations as provided in Table 13-3.
Table 13-3 ROM/RAM Details With DET
Sl. No. ROM/RAM
Segment Name
Size in bytes
1
ROM
DEFAULT_CODE_ROM
8856
CONST_ROM_UNSPECIFIED
456
CONST_ROM_32BIT
32
2
RAM
NOINIT_RAM_UNSPECIFIED
156
RAM_UNSPECIFIED
2
NOINIT_RAM_1BIT
8
NOINIT_RAM_8BIT
9
NOINIT_RAM_16BIT
22
RAM_8BIT
2
13.3.2. Stack Depth
The worst-case stack depth for Driver Component is 188 bytes for the
typical configuration provided in Section 13.2.2.1.
13.3.3. Throughput Details
The throughput details of the APIs for the configuration mentioned in the
Section13.2.2.1 Configuration are provided in this section. The clock
frequency used to measure the throughput is 240 MHz for all APIs.
66
P1x-C Specific Information
Chapter 13
Table 13-4 Throughput Details Of The APIs
Sl. No.
API Name
Throughput in
Remarks
microseconds
1
Spi_Init
2.137
-
2
Spi_DeInit
2.500
-
3
Spi_WriteIB
0.387
-
4
Spi_AsyncTransmit
5.325
-
5
Spi_ReadIB
0. 250
-
6
Spi_SetupEB
0.200
-
7
Spi_GetStatus
0.620
-
8
Spi_GetJobResult
0. 620
-
9
Spi_GetSequenceResult
0. 620
-
10
Spi_GetVersionInfo
0.100
-
11
Spi_SyncTransmit
8.400
-
12
Spi_GetHWUnitStatus
0.187
-
13
Spi_Cancel
0.275
-
14
Spi_SetAsyncMode
1.437
SPI_POLLING_MODE
15
Spi_SetAsyncMode
0.175
SPI_INTERRUPT_ MODE
16
Spi_MainFunction_Handling
0.850
-
17
Spi_SelfTest
649.850
SPI_LOOP_BACK_SELF
_TEST
18
Spi_SelfTest
32.150
SPI_ECC_SELF_TEST
19
Spi_GetErrorInfo
0.125
-
67
Chapter 13
P1x-C Specific Information
68
Release Details Chapter 14
Chapter 14 Release Details
SPI Driver Software
Version: 2.0.0
69
Chapter 14 Release Details
70
Revision History
Sl.No. Description
Version
Date
1.
Initial Version
1.0.0
05-Aug-2015
2
Following changes are made:
1.0.1
28-Mar-2016
1. Table 4-4 User Mode and Supervisory Mode is
updated.
2. In section 4, Information for 16 bit datawidth selection is
added when DMA is configured.
3. Table 6-1 Register details, 8bit and 32bit settings when
DMA is configured are removed.
4. In section 4.6, Information for the limitation for CS
added.
5. In section 4.2, Note about the user Configuration of
Module Short Name was added.
6. In section 11.1, new development error
SPI_E_MAINFUNCTION_HANDLING_INVALIDMODE
is added for Spi_MainFunction_Handling API.
3
Following changes are made:
1.0.2
15-Feb-2017
1. Removed Section 13.2, Compiler, Linker and
Assembler.
2. In section 4.3, Note about entries for User mode
dependency of Critical Section added.
3. In section 4.5, Critical section details are updated by
adding Table 4-6.
4. In section 4.1, Note added regarding the DMA access
for local RAM area.
5. In section 12, Memory Organization is updated by
adding information about
SPI_START_SEC_CODE_FAST.
6. Section 6, Register access details are updated.
7. Updated section 13.2.1 Sample Application Structure to
add details about Spi_GetErrorInfo API.
8. Added Spi_GetErrorInfo API in section 11.1 under
Related API(s) corresponding to the error
SPI_E_UNINIT.
9. Section 3 updated R number in remarks.
10. Folder Structure updated in the section 3.1.1.
11. Table 4-4 User mode and Supervisory mode is updated.
12. Section 8 updated for file information.
13. Section 9 updated for R number.
14. Table 10-1 updated with API name.
15. Memory, Throughput and stack depth Details are
updated in section 13.3.
16. Release details updated in section 14.
17. Chapter 13, Added Processor name along with Device
variants.
18. Figure 12-1 SPI Driver Component Driver Organization
has been updated in Chapter 12.
19. Removed traces of .one and .html from the section 13.2
Sample Application.
71
AUTOSAR MCAL R4.0.3 User's Manual
SPI Driver Component Ver.1.0.2
Embedded User's Manual
Publication Date: Rev.1.00, Feb 15, 2017
Published by: Renesas Electronics Corporation

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


AUTOSAR MCAL R4.0.3
User's Manual
R20UT3659EJ0100
Document Outline
- Chapter 1 Introduction
- Chapter 2 Reference Documents
- Chapter 3 Integration And Build Process
- Chapter 4 Forethoughts
- Chapter 5 Architecture Details
- Chapter 6 Registers Details
- Chapter 7 Interaction Between The User And SPI Driver Component
- Chapter 8 SPI Driver Component Header And Source File Description
- Chapter 9 Generation Tool Guide
- Chapter 10 Application Programming Interface
- 10.1. Imported Types
- 10.2. Type Definitions
- 10.2.1. Spi_ConfigType
- 10.2.2. Spi_StatusType
- 10.2.3. Spi_JobResultType
- 10.2.4. Spi_SeqResultType
- 10.2.5. Spi_DataType
- 10.2.6. Spi_NumberOfDataType
- 10.2.7. Spi_ChannelType
- 10.2.8. Spi_JobType
- 10.2.9. Spi_SequenceType
- 10.2.10. Spi_HWUnitType
- 10.2.11. Spi_AsyncModeType
- 10.2.12. Spi_CommErrorType
- 10.2.13. Spi_HWErrorsType
- 10.2.14. Spi_SelfTestType
- 10.2.15. Spi_ReturnStatus
- 10.3. Function Definitions
- Chapter 11 Development And Production Errors
- Chapter 12 Memory Organization
- Chapter 13 P1x-C Specific Information
- Chapter 14 Release Details
4 - R20UT3660EJ0100-AUTOSAR
5 - R20UT3660EJ0100-AUTOSAR_ind
Page 1
Page 2
Page 3
Page 4
Page 5
Page 6
Page 7
Page 8
Page 9
Page 10
Page 11
Page 12
Page 13
Page 14
Page 15
Page 16
Page 17
Page 18
Page 19
Page 20
Page 21
Page 22
Page 23
Page 24
Page 25
Page 26
Page 27
Page 28
Page 29
Page 30
Page 31
Page 32
Page 33
Page 34
Page 35
Page 36
Page 37
Page 38
Page 39
Page 40
Page 41
Page 42
Page 43
Page 44
Page 45
Page 46
Page 47
Page 48
Page 49
Page 50
Page 51
Page 52
Page 53
Page 54
Page 55
Page 56
Page 57
Page 58
Page 59
Page 60
Page 61
Page 62
6 - R20UT3660EJ0100-AUTOSARs



AUTOSAR MCAL R4.0.3
User's Manual
SPI Driver Component Ver.1.0.2
Generation Tool User's Manual
Target Device:
RH850/P1x-C
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.00 Jan 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
Rx
Receive
SPI
Serial Peripheral Interface
Tx
Transmit
XML
eXtensible Mark-up Language
ARXML
AutosaR 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 MCAL Code Generator Tool. It is generated by
File
ECU Configuration Editor.
Sl.No
Serial Number.
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 Code Generation Overview ........................................... 13
Chapter 4 Input Files ....................................................................... 17
Chapter 5 Output Files .................................................................... 17
Chapter 6 Precautions .................................................................... 19
Chapter 7 User Configuration Validation ....................................... 21
Chapter 8 Configuration Overview ................................................ 23
8.1. Container Overview ................................................................................................................. 23
8.1.1 Pre-Compile Configurable Parameters ....................................................................... 23
8.1.2 Post Build Time Configurable Parameters .................................................................. 31
Chapter 9 Messages ....................................................................... 41
9.1
Error Messages .................................................................................................................. 41
9.2
Warning Messages ............................................................................................................. 56
9.3
Information Messages ....................................................................................................... 56
7
List of Figures
Figure 3-1
Overview of Code Generation ............................................................................................ 13
Figure 3-2
Overview of Code Generation ........................................................................................... 14
Figure 8-1
Configuration overview ...................................................................................................... 23
List of Tables
Table 1-1
Document Overview ................................................................................................................ 9
Table 2-1
Reference Documents ........................................................................................................... 11
Table 5-1
Output Files Description ........................................................................................................ 17
Table 8-1
Pre-Compile Configurable Parameters .................................................................................. 23
Table 8-2
Post-Build-Time Configurable Parameters ............................................................................ 31
Table 9-1
Mandatory Parameters .......................................................................................................... 41
Table 9-2
Naming Parameters ............................................................................................................... 45
Table 9-3
Parameter values related to INF0_59_83_002...................................................................... 57
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 MCAL Code Generator Tool to achieve scalability and configurability.
The document describes the SPI module specific inputs and outputs of the
MCAL Code Generator Tool that is the common code generator engine used
for the generation of the configuration code for all MCAL modules. MCAL
Code Generator 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).
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 (Code Generation
Provides the Code Generation Overview.
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 MCAL Code
Generator 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 MCAL Code
Validation)
Generator Tool.
Section 8 (Configuration
Provides Container Overview.
Overview)
Section 9 (Messages)
Describes all the Error/Warning/Information messages of R4.0.3 which
helps the user to understand the probable reason for the same.
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.
AUTOSAR_SWS_SPIHandlerDriver.pdf
3.2.0
2.
MCAL_CodeGenerator_Tool_UserManual.pdf
1.7
3.
R20UT3828EJ0100-AUTOSAR.pdf
1.0.2
2.2.
Trademark Notice
Microsoft and Windows are trademarks/registered trademarks of Microsoft
Corporation.
11
Chapter 2 Reference
12
Code Generation Overview
Chapter 3
Chapter 3 Code Generation Overview
Code Generation overview is shown below.
ECU Configuration
Description
File
Spi_Cfg.h,
and BSWMDT File
Spi_Cbk.h,
MCAL
Spi_Hardware.h,
Generator
Spi_PBcfg.c,
Velocity
template
Spi_Lcfg.c,
files for SPI
Spi_Hardware.c
Configuration XML
File
Figure 3-1 Overview of Code Generation
ECU Configuration Description File (.arxml):
This file will contain SPI Driver specific configuration information.
This file should be generated by AUTOSAR specified Configuration
Editor.
BSWMDT File (.arxml):
MCAL Code Generator 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.
Velocity template files:
Spi_Lcfg_c.vm, Spi_PBcfg_c.vm, Spi_Cfg_h_vm, Spi_Cbk_h_vm,
Spi_Hardware_c.vm, Spi_Hardware_h_vm, Spi_Validate.vm and
CommonHelper.vm
They are interpreted by the MCAL Code Generator Tool in order to
provide user input validation and generate the final output file
needed by the AUTOSAR configuration chain .They are the "logic"
of the Code Generator.
Configuration XML File (.xml):
This file is used to specify which velocity template to use and their
location and the name of the output file generated.
For the error free input file, the MCAL Code Generator Tool generates the
following output files:
Spi_Lcfg.c, Spi_PBcfg.c, Spi_Cfg.h, Spi_Cbk.h, Spi_Hardware.c, and
Spi_Hardware.h. If there are incorrect values or incorrect dependencies, the
MCAL Code Generator Tool will display error, warning and information
messages. In case of errors, the MCAL Code Generator Tool will abort the
execution.
ECU Configuration Description File can be created or edited using ECU
Configuration Editor.
13
Chapter 3 Code Generation Overview
Concept of execution for MCAL Code Generator Tool
is as follows:
Generation start
Common
Validate.vm
Helper.vm
config.xml
ECU Configuration
Description Files
MCAL Code Generator
Template files (.vm)
And BSWMDT file
Tool
(.arxml)
No
Yes
Validation
successful
Display Error
Generate Output Files
Generation stop
Figure 3-2 Flow-Diagram of Code Generation
The module “Validate” will validate the configuration (contents of ECU
Configuration Description File(s) as input). If there are incorrect values or
incorrect dependencies, the MCAL Code Generator Tool will display error,
warning and information messages. In case of errors, the MCAL Code
Generator Tool will abort the execution.
Spi_Cbk_h_vm / Spi_Cfg_h.vm / Spi_PBcfg_c.vm / Spi_Lcfg_c.vm will
generate compiler switch / structures necessary to the AUTOSAR
Configuration chain and vendor specific parameters.
14
Code Generation Overview
Chapter 3
Spi_Hardware_h.vm / Spi_Hardware_c.vm will generate hardware related
info (defines number of actual instances / channels used / structure to
access to the I/O mapped peripheral).
Remark
Please consult the general MCAL Code Generator Tool User Manual
(MCAL_CodeGenerator_Tool_UserManual.pdf) and R20UT3828EJ0100-
AUTOSAR.pdf for details about the MCAL Code Generator Tool command line
options.
15
Chapter 3 Code Generation Overview
16
Input Files
Chapter 4
Chapter 4 Input Files
MCAL Code Generator Tool will accept the config.xml file which has paths
to the Velocity template files for generating Spi Driver files. MCAL Code
Generator Tool accepts ECU Configuration Description File(s) and
BSWMDT File as input. MCAL Code Generator Tool needs information
about SPI Driver module. Hence ECU Configuration Description File
should contain configuration of SPI Driver module. MCAL Code Generator
Tool ignores any other AUTOSAR component configured in the ECU
Configuration Description File. ECU Configuration Description File can be
generated using configuration editor.
ECU Configuration Description File must comply with AUTOSAR standard
ECU Configuration Description File format
Remark The detailed explanation about the parameters and containers are found in
Parameter Definition File.
17
Chapter 4
Input Files
18
Output Files
Chapter 5
Chapter 5 Output Files
MCAL Code Generator Tool generates configuration details in C Header and C
Source files (Spi_Lcfg.c, Spi_PBcfg.c, Spi_Cbk.h, Spi_Cfg.h Spi_Hardware.h
and Spi_Hardware.c).
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. It contains the macro
definitions for development error detects, version info API, Instance ID, Pre-compile
option for enable or disable inter-module dependencies, Interruptible SpiSequence
handling functionality, etc. This file also contains SPI interrupt switches for each job
and DMA interrupt switches.
Spi_Cbk.h
This file contains callback function prototype declarations to be used by application.It
contains macro definition for AUTOSAR specification version information and File
version information.
Spi_PBcfg.c
This file contains post-build time parameters. It provides the information of structures
Spi_GstChannelConfig0,
Spi_GaaChannelList0,
Spi_GstDmaUnitConfig0,
Spi_GstConfiguration.It also contains the configuration details for all configured jobs.
Spi_Lcfg.c
This file contains structures of link time parameters. It provides information about
hardware unit.
Spi_Hardware.h
This file contains the definitions for addresses of the hardware registers used in the
Spi Driver Module.
Spi_Hardware.c
This file contains the declarations for addresses of the hardware registers used in the
Spi Driver Module.
Remark Output files generated by MCAL Code Generator Tool should not be modified
or edited manually.
19
Chapter 5
Output Files
20
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.
• Configuration XML File should contain the file extension ‘.xml’.
• Configuration XML File: config.xml file should convey velocity template file
location and output file location.
• 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 MCAL Code Generator 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 MCAL Code
Generator Tool. Otherwise MCAL Code Generator 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 (R20UT3659EJ0100-
AUTOSAR.pdf) for deviations from AUTOSAR.
21
Chapter 6
Precautions
22
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 MCAL Code Generator 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 9
“Messages”.
The MCAL Code Generator 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.
<message_type>_<vendor_id>_<module_id>_<message_id>:<message_
content>.
where,
<message_type> : ERR/WARNING/INFO
< vendor_id > : vendor Id = 59
< module_id >: 83 - SPI Driver Module id (83) for user
configuration checks.
< Message_id.> : 001-999
<message_content>: Message content provides information
about error or warning or information displayed when the user
has configured incorrect inputs.
File Name’ and ‘Path’ need not be present for all
Error/Warning/Information messages
File Name: Name of the file in which the error has occurred
Path: Absolute path of the container in which the parameter is
present
23
Chapter 7
User Configuration Validation
24
Configuration Overview
Chapter 8
Chapter 8 Configuration Overview
8.1. Container Overview
The following figure represents container overview.
Spi
SPI Published Information
SPI General
SPI Csih0
SPI Csih1
SPI Csih2
SPI Csih3
SPI Driver
SPI Sequence
SPI Channel
SPI Memory Mode
SPI Job
SPI External Driver
SpiDma
SPI DemEvent Parameter Refs
Figure 8-1 Configuration overview
8.1.1 Pre-Compile Configurable Parameters
Table 8-1 Pre-Compile Configurable Parameters
Container
Parameter Name
Parameter
Parameter
Parameter
Name
Type
Range
Description
SpiGeneral
SpiCancelApi
Boolean
TRUE / FALSE
Switches the
Spi_Cancel
function ON or
OFF.
SpiChannelBuffersAll
Integer
0/1/2
Selects the SPI
owed
Handler/Driver
Channel Buffers
usage allowed
and delivered.
SpiDevErrorDetect
Boolean
TRUE / FALSE
Switches the
Development
Error Detection
and Notification
ON or OFF
25
Chapter 8
Configuration Overview
Container
Parameter Name
Parameter
Parameter
Parameter
Name
Type
Range
Description
SpiHwStatusApii
Boolean
TRUE / FALSE
Switches the
Spi_GetHWUnitSt
atus function ON
or OFF.
SpiInterruptibleSeqAll
Boolean
TRUE / FALSE
Switches the
owed
Interruptible
Sequences
handling
functionality ON
or OFF.
SpiLevelDelivered
Integer
0/1/2
Selects the SPI
Handler/Driver
level of scalable
functionality that
is available and
delivered.
SpiSupportConcurren
Boolean
TRUE / FALSE
Specifies whether
tSyncTransmit
concurrent
Spi_SyncTransmi
t() calls for
different
sequences shall
be configurable.
SpiVersionInfoApi
Boolean
TRUE / FALSE
Switches the
Spi_GetVersionIn
fo function ON or
OFF.
SpiDmaMode
Boolean
TRUE / FALSE
This parameter
switches the
Spi_DmaMode
ON or OFF.
SpiDeviceName
Enumeration
R7F701370A
This
parameter
R7F701371
contains
the
supported device
R7F701372
name
R7F701373
R7F701374
SpiDmaTypeUsed
Enumeration
SPI_DMA_TYP
This parameter is
E_TWO
used to
differentiate the
DMA type used.
SpiDataConsistencyC
Boolean
TRUE / FALSE
This parameter
heckEnable
enables/disables
Data Consistency
check
26
Configuration Overview
Chapter 8
Container
Parameter Name
Parameter
Parameter
Parameter
Name
Type
Range
Description
SpiDataWidthSelectio
Enumeration
BITS_8/
The value of the
n
BITS_16/
parameter is the
BITS_32
maximum data
width selected.
SpiCriticalSectionProt
Boolean
TRUE / FALSE
This parameter
ection
specifies if the
SPI driver CPU
load can be
reduced by
disabling the
enter/exit critical
section
functionality by
adding a
precompiled
configuration
parameter to the
SPI driver
configuration.
SpiVersionCheckExte
Boolean
TRUE / FALSE
Enable / disable
rnalModules
AUTOSAR
Version check for
inter-module
dependencies
SpiHighPriorityHwHa
Boolean
TRUE / FALSE
Enable / disable
ndlingEnable
the Spi H/W
priority.
SpiAlreadyInitDetChe
Boolean
TRUE / FALSE
This parameter
ck
enables / disables
the
SPI_E_ALREAD
Y_INITIALIZED
Det check in
Spi_Init API.
SpiSeqStartNotificatio
Boolean
TRUE / FALSE
This parameter
nEnable
enables / disables
the
SPI_E_ALREAD
Y_INITIALIZED
Det check in
Spi_Init API.
SpiSyncSeqEndNotifi
Boolean
TRUE / FALSE
This parameter
cationEnable
enables / disables
the check for the
names configured
for synchronous
transmissions in
SpiSeqEndNotific
ation
SpiPersistentHWConf
Boolean
TRUE / FALSE
This parameter
iguration
enables / disables
the check when
HW configuration
is static or
dynamic HW.
SpiMaxBaudrate
Enumeration
PCLK_DIV_BY_
This parameter is
8
used to
27
Chapter 8
Configuration Overview
Container
Parameter Name
Parameter
Parameter
Parameter
Name
Type
Range
Description
differentiate the
maximum baud
rate between the
variants
SpiTimeOut
Integer
0-65535
This parameter
contains timeout
value for updating
the status
registers of CSIH
(CSIHnSTR0)
during data
transmission.
SpiInternalErrorBuffer
Integer
0-100
This parameter is
Size
the maximum
array size of the
Error Buffer used
for the internal
Diagnosis.
SpiLoopBackSelfTest
Enumeration
LoopBack_None This parameter is
used to select if
LoopBack_Init
the Loop back
LoopBack_Init_
self-test
RunTime
functionality to be
done only during
initialization or
during init and
Run time or not
required to be
performed
SpiECCSelfTest
Enumeration
ECC_None
This parameter is
used to select if
ECC_Init
the ECC self-test
ECC_Init_RunTi
functionality to be
me
done only during
initialization or
during init and
Run time or not
required to be
performed
SpiInterruptConsisten
Boolean
TRUE / FALSE
This parameter
cyCheck
shall
enable/disable
the
Interrupt
consistency
check
functionality
SpiCSIHWriteVerify
Enumeration
WV_DISABLE
This parameter
shall
WV_INIT_ONLY
enable/disable
WV_INIT_RUNT
the write-verify
IME
check
functionality.
28
Configuration Overview
Chapter 8
Container
Parameter Name
Parameter
Parameter
Parameter
Name
Type
Range
Description
SpiDMAWriteVerify
Enumeration
WV_DISABLE
This parameter
shall
WV_INIT_ONLY
enable/disable
WV_INIT_RUNT
the write-verify
IME
check
functionality for
DMA
Spi_UseWriteVerifyEr
Boolean
TRUE / FALSE
This parameter
rorInterface
shall
enable/disable
the error
SpiWriteVerifyErrorInt
Symbolic
NA
This parameter is
notification
erface
Name
used to configure
interface instead
the name of the
of DEM error for
error notification
Write-Verify
function which
functionality
shall be called
with the ApiID
and ErrorId when
there is a Write
Verify error when
Spi_UseWriteVeri
fyErrorInterface is
configured as
True.
SpiChannel
SpiChannelId
Integer
0-255
This parameter
contains Channel
ID of the SPI
channel. This
value will be
assigned to the
symbolic name
derived of the
SpiChannel
container short
name.
SpiChannelType
Enumeration
EB/IB
This parameter
contains the
buffer usage with
EB/IB channel.
SpiEbMaxLength
Integer
0-65535
This parameter
contains the
maximum size (in
bytes) of data
buffers in case of
EB Channels.
SpiIbNBuffers
Integer
0-65535
This parameter
contains the
maximum number
of data buffers in
case of IB
Channels.
SpiDemEve
SPI_E_HARDWARE_
Symbolic
NA
Reference to the
ntParamete
ERROR
Name
DemEventParam
rRefs
eter which shall
be issued when a
hardware error
was detected. If
29
Chapter 8
Configuration Overview
Container
Parameter Name
Parameter
Parameter
Parameter
Name
Type
Range
Description
the reference is
not configured the
error shall not be
reported.
SPI_E_DATA_TX_TI
Symbolic
NA
Reference to the
MEOUT_FAILURE
Name
DemEventParam
eter which shall
be issued when a
hardware data
transmit timeout
error was
detected. If the
reference is not
configured the
error shall not be
reported.
SPI_E_LOOPBACK_
Symbolic
NA
Reference to the
SELFTEST_FAILUR
Name
DemEventParam
E
eter which shall
be issued when
loop back self-
test error was
detected.
SPI_E_ECC_SELFT
Symbolic
NA
Reference to the
EST_FAILURE
Name
DemEventParam
eter which shall
be issued when
Ecc selft test
error was
detected.
SPI_E_INT_INCONSI
Symbolic
NA
Reference to the
STENT
Name
DemEventParam
eter which shall
be issued when
Interrupt
consistency error
was detected.
SPI_E_REG_WRITE
Symbolic
NA
Reference to the
_VERIFY
Name
DemEventParam
eter which shall
be issued when
register write
error was
detected.
SpiExternal
SpiCsIdentifier
string
-
This parameter is
Device
the symbolic
name to identify
the Chip Select
(CS) allocated to
this Job. This
parameter is not
used for
implementation.
30
Configuration Overview
Chapter 8
Container
Parameter Name
Parameter
Parameter
Parameter
Name
Type
Range
Description
SpiHwUnit
Enumeration
CSIH0/ CSIH1/
This parameter is
CSIH2/ CSIH3
the symbolic
name to identify
the HW SPI
Hardware
microcontroller
peripheral
allocated to this
Job.
8.1.2 Post Build Time Configurable Parameters
Table 8-2 Post-Build-Time Configurable Parameters
Container
Parameter
Parameter Type
Paramet
Parameter
Name
Name
er Range
Description
SpiChannel
SpiDataWidth
Integer
2-32
This parameter is the
width of a transmitted
data unit.
If data width is greater
than 16bit, then
CSIHnCTL1.CSIHnED
LE bit is set to enable
Extended Data
Length.
SpiDefaultDat
Integer
0-
The default data to be
a
429496729
transmitted when (for
5
internal buffer or
external buffer) the
pointer passed to
Spi_WriteIB (for
internal buffer) or to
Spi_SetupEB (for
external buffer) is
NULL.
SpiTransferSt
Enumeration
LSB/MSB
This parameter
art
defines the first
starting bit for
transmission.
SpiExternalD
SpiBaudrate
Float
0
This parameter is the
evice
communication baud
rate. This parameter is
not used for
implementation, set
SpiBaudrateConfigura
tion instead.
SpiBaudrateC
Integer
1-4095
This parameter
onfiguration
contains Baud Rate
Selection Bits.
SpiCsPolarity
Enumeration
HIGH/LOW
This parameter
defines the active
polarity of Chip Select.
31
Chapter 8
Configuration Overview
Container
Parameter
Parameter Type
Paramet
Parameter
Name
Name
er Range
Description
SpiCsSelectio
Enumeration
CS_VIA_P
When the Chip select
n
ERIPHERA
handling is enabled
L_ENGINE
(see SpiEnableCs),
/
then this parameter
CS_VIA_G
specifies if the chip
PIO
select is handled
automatically by
Peripheral HW engine
or via general purpose
IO by Spi driver.
SpiDataShiftE
Enumeration
LEADING/
This parameter
dge
TRAILING
defines the SPI data
shift edge.
SpiEnableCs
Boolean
TRUE /
This parameter
FALSE
enables or disables
the Chip Select
handling functions.
SpiShiftClockI
Enumeration
HIGH/LOW
This parameter
dlelevel
defines the SPI shift
clock idle level.
SpiTimeClk2C
Float
0
Timing between clock
s
and chip select - This
parameter allows to
use a range of values
from 0 up to 100
microseconds. This
parameter is not used
for implementation,
set SpiClk2CsCount
instead.
SpiClk2CsCou
Integer
0-100
Loop Count between
nt
clock and chip select -
This parameter allows
to use a range of
values from 0 to 100
counts
SpiCsInactive
Boolean
TRUE /
This parameter
AfterLastData
FALSE
enables or disables
the Chip Select to
Return to Inactive
functions.
32
Configuration Overview
Chapter 8
Container
Parameter
Parameter Type
Paramet
Parameter
Name
Name
er Range
Description
SpiCsIdleEnfo
Boolean
TRUE /
This parameter
rcement
FALSE
enables or disables
Chip Select Idle
Enforcement
configuration.
SpiCsIdleTimi
Enumeration
IDLE_TIME
This parameter
ng
_0_POINT
specifies Idle Timing.
_5/
IDLE_TIME
_1/
IDLE_TIME
_1_POINT
_5/
IDLE_TIME
_2_POINT
_5/
IDLE_TIME
_3_POINT
_5/
IDLE_TIME
_4_POINT
_5/
IDLE_TIME
_6_POINT
_5/
IDLE_TIME
_8_POINT
_5
33
Chapter 8
Configuration Overview
Container
Parameter
Parameter Type
Parameter
Parameter
Name
Name
Range
Description
SpiCsHoldTim
Enumeration
HOLD
This parameter
ing
_TIME_0_POI
specifies Hold
NT_5/ HOLD
Timing.
_TIME_1/
HOLD
_TIME_1_POI
NT_5/ HOLD
_TIME_2_POI
NT_5/ HOLD
_TIME_3_POI
NT_5/ HOLD
_TIME_4_POI
NT_5/ HOLD
_TIME_6_POI
NT_5/ HOLD
_TIME_8_POI
NT_5/ HOLD
_TIME_9_POI
NT_5/ HOLD
_TIME_10_P
OINT_5/
HOLD_TIME_
11_POINT_5/
HOLD_TIME_
12_POINT_5/
HOLD_TIME_
14_POINT_5/
HOLD_TIME_
16_POINT_5/
HOLD_TIME_
18_POINT_5/
HOLD_TIME_
20_POINT_5
34
Configuration Overview
Chapter 8
Container
Parameter
Parameter Type
Parameter
Parameter
Name
Name
Range
Description
SpiCsHoldTim
Enumeration
HOLD
This parameter
ing
_TIME_0_POI
specifies Hold
NT_5/ HOLD
Timing.
_TIME_1/
HOLD
_TIME_1_POI
NT_5/ HOLD
_TIME_2_POI
NT_5/ HOLD
_TIME_3_POI
NT_5/ HOLD
_TIME_4_POI
NT_5/ HOLD
_TIME_6_POI
NT_5/ HOLD
_TIME_8_POI
NT_5/ HOLD
_TIME_9_POI
NT_5/ HOLD
_TIME_10_P
OINT_5/
HOLD_TIME_
11_POINT_5/
HOLD_TIME_
12_POINT_5/
HOLD_TIME_
14_POINT_5/
HOLD_TIME_
16_POINT_5/
HOLD_TIME_
18_POINT_5/
HOLD_TIME_
20_POINT_5
35
Chapter 8
Configuration Overview
Container
Parameter
Parameter
Parameter
Parameter
Name
Name
Type
Range
Description
SpiCsInterData
Enumeration
INTER_DATA_
This parameter specifies
Delay
TIME_0/
Inter-data Delay Timing.
INTER_DATA_
TIME_0_POIN
T_5/
INTER_DATA_
TIME_1/
INTER_DATA_
TIME_2/
INTER_DATA_
TIME_3/
INTER_DATA_
TIME_4/
INTER_DATA_
TIME_6/
INTER_DATA_
TIME_8/
INTER_DATA_
TIME_9/
INTER_DATA_
TIME_10/
INTER_DATA_
TIME_11/
INTER_DATA_
TIME_12/
INTER_DATA_
TIME_14/
INTER_DATA_
TIME_16/
INTER_DATA_
TIME_18/
INTER_DATA_
TIME_20
36
Configuration Overview
Chapter 8
Container
Parameter
Parameter
Parameter
Parameter
Name
Name
Type
Range
Description
SpiCsSetupTim
Enumeration
SETUP_TIME_
This parameter specifies
e
0_POINT_5/
Setup Timing.
SETUP_TIME_
1/
SETUP_TIME_
1_POINT_5/
SETUP_TIME_
2_POINT_5/
SETUP_TIME_
3_POINT_5/
SETUP_TIME_
4_POINT_5/
SETUP_TIME_
6_POINT_5/
SETUP_TIME_
8_POINT_5/
SETUP_TIME_
9_POINT_5/
SETUP_TIME_
10_POINT_5/
SETUP_TIME_
11_POINT_5/
SETUP_TIME_
12_POINT_5/
SETUP_TIME_
14_POINT_5/
SETUP_TIME_
16_POINT_5/
SETUP_TIME_
18_POINT_5/
SETUP_TIME_
20_POINT_5
SpiInputClockSe
Enumeration
PCLK/
This parameter contains
lect
PCLK_DIVBY_
the Prescaler Section
2/
Bits.
PCLK_DIVBY_
4/
PCLK_DIVBY_
8/
PCLK_DIVBY_
16/
PCLK_DIVBY_
32/
PCLK_DIVBY_
64
37
Chapter 8
Configuration Overview
Container
Parameter
Parameter
Parameter
Parameter
Name
Name
Type
Range
Description
SpiBaudrateReg
Enumeration
CSIH_BAUDR
This parameter contains
isterSelect
ATE_REGISTE
the Prescaler Selection
R_0/
CSIH_BAUDR
ATE_REGISTE
R_1/
CSIH_BAUDR
ATE_REGISTE
R_2/
CSIH_BAUDR
ATE_REGISTE
R_3
SpiInterruptDela
Boolean
TRUE / FALSE
This parameter enables
yMode
delay for all interrupts.
SpiParitySelecti
Enumeration
NO_PARITY/
This parameter defines
on
PARITY_AT_Z
the Parity selection.
ERO/
ODD_PARITY/
EVEN_PARITY
SpiBroadcasting
Integer
DOMINANT/
This parameter gives the
Priority
RECESSIVE
timeout setting selection
in FIFO mode
SpiClockFreque
Reference
-
This parameter contains
ncyRef
Assignment of the MCU
frequency for a job.
SpiSequenc
SpiInterruptibleS
Boolean
TRUE / FALSE
This parameter allows or
e
equence
denies this Sequence to
be suspended by
another one.
SpiSeqStartNotif
Function
NA
This parameter is a
ication
name
reference to a start
notification function.
SpiHighPriorityH
Boolean
TRUE / FALSE
Enable/Disable the high
wSequence
priority H/W handling
SpiSeqEndNotifi
Function
NA
This parameter is a
cation
Name
reference to a
notification function.
SpiSequenceId
Integer
0-255
This parameter specifies
sequence ID of the SPI
sequence. This value
will be assigned to the
symbolic name derived
of the SpiSequence
container short name.
SpiJobAssignme
Reference
NA
A sequence references
nt
several jobs, which are
executed during a
communication
sequence.
SpiChannelInde
Integer
0-255
This parameter specifies
x
the order of Channels
within the Job.
38
Configuration Overview
Chapter 8
Container
Parameter
Parameter
Parameter
Parameter
Name
Name
Type
Range
Description
SpiChannel
SpiChannelAssi
Reference
NA
A job reference to a SPI
List
gnment
channel.
SpiHwUnitSelect
Enumeration
CSIH0/ CSIH1/
This parameter is used
ion
CSIH2/ CSIH3
to select CSIH HW unit
SpiMemory
SpiMemoryMod
Enumeration
TX_ONLY_MO
This parameter defines
Mode
eSelection
DE/
the Memory Mode
DIRECT_ACC
Selection.
ESS_MODE/
DUAL_BUFFE
R_MODE/
FIFO_MODE
SpiTxDmaChan
Enumeration
DMA0/ DMA1/
This parameter is the
nel
DMA2/ DMA3/
symbolic name to
DMA4/ DMA5/
identify the Tx DMA
DMA6/ DMA7/
allocated to Job.
DMA8/ DMA9/
DMA10/
DMA11/
DMA12/
DMA13/
DMA14/
DMA15
SpiDma
SpiRxDmaChan
Enumeration
DMA0/ DMA1/
This parameter is the
nel
DMA2/ DMA3/
symbolic name to
DMA4/ DMA5/
identify the Rx DMA
DMA6/ DMA7/
allocated to Job.
DMA8/ DMA9/
DMA10/
DMA11/
DMA12/
DMA13/
DMA14/
DMA15
SpiDmaHwUnit
Enumeration
CSIH1_TXID_8
This parameter is the
2_RXID_81/
symbolic name to
CSIH0_TXID_7
identify the hardware
9_RXID_78/
unit.
CSIH2_TXID_8
5_RXID_84/
CSIH3_TXID_8
8_RXID_87
SpiMaxHwUnit
Integer
4
Number of different SPI
hardware
microcontroller
peripherals
(units/busses) available
and handled by this SPI
Handler/Driver module.
39
Chapter 8
Configuration Overview
Container
Parameter
Parameter
Parameter
Parameter
Name
Name
Type
Range
Description
SpiPublishe
SpiMaxHwUnit
integer
4
Number of different SPI
dInformatio
hardware microcontroller
n
peripherals
(units/busses) available
and handled by this SPI
Handler/Driver module.
40
Messages
Chapter 9
Chapter 9 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 MCAL Code Generator Tool.
9.1 Error Messages
ERR_59_83_001: Parsing of Spi module is incorrect. This error occurs, if the
parsing of configuration file is not done correctly.
ERR_59_83_002: 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.
ERR_59_83_004: 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.
Table 9-1 Mandatory Parameters
Parameter Name
Container Name
SpiCancelApi
SpiChannelBuffersAllowed
SpiDevErrorDetect
SpiHwStatusApi
SpiInterruptibleSeqAllowed
SpiGeneral
SpiLevelDelivered
SpiSupportConcurrentSyncTransmit
SpiVersionInfoApi
SpiDmaMode
SpiDataConsistencyCheckEnable
SpiDataWidthSelection
SpiMaxBaudrate
SpiSyncSeqEndNotificationEnable
SpiPersistentHWConfiguration
SpiDmaTypeUsed
SpiHighPriorityHwHandlingEnable
SpiCriticalSectionProtection
SpiDeviceName
41
Chapter 9
Messages
Parameter Name
Container Name
SpiAlreadyInitDetCheck
SpiVersionCheckExternalModules
SpiSeqStartNotificationEnable
SpiTimeOut
SpiLoopBackSelfTest
SpiECCSelfTest
SpiInterruptConsistencyCheck
SpiWriteVerify
SpiDmaWriteVerify
SpiMaxChannel
SpiMaxJob
SpiDriver
SpiMaxSequence
SpiChannelId
SpiChannelType
SpiDataWidth
SpiChannel
SpiEbMaxLength
SpiIbNBuffers
SpiTransferStart
SpiBaudrate
SpiCsPolarity
SpiDataShiftEdge
SpiShiftClockIdleLevel
SpiCsIdentifier
SpiEnableCs
SpiHwUnit
SpiTimeClk2Cs
SpiExternalDevice
SpiClk2CsCount
SpiBaudrateConfiguration
SpiInputClockSelect
SpiInterruptDelayMode
SpiParitySelection
SpiBroadcastingPriority
SpiClockFrequencyRef
SpiJobId
SpiJob
SpiJobPriority
42
Messages
Chapter 9
Parameter Name
Container Name
SpiSeqStartNotification
SpiSequence
SpiDeviceAssignment
SpiInterruptibleSequence
SpiSequenceId
SpiHighPriorityHwSequence
SpiJobAssignment
SpiHwUnitSelection
SpiMemoryMode
SpiMemoryModeSelection
SpiTxDmaChannel
SpiRxDmaChannel
SpiDma
SpiDmaHwUnit
SPI_E_HARDWARE_ERROR
SpiDemEventParameterRefs
SPI_E_DATA_TX_TIMEOUT_FAILURE
SpiChannelIndex
SpiChannelList
SpiChannelAssignment
SpiMaxHwUnit
SpiPublishedInformation
ERR_59_83_006: 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.
ERR_59_83_007: 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.
ERR_59_83_008: 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.
ERR_59_83_009: Minimum one_ SpiDemEventParameterRefs instance is
needed.
This error will occur, if at least one DEM component is not present in the input
ECU Configuration Description File(s).
ERR_59_83_010: Maximum allowed SpiDemEventParameterRefs instance is
one.
This error will occur, if more than one DEM component is present in the input ECU
Configuration Description File(s).
43
Chapter 9
Messages
ERR_59_83_011: References SPI_E_DATA_TX_TIMEOUT_FAILURE is not
configured in <Spi/ SpiDriver/SpiDemEventParameterRefs>.
This error occurs, if the parameter SPI_E_DATA_TX_TIMEOUT_FAILURE not
configured.
ERR_59_83_012: References path of Parameter
SPI_E_DATA_TX_TIMEOUT_FAILURE is not correct in <Spi/
SpiDriver/SpiDemEventParameterRefs>.
This error occurs, if incorrect reference provided for the reference parameter
(‘SPI_E_DATA_TX_TIMEOUT_FAILURE’).
ERR_59_83_013: References SPI_E_HARDWARE_ERROR is not configured
in <Spi/ SpiDriver/SpiDemEventParameterRefs>.
This error occurs, if the parameter SPI_E_HARDWARE_ERROR not configured.
ERR_59_83_014: Reference path of Parameter SPI_E_HARDWARE_ERROR
is not correct in <Spi/ SpiDriver/SpiDemEventParameterRefs>.
This error occurs, if incorrect reference provided for the reference parameter
(‘SPI_E_HARDWARE_ERROR).
ERR_59_83_015: References SpiChannelAssignment is not configured in
<Spi/ SpiDriver/SpiExternalDevice/SpiJob/ SpiChannelList>.
This error occurs, if the parameter SpiChannelAssignment not configured.
ERR_59_83_016: References path of Parameter SpiChannelAssignment is
not correct in <Spi/ SpiDriver/SpiExternalDevice/SpiJob/ SpiChannelList>.
This error occurs, if incorrect reference provided for the reference parameter
(‘SpiChannelAssignment).
ERR_59_83_017: References SpiDeviceAssignment is not configured in
<Spi/ SpiDriver/SpiExternalDevice/SpiJob>.
This error occurs, if the parameter SpiDeviceAssignment not configured.
ERR_59_83_018: References path of Parameter SpiDeviceAssignment is not
correct in <Spi/ SpiDriver/SpiExternalDevice/SpiJob>.
This error occurs, if incorrect reference provided for the reference parameter
(‘SpiDeviceAssignment).
ERR_59_83_019: Parameter <Parameter> is not configured in <Spi/
SpiDriver/SpiExternalDevice/SpiJob>.
This error occurs, if any parameter in job container are not configured.
ERR_59_83_020: References SpiJobAssignment is not configured in <Spi/
SpiDriver/ SpiSequence >.
This error occurs, if the parameter SpiJobAssignment not configured.
ERR_59_83_021: 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
44
Messages
Chapter 9
ERR_59_83_022: 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 with same sequence)
should be same.
ERR_59_83_024: 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 9-2 Naming Parameters
Parameter Name
Container Name
SpiJobEndNotification
SpiJob
SpiSeqEndNotification
SpiSequence
ERR_59_83_026: 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.
ERR_59_83_028: The short name of the container ‘SpiJob’ should be same for
job having same 'SpiJobId' <value for SpiJobId> across 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.
ERR_59_83_030: Maximum allowed SpiCsih0 instance is one.
This error occurs, if multiple instance of SpiCsih0 is configured in
SpiPublishedInformation.
ERR_59_83_031: Parameter <SpiChannelId> is not configured in sequential in
<Spi/SpiDriver/ SpiChannel>.
This error occurs, if the value for parameter SpiChannelId present in the container
SpiChannel is not starting with zero and also not sequential or with gaps for any given
configuration set.
ERR_59_83_032: SpiChannelBuffersAllowed in the container SpiGeneral is
configured as 1 and the parameter SpiChannelType in any of the container
SpiChannel is not configured as EB in SpiDriver.
45
Chapter 9
Messages
This error occurs, if SpiChannelBuffersAllowed in the container SpiGeneral is
configured as 1 and the parameter SpiChannelType in the container SpiChannel is not
configured as EB.
ERR_59_83_033: SpiChannelBuffersAllowed in the container SpiGeneral is
configured as 0 and the parameter SpiChannelType in any of the container
SpiChannel is not configured as IB in SpiDriver.
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.
ERR_59_83_034: 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 will occur, 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.
ERR_59_83_035: The SPI channels configured for a specific job should have
same value for the parameter ‘SpiDataWidth’ of container 'SpiChannel’ since the
parameter ‘SpiMemoryModeSelection’ in the container ‘SpiMemoryMode’ is
configured as <value of SpiMemoryModeSelection> within a sequence.
This error will occur, if the value for channels configured for a specific job is not same
for the parameter SpiDataWidth of container SpiChannel when the parameter
SpiMemoryModeSelection in the container SpiMemoryMode is configured as
DUAL_BUFFER_MODE or TX_ONLY_MODE or FIFO_MODE.
ERR_59_83_036: SpiDataWidth configured for a SpiChannel is greater than 8
but SpiDataWidthSelection in SpiGeneral0 is BITS_8.
This error occurs, if the value of the parameter SpiDataWidth in the container
SpiChannel is not in the range of 7 to 8 when the parameter SpiDataWidthSelection in
the container SpiGeneral is configured as BITS_8.
ERR_59_83_037: SpiDataWidth configured for a SpiChannel is greater than 16
but SpiDataWidthSelection in SpiGeneral0 is BITS_16.
This error occurs, if the value of the parameter SpiDataWidth in the container
SpiChannel is not in the range of 7 to 16 when the parameter SpiDataWidthSelection
in the container SpiGeneral is configured as BITS_16.
ERR_59_83_038: Parameter SpiJobId in SpiJob container is not configured in
sequential.
This error occurs, if the value for parameter SpiJobId present in the container SpiJob
is not sequential or with gaps and also not starting with zero for any given
configuration set in the ECU Configuration Description File.
ERR_59_83_039: 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 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 with same sequence)
should be same.
46
Messages
Chapter 9
ERR_59_83_040: Parameter SpiHwUnitSelection in SpiMemoryMode and
SpiMemoryMode$MemoryMode1 are same.
This error occurs, if the value of the parameter SpiHwUnitSelection in the container
SpiMemoryMode is not unique within configuration set container SpiDriver.
ERR_59_83_041: Parameter SpiSequenceId in SpiSequence container is not
configured in sequential.
This error occurs, if the parameter SpiSequenceId is not sequential or with gaps and
also not starting with zero within the container SpiSequence for any of the given
configuration set.
ERR_59_83_042: The value of the parameter SpiMaxChannel present in
container SpiDriver is not equal to total number of channels configured.
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.
ERR_59_83_043: The value of the parameter SpiMaxJob present in container
SpiDriver$DriverCount is not equal to total number of jobs configured.
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.
ERR_59_83_044: The value of the parameter SpiMaxSequence present in
container SpiDriver$DriverCount is not equal to total number of sequence
configured.
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.
ERR_59_83_045: 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.
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.
ERR_59_83_046: The parameter SpiDmaMode present in the container
SpiGeneral is configured as true and no instance of the container SpiDma is
configured in SpiDriver.
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.
ERR_59_83_047: 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.
47
Chapter 9
Messages
ERR_59_83_048: SpiHwUnitSynchronous is configured as SYNCHRONOUS in
the container SpiJob and same HWunit is configured for DMA in SpiDma.
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.
ERR_59_83_049: DMA HW unit configured for the parameter SpiDmaHwUnit in
the container SpiDma is configured with the memory mode of TX_ONLY_MODE
or DUAL_BUFFER_MODE in SpiMemoryMode$MemoryMode.
This error occurs, if DMA HW unit configured for the parameter SpiDmaHwUnit in the
container SpiDma is configured with the memory mode of TX_ONLY_MODE or
DUAL_BUFFER_MODE.
If SpiHighPriorityHwHandlingEnable is configured as true in SpiGeneral container then
the DMA HW unit configured for the parameter SpiDmaHwUnit in the container
SpiDma can be configured with the memory mode of TX_ONLY_MODE.
ERR_59_83_050: SpiHwUnitSynchronous is configured as SYNCHRONOUS in
the container SpiJob but memorymode is DIRECT_ACCESS_MODE in
SpiMemoryMode.
This error occurs, if the value of the parameter SpiMemoryModeSelection in the
container SpiMemoryMode is 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.
ERR_59_83_051: SpiCsSelection is configured as CS_VIA_GPIO in the container
SpiExternalDevice but SpiPortPinSelect is via CSL in SpiJob.
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.
ERR_59_83_052: SpiCsSelection is configured as PERIPHERAL_ENGINE in the
container SpiExternalDevice but SpiPortPinSelect is via GPIO in SpiJob.
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.
ERR_59_83_053: Parameter SpiMemoryModeSelection in container
SpiMemoryMode is configured as DUAL_BUFFER_MODE or TX_ONLY_MODE
but the channel for corresponding HWunit is configured as EB.
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 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.
48
Messages
Chapter 9
ERR_59_83_054: Parameter SpiMemoryModeSelection in container
SpiMemoryMode is configured as DUAL_BUFFER_MODE or TX_ONLY_MODE
but the value of the parameter SpiInterruptibleSequence in the container
SpiSequence is configured as true.
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.
ERR_59_83_055: The value of parameter 'SpiHighPriorityHwSequence' 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.
ERR_59_83_056: SpiMemoryModeSelection for the Spi Hardware unit
<Hardware unit> should be <TX_ONLY_MODE>, since the parameter
'SpiHighPriorityHwSequence' in the SpiSequence container is configured as
<true> for the sequence containing the Job which is assigned to this hardware
unit.
This error 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 MCAL
Code Generator Tool ignores the value configured for the parameter
SpiHighPriorityHwSequence for this sequence.
ERR_59_83_057: The parameter 'SpiHwUnitSynchronous' of Job2 should be
'ASYNCHRONOUS', since the parameter 'SpiHighPriorityHwSequence' in the
SpiSequence container is configured as <true> for Sequence2 which is
assigned with Job2.
This error will occur if value of the parameter SpiHwUnitSynchronous in the container
‘SpiJob’ is configured as ‘Synchronous’ where sequence is
SpiHighPriorityHwSequence.
ERR_59_83_058: Jobs Job0 and Job1 must refer to the same external device
container, since they are referring to the same CS line and the sequences
containing these jobs are configured with 'SpiHighPriorityHwSequence' <true>
For SpiDriver0.
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.
ERR_59_83_059: Parameter 'SpiHighPriorityHwSequence' in the sequence
container of sequence$SeqCount is configured as <false> and
'SpiMemoryModeSelection' is configured as 'TX_ONLY_MODE' but the channel
configured in SpiJob$JobCount is EB. In 'Tx-only mode', only high-priority
sequences can have external buffers.
This error 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 MCAL
49
Chapter 9
Messages
Code Generator Tool ignores the value configured for the parameter
SpiHighPriorityHwSequence for this sequence.
Note: ie, Normal sequences for Tx-only mode should always have internal buffers.
ERR_59_83_060: SpiChannels '<SpiChannelID>' and '<SpiChannelID>' must
have the same Data width and direction (LSB/MSB) , since they are having the
same CS line and linked to <sequence> which is configured with
'SpiHighPriorityHwSequence' <true> For <SpiDriver>.
This error occurs, if the channels of the job is configured with sequence which is
having SpiHighPriorityHwSequence parameter is configured as true should have
same properties of SpiDataWidth and SpiTransferStart.
ERR_59_83_061: The chip select $PortPinSelect in SpiJob$JobCount is not
supported for the Device $DeviceVariant.
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.
ERR_59_83_062: The DMA is configured as true and Data width is not
configured as 16bits.
This error occurs, if the configured value of the parameter SpiDataWidthSelection in
the container SpiGeneral is not equal to 16 and the SpiDmaMode parameter is
configured as true.
ERR_59_83_063: The SpiMemoryMode is not configured.
This error occurs, if no memorymode is configured in configuration xml.
ERR_59_83_064: 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.
ERR_59_83_065: 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 will occur, 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.
ERR_59_83_066: 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 will occur, 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.
50
Messages
Chapter 9
ERR_59_83_067: 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 will occur, 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.
ERR_59_83_068 : 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 will occur, 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 parameter SpiDataWidth in the container
SpiChannel is configured as greater than 16.
ERR_59_83_069: 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, 2 and 3.
ERR_59_83_070: 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 will occur, if the value configured for the parameter SpiDmaHwUnit in the
container SpiDma is not configured in any of the hardware units selected for jobs.
ERR_59_83_071: 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 will occur, if the parameter SpiHwUnit present in the container
SpiExternalDevice is configured as CSIH<m> and any of the parameters
SpiCsIdleEnforcement, SpiCsIdleTiming, SpiCsHoldTiming, SpiCsInterDataDelay and
SpiCsSetupTime is not configured. Here <m> is integer number e.g. 0, 1, 2 and 3.
ERR_59_83_072: The number of SPI sequences configured should be same
across multiple configurations set container ‘SpiDriver’.
This error will occur, if the numbers of SPI sequences configured are not same across
the multiple configurations set container SpiDriver.
ERR_59_83_073: The number of SPI Jobs configured should be same across
the multiple configurations set container ‘SpiDriver’.
This error will occur, if the number of SPI jobs configured is not same across the
multiple configurations set container SpiDriver.
51
Chapter 9
Messages
ERR_59_83_074: The number of 'SpiExternalDevice' configured should be same
across the multiple configurations set container ‘SpiDriver’.
This error will occur, if the number of SpiExternalDevice configured is not same across
the multiple configurations set container SpiDriver.
ERR_59_83_075: The same value should be configured for the parameter
‘SpiHwUnit’ in the container 'SpiExternalDevice' across the multiple
configuration sets.
This error will occur, if the value configured for the parameter SpiHwUnit in the
container SpiExternalDevice is not same across multiple configuration sets.
ERR_59_83_076: The value configured for the parameter
'SpiSeqStartNotification' should follow C Syntax < [a-zA-Z] [a-zA-Z0-9_] >.
This error will occur, 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.
ERR_59_83_077: 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
'SpiSyncSeqEndNotificationEnable' in the 'SpiGeneral' container is configured
as false.
The 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.
ERR_59_83_078: 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 will occur, if the parameter SpiJobEndNotification of the container SpiJob is
not unique for jobs with hardware units of different memory modes.
ERR_59_83_079: 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 will occur, if the value of parameter SpiSeqEndNotification present in the
container SpiSequence is not unique for the sequences having jobs with hardware
units of different memory modes.
ERR_59_83_080: 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 will occur, if the parameter SpiSeqEndNotification in the container
SpiSequence is not same for SPI Sequences (having same Sequence ID) across
multiple configurations set container SpiSequence.
ERR_59_83_081: HW Unit $HwUnit is configured for multiple DMA container.
This error will occure, if multiple DMA container configured same hardware unit.
52
Messages
Chapter 9
ERR_59_83_082: The number of 'SpiDMA' configured should be same across
the multiple configurations set container ‘SpiDriver’.
This error will occur, if the number of SpiDMA configured is not same across the
multiple configurations set container SpiDriver.
ERR_59_83_083: 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.
This error will occur, if the value of parameter SpiSeqEndNotification present in the
container SpiSequence is not unique for the sequences having jobs with hardware
units of different memory modes.
ERR_59_83_084: The parameter 'SpiWriteVerifyErrorInterface' in the
'SpiGeneral' container should be configured when any of the parameters
'SpiCSIHWriteVerify' or 'SpiDMAWriteVerify' are configured as
<WV_INIT_ONLY> or <WV_INIT_RUNTIME>.
This error will occur, if the value of parameter 'Spi_UseWriteVerifyErrorInterface'
present in the general container is not configured when any one or both parameter
'SpiCSIHWriteVerify' and 'SpiDMAWriteVerify' are configured as <WV_INIT_ONLY> or
<WV_INIT_RUNTIME>.
ERR_59_83_085: The parameter 'SpiWriteVerifyErrorInterface' in the
'SpiGeneral' container should be configured when the parameters
'Spi_UseWriteVerifyErrorInterface' is configured as 'true'.
This error will occur, if the value of parameter 'SpiWriteVerifyErrorInterface' present in
the general container is not configured when parameter '' are configured as 'true'.
ERR_59_83_086: References 'SpiClockFrequencyRef' is not configured in
<SpiExternalDevice>
This error will occur, if the value of parameter 'SpiClockFrequencyRef' present in the
SpiExternalDevice container is not configured.
ERR_59_83_087: References path of Parameter 'SpiClockFrequencyRef' is not
correct in <SpiExternalDevice>
This error will occur, if the value of parameter 'SpiClockFrequencyRef' present in the
SpiExternalDevice container is not correct.
ERR_59_83_088: References SPI_E_LOOPBACK_SELFTEST_FAILURE is not
configured in <PATH> when the parameter 'SpiLoopBackSelfTest' is configured
as <LoopBack_Init> or <LoopBack_Init_RunTime> in 'SpiGeneral' container.
This error will occur, if the value of parameter
'SPI_E_LOOPBACK_SELFTEST_FAILURE' present in the
SpiDemEventParameterRefs container is not configured when the parameter in
general container 'SpiLoopBackSelfTest' is configured as <LoopBack_Init> or
<LoopBack_Init_RunTime>.
ERR_59_83_089: References path of Parameter
'SPI_E_LOOPBACK_SELFTEST_FAILURE' is not correct in
<SpiDemEventParameterRefs>
This error will occur, if the value of parameter
'SPI_E_LOOPBACK_SELFTEST_FAILURE' present in the
SpiDemEventParameterRefs container is not correct.
53
Chapter 9
Messages
ERR_59_83_090: References SPI_E_ECC_SELFTEST_FAILURE is not
configured in <PATH> when the parameter 'SpiECCSelfTest' is configured as
<ECC_Init> or <ECC_Init_RunTime> in 'SpiGeneral' container.
This error will occur, if the value of parameter 'SPI_E_ECC_SELFTEST_FAILURE'
present in the SpiDemEventParameterRefs container is not configured when the
parameter in general container 'SpiECCSelfTest' is configured as <ECC_Init> or
<ECC_Init_RunTime>.
ERR_59_83_091: References path of Parameter
'SPI_E_ECC_SELFTEST_FAILURE' is not correct in
<SpiDemEventParameterRefs>
This error will occur, if the value of parameter 'SPI_E_ECC_SELFTEST_FAILURE'
present in the SpiDemEventParameterRefs container is not correct.
ERR_59_83_092: References SPI_E_INT_INCONSISTENT is not configured in
<PATH> when the parameter 'SpiInterruptConsistencyCheck' is configured as
<true> in 'SpiGeneral' container.
This error will occur, if the value of parameter 'SPI_E_INT_INCONSISTENT' present
in the SpiDemEventParameterRefs container is not configured when the parameter in
general container 'SpiInterruptConsistencyCheck' is configured as <true>.
ERR_59_83_093: References path of Parameter 'SPI_E_INT_INCONSISTENT' is
not correct in <SpiDemEventParameterRefs>
This error will occur, if the value of parameter 'SPI_E_INT_INCONSISTENT' present
in the SpiDemEventParameterRefs container is not correct.
ERR_59_83_094: References SPI_E_REG_WRITE_VERIFY is not configured in
$Validate_Spi_SpiDemEventParameterRefsPath when any one of the parameter
'SpiCSIHWriteVerify' or 'SpiDMAWriteVerify' is configured as <WV_INIT_ONLY>
or <WV_INIT_RUNTIME> in 'SpiGeneral' container.
This error will occur, if the value of parameter 'SPI_E_REG_WRITE_VERIFY' present
in the SpiDemEventParameterRefs container is not configured when any one of the
parameter in general container 'SpiCSIHWriteVerify' or 'SpiDMAWriteVerify' is
configured as <WV_INIT_ONLY> or <WV_INIT_RUNTIME>.
ERR_59_83_095: References path of Parameter 'SPI_E_REG_WRITE_VERIFY' is
not correct in <SpiDemEventParameterRefs>
This error will occur, if the value of parameter 'SPI_E_REG_WRITE_VERIFY' present
in the SpiDemEventParameterRefs container is not correct.
ERR_59_83_096: The reference path configured for the parameters in the
container 'SpiDemEventParameterRefs' should be unique.
This error will occur, if the parameter are configured with same dem path in container
'SpiDemEventParameterRefs'.
ERR_59_83_097: The value of the parameter 'parameter name' across the
containers 'SpiExternalDevicex' and 'SpiExternalDevicey' should be same as
they are referring the same SpiHw 'CSIHn'.
The error will occur if the value of the parameters SpiCsInactiveAfterLastData,
SpiShiftClockIdleLevel, SpiInputClockSelect, SpiInterruptDelayMode in the
SpiExternalDevice container are not same across the External devices mapped to the
same SpiHw Unit.
54
Messages
Chapter 9
ERR_59_83_098: 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 will occur, 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>.
ERR_59_83_099: The parameter SpiCsSelection is not configured as
'CS_VIA_PERIPHERAL_ENGINE' in the container SpiExternalDevice$Device
since the CSIH hardware is used.
This error will occur if the parameter SpiCsSelection is not configured as
'CS_VIA_PERIPHERAL_ENGINE' in the container SpiExternalDevice since the chip
select for CSIH HW units are always configured as hardware chip select pin.
ERR_59_83_100: The channel path configured for job '<JobName>' in driver set
'<SpiDriverName>' is not correct.
This error will occur if the channel path configured for the job is wrong.
ERR_59_83_101: The device path configured for job '<JobName>' in driver set
'<SpiDriverName>' is not correct.
This error will occur if the device path configured for the job is wrong.
ERR_59_83_102: The Hardware unit '<HWUnit>' configured for job '<JobName>'
in driver set '<SpiDriverName>' is not mapped to any one of memory modes.
This error will occur if the hard ware unit configured for the job is not assigned to any
memory modes.
ERR_59_83_103: The job path configured for sequence '<SeqName>' in driver
set '<SpiDriverName>' is not correct.
This error will occur if the job path configured for the sequence is not correct.
ERR_59_83_104: Selected unsupported device variant in 'SpiDeviceName'.
This error will occur if the device name given in parameter 'SpiDeviceName' of arxml
is wrong or unsupported.
ERR_59_83_105: The HW unit '<HW>' in SpiMemoryMode container
'<Spi_Mode_Name>' is not assigned to any SpiExternalDevice container.
This error will occur if the HW unit in SpiMemoryMode container is not assigned to any
SpiExternalDevice container.
ERR_59_83_106: The value for 'SpiDmaMode' in General container should be
configured as <false> since the value of parameter 'SpiLevelDelivered' is
configured as <0>.
This error will occur if the general container parameters, SpiDmaMode configured as
true and SpiLevelDelivered configured as zero. In synchronous data transfer DMA
mode is not possible.
55
Chapter 9
Messages
ERR_59_83_107: The value configured for 'SpiBaudrateConfiguration' in
<SpiDevName> container should be greater than Zero.
This error will occur if the value configured for SpiBaudrateConfiguration in
SpiExternalDevice container was not greater than zero. This parameter is used for
baud rate calculation.
ERR_59_83_108: The configured baud rate value of <SpiJobName> should be
between <CLKP_C / 524160> and <CLKP_C / 4>.
This error will occur if the calculated baud rate was not in the range of expected baud
rate with respect to MCU clock.
ERR_59_83_109: The parameters 'SpiInputClockSelect' and
'SpiBaudrateConfiguration' should be configured in such a way that the
calculated Baud rate should be less than <CLKP_C / 4> in <SpiJobName>.
This error will occur if the value configured for SpiInputClockSelect and
SpiBaudrateConfiguration in container SpiExternalDevice was not correct to obtain
minimum baud rate.
ERR_59_83_110: The value of 'SpiHwUnitSynchronous' in job container should
not be configured as <'SYNCHRONOUS' / 'ASYNCHRONOUS'> if the value
configured for 'SpiLevelDelivered' is <'1'/ '0'> in General container.
This error will occur if the values configured for SpiLevelDelivered and
SpiHwUnitSynchronous were mismatching.
ERR_59_83_111: The different CS polarity configured for <CSL pin> of
<CSIHHW> in <SpiDrivName>.
This error will occur if CS polarity configured was not same for same CSL pin of CSIH
device.
9.2 Warning Messages
None.
9.3 Information Messages
This section contains the list of information messages that will be generated by the
MCAL Code Generator Tool.
INFO_59_83_001: The parameter 'SpiHighPriorityHwSequence' in the container
'SpiSequence ' not to be configured as <true>. Since the pre-compile parameter
'SpiHighPriorityHwHandlingEnable' in the 'SpiGeneral' container is configured
as <false>. Hence the MCAL Code Generator 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 MCAL Code Generator Tool ignores the value configured for
the parameter SpiHighPriorityHwSequence.
56
Messages
Chapter 9
INFO_59_83_002: Calculated SPI baudrate for job ‘SpiJob’ in configuration set
‘SpiDriver’ should be equal to <Calculated Buadrate Hz>.
This information will occur to provide the calculated SPI baudrate for job (SpiJob) in
configuration set SpiDriver.
The calculation of baudrate is done as follows:
Baudrate = (Referred peripheral clock form MCU) / [(2m) * SpiBaudrateConfiguration
* 2]
Table 9-3 Parameter values related to INF0_59_83_002
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
INFO_59_83_003: 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 whenever 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.
57
Chapter 9
Messages
58
Revision History
Sl.No. Description
Version
Date
1.
Initial Version
1.0.0
05-Aug-2015
2.
Following changes are made:
1.0.1
28-Mar-2016
1. In section 10.1.1, error message regarding 16 bit data width
selection is added when DMA is configured.
2. The section List of tables updated.
3. In Section 10, descriptions added for error, warning and
information messages.
3.
Following changes are made:
1.0.2
27-Jan-2017
1. Introduction updated in section 1.
2. Updated Chapters 1,3,4,5,6,7 by rephrasing Tool and SPI Driver
Generation Tool with MCAL Code Generator Tool
3. Precaution and remark updated in section 6.
4. User Configuration Validation information updated in section 7.
5. Notes updated in section 11.
6. Remarks added in section 3.
7. Table header name updated in Table 8.1 and Table 8.2.
8. Removed Section 9.1 Common Messages.
9. Error messages and information messages updated in the section
9.1 and 9.3.
10. Removed Chapter 9 SPI Driver Generation Tool Options, Chapter-
11 Notes.
11. Chapter 3, Added remark for common MCAL Code Generator
Tool user manual.
12. Chapter 3, Updated Figure 3-2 Flowchart of MCAL Code
Generator Tool.
13. Chapter 3, Renamed chapter name MCAL Code Generator Tool
Overview to Code Generation Overview.
14. Removed parameters from Figure 8-1, Configuration Overview.
59
AUTOSAR MCAL R4.0.3 User's Manual
Spi Driver Component Ver.1.0.2
Generation Tool User's Manual
Publication Date: Rev.1.00, January 27, 2017
Published by: Renesas Electronics Corporation

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


AUTOSAR MCAL R4.0.3
User's Manual
R20UT3660EJ0100
Document Outline
- Chapter 1 Introduction
- Chapter 2 Reference
- Chapter 3 Code Generation Overview
- Chapter 4 Input Files
- Chapter 5 Output Files
- Chapter 6 Precautions
- Chapter 7 User Configuration Validation
- Chapter 8 Configuration Overview
- Chapter 9 Messages
7 - Spi Integration Manual
Integration Manual
For
Spi
VERSION: 1
DATE: 07/09/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 | 07/09/17 |
Table of Contents
3.2 Global Functions(Non RTE) to be provided to Integration Project 6
4 Configuration REQUIREMeNTS 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
Abbrevations And Acronyms
| Abbreviation | Description |
References
This section lists the title & version of all the documents that are referred for development of this document
| Sr. No. | Title | Version |
Dependencies
This component relies on installation of the Renesas MCAL CodeGenerator utilitiy. Currently, this utility is required to be installed on the integrator’s component and this component assumes this utility is installed in the default installation directory. This places the executable in the “C:\Renesas\CodeGenerator\code_generator\MCALGenerator.exe” directory. This component requires version “2.06.03” of the MCAL Code Generator.
SWCs
| Module | Required Feature |
Note : Referencing the external components should be avoided in most cases. Only in unavoidable circumstance external components should be referred. Developer should track the references.
Global Functions(Non RTE) to be provided to Integration Project
API usage and scheduling of BSW components expected to be captured at a project architectural level and is beyond the scope of this document. Third party documentation can be referenced as needed.
Configuration REQUIREMeNTS
Configuration of BSW components expected to be captured at a project architectural level and is beyond the scope of this document. Third party documentation can be referenced as needed.
Build Time Config
| Modules | Notes | |
Configuration Files to be provided by Integration Project
N/A
Da Vinci Parameter Configuration Changes
| Parameter | Notes | SWC |
DaVinci Interrupt Configuration Changes
| ISR Name | Notes |
Manual Configuration Changes
| Constant | Notes | SWC |
Integration DATAFLOW REQUIREMENTS
Required Global Data Inputs
Required Global Data Outputs
Specific Include Path present
Yes
Runnable Scheduling
API usage and scheduling of BSW components expected to be captured at a project architectural level and is beyond the scope of this document. Third party documentation can be referenced as needed.
| 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
| Feature | RAM | ROM |
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>/*.c) do (
ECHO ..\generate\<MCAL_Component>\%%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>
8 - Spi Peer Review Checklist
Overview
Summary SheetSynergy Project
3rd Party Files