AUTOSAR SRS SPALGeneral
AUTOSAR SRS SPALGeneral
Disclaimer
This work (specification and/or software implementation) and the material contained
in it, as released by AUTOSAR, is for the purpose of information only. AUTOSAR
and the companies that have contributed to it shall not be liable for any use of the
work.
The material contained in this work is protected by copyright and other types of
intellectual property rights. The commercial exploitation of the material contained in
this work requires a license to such intellectual property rights.
This work may be utilized or reproduced without any modification, in any form or by
any means, for informational purposes only. For any other purpose, no part of the
work may be utilized or reproduced, in any form or by any means, without permission
in writing from the publisher.
The work has been developed for automotive applications only. It has neither been
developed, nor tested for non-automotive applications.
The word AUTOSAR and the AUTOSAR logo are registered trademarks.
Table of Contents
1 Scope of Document ............................................................................................ 5
4 Conceptual Issues.............................................................................................. 9
4.1 General Rules .............................................................................................. 9
4.2 List of drivers not affected by the clock frequency ........................................ 9
4.3 MCAL relevant ECU Power Modes .............................................................. 9
4.4 Wake-up Scenarios ...................................................................................... 9
4.5 Scheduling and integration of drivers ......................................................... 10
5 Requirements Tracing ...................................................................................... 11
1 Scope of Document
This document specifies general requirements on Basic Software Modules of the
following software layers:
Microcontroller Abstraction Layer
ECU Abstraction Layer
The selection of modules is derived from the WP Architecture BSW Module List and
Layered Architecture. The following modules are in scope:
Memory drivers and interfaces (internal/external EEPROM, Flash, Flash
EEPROM Emulation)
I/O drivers (PORT, ADC, DIO, PWM, ICU, OCU)
I/O Hardware Abstraction
ECU onboard communication drivers and handlers (SPI)
System drivers (internal/external Watchdog, MCU, GPT, RAM test)
Constraints
First scope for specification of requirements on basic software modules are systems
which are not safety relevant. For this reason safety requirements are assigned to
medium priority.
2 Requirements Guidelines
Existing specifications shall be referenced (in form of a single requirement).
Differences to these specifications are specified as additional requirements.
In requirements, the following specific semantics are used (taken from Request
for Comment RFC 2119 from the Internet Engineering Task Force IETF)
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119. Note that the requirement
level of the document in which they are used modifies the force of these words.
MUST: This word, or the terms "REQUIRED" or "SHALL", mean that the definition
is an absolute requirement of the specification.
MUST NOT: This phrase, or the phrase "SHALL NOT", means that the definition
is an absolute prohibition of the specification.
SHOULD: This word, or the adjective "RECOMMENDED", mean that there may
exist valid reasons in particular circumstances to ignore a particular item, but the
full implications must be understood and carefully weighed before choosing a
different course.
SHOULD NOT: This phrase, or the phrase "NOT RECOMMENDED" mean that
there may exist valid reasons in particular circumstances when the particular
behavior is acceptable or even useful, but the full implications should be
understood and the case carefully weighed before implementing any behavior
described with this label.
MAY: This word, or the adjective "OPTIONAL", means that an item is truly
optional. One vendor may choose to include the item because a particular
marketplace requires it or because the vendor feels that it enhances the product
while another vendor may omit the same item. An implementation, which does not
include a particular option, MUST be prepared to interoperate with another
implementation, which does include the option, though perhaps with reduced
functionality. In the same vein an implementation, which does include a particular
option, MUST be prepared to interoperate with another implementation, which
does not include the option (except, of course, for the feature the option
provides.)
Redundancy
Requirements shall not be repeated within one requirement or in other
requirements
Clearness
All requirements shall allow one possibility of interpretation only. Only
technical terms of the glossary may be used.
Atomicity
Each Requirement shall only contain one requirement. A Requirement is
atomic if it cannot be split up in further requirements.
Testability
Requirements shall be testable by analysis, review or test.
Traceability
The source and status of a requirement shall be visible at all times.
Functional Requirements:
- Configuration (which elements of the module need to be configurable)
- Initialization
- Normal Operation
- Shutdown Operation
- Fault Operation
- ...
Non-Functional Requirements:
- Timing Requirements
- Resource Usage
- Usability
- Output for other WPs (e.g. Description Templates, Tooling,...)
- ...
Acronym: Description:
CS Chip Select
DIO Digital Input Output
ECU Electric Control Unit
ICU Interrupt Capture Unit
MAL Old name of Microcontroller Abstraction Layer (replaced by MCAL
because ‘MAL’ is a French term meaning ‘bad’)
MCAL Microcontroller Abstraction Layer
MCU Microcontroller Unit
MMU Memory Management Unit
Master A device controlling other devices (slaves, see below)
Slave A device being completely controlled by a master device
NMI Non Maskable Interrupt
OS Operating System
OCU Output Compare Unit
PLL Phase Locked Loop
PWM Pulse Width Modulation
RX Reception (in the context of bus communication)
SPAL Standard Peripheral Abstraction Layer (The name of this working
group)
SFR Special Function Register
RTE Runtime Environment
WP Work Package
Acronym: Description:
STD Standard
REQ Requirement
UNINIT Uninitialized (= not initialized)
As this is a document from professionals for professionals, all other terms are
expected to be known.
4 Conceptual Issues
4.1 General Rules
1. Don’t do anything within our callbacks that exceeds 50 µs runtime this will
affect the system performance too much.
2. Each driver specification is designed so that the driver itself will take care of
atomicity and data integrity for data inside of the driver.
3. Application buffers shall be passed as pointers from the user to the driver.
Conclusion: Most of the drivers have a strong dependency of the clock frequency
therefore it is very important to carefully consider the influence across the whole
system when configuring each software component.
For this reason, all drivers shall allow to be used within a cooperatively scheduled
system. They shall not implement blocking code and expect that they are pre-empted
by the operating system. Implementation hint: use state machines instead of linear
code.
5 Requirements Tracing
Requirement Description Satisfied by
RS_BRF_01064 AUTOSAR BSW shall provide SRS_SPAL_00157, SRS_SPAL_12056
callback functions in order to access
upper layer modules
RS_BRF_01096 AUTOSAR shall support start-up and SRS_SPAL_12057, SRS_SPAL_12068,
shutdown of ECUs SRS_SPAL_12125, SRS_SPAL_12163,
SRS_SPAL_12461, SRS_SPAL_12463
RS_BRF_01104 AUTOSAR shall support sleep and SRS_SPAL_12067, SRS_SPAL_12069,
wake-up of ECUs and buses SRS_SPAL_12267
RS_BRF_01152 AUTOSAR shall support limited SRS_SPAL_12265
dynamic reconfiguration
RS_BRF_01440 AUTOSAR services shall support SRS_SPAL_12064
system diagnostic functionality
RS_BRF_01496 AUTOSAR shall standardize how SRS_SPAL_12267
events which move an ECU out of
the SLEEP mode are handled
RS_BRF_02168 AUTOSAR diagnostics shall provide SRS_SPAL_00157, SRS_SPAL_12064
a central classification and handling
of abnormal operative conditions
RS_BRF_02232 AUTOSAR shall support SRS_SPAL_00157, SRS_SPAL_12448
development with run-time assertion
checks
6 Requirement Specification
6.1 Functional Requirements
This chapter contains general requirements which apply to all modules of the
Microcontroller and ECU Abstraction Layers, but not necessarily to Basic Software
Modules of other layers.
6.1.1.1 Configuration
Type: Valid
Description: Wakeup sources shall be initialized by MCAL drivers and/or the MCU driver.
Possible wake-up sources are e.g. reset, watchdog, NMI, interrupt etc.
Rationale: Allow the configuration of MCU to wake-up.
Use Case: The GPT interrupt is enabled by the GPT driver and should wake-up the
MCU from Idle/Sleep/Stop mode.
Dependencies: --
Supporting Material: --
⌋(RS_BRF_01104,RS_BRF_01496)
6.1.1.2 Initialization
Supporting Material:
⌋(RS_BRF_01096)
6.1.1.2.4 [SRS_SPAL_12461] Specific rules regarding initialization of controller
registers shall apply to all driver implementations
⌈
Type: Valid
Description: The following rules regarding initialization of controller registers shall apply to
all driver implementations:
1. If the hardware allows for only one usage of the register, the
driver module implementing that functionality is responsible for
initializing the register
2. If the register can affect several hardware modules and if it is an
I/O register it shall be initialized by the PORT driver
3. If the register can affect several hardware modules and if it is not
an I/O register it shall be initialized by the MCU driver
4. One-time writable registers that require initialization directly after
reset shall be initialized by the startup code
Rationale: Unambiguous initialization of controller registers, no changes in driver
implementation needed for different configurations.
Use Case: 1) All registers concerning the flash module shall be initialized by
the flash driver
2) I/O Registers that can be used either for CAN, ADC or DIO shall
be initialized by the PORT driver
3) Registers that affect the clock settings of different hardware
modules shall be initialized by the MCU driver
4) Registers affecting the mapping of the register set, RAM or
EEPROM shall be initialized in the startup code
Dependencies: --
Supporting Material: I/O register: Everything that can affect the functionality of a port pin.
⌋(RS_BRF_01096)
6.1.1.2.5 [SRS_SPAL_12462] The register initialization settings shall be
published
⌈
Type: Valid
Description: The implementers of the respective driver modules have to publish all
register initialization settings in the driver modules documentation.
Rationale: The configurator (human or tool responsible for configuring the software)
needs to get the register settings of the register that are not initialized
directly by the driver
Use Case: --
Dependencies: SRS_SPAL_12461
Supporting Material: --
⌋()
6.1.1.2.6 [SRS_SPAL_12463] The register initialization settings shall be
combined and forwarded
⌈
Type: Valid
Description: The configurator shall combine all initialization settings from different drivers
and check them for consistency (dependency and conflict).
If this check is successful it shall forward those combined settings to the
14 of 21 Document ID 009: AUTOSAR_SRS_SPALGeneral
- AUTOSAR confidential -
General Requirements on SPAL
AUTOSAR CP Release 4.4.0
Implementation hint:
Usually this notification is done from the ISR of the wake-up.
Rationale: The ECU State Manager needs the wake-up reason. It allows guaranteeing
low consumption. For the ICU for instance, it avoids the report of non valid
wake-up reasons (spikes).
Use Case: The ISR of the associated wake-up interrupt calls the wake-up report
function of the ECU State Manager if wake-up occurs.
Dependencies: --
Supporting Material: --
⌋(RS_BRF_01104)
⌋()
⌈
Type: Valid
Description: All drivers with random streaming capabilities (memory drivers) shall use
application buffers. The caller shall not change the data during job
processing of the driver.
Rationale: Minimal RAM consumption, runtime efficiency
Use Case: The EEPROM write service gets a pointer to the source data to be written.
During EEPROM write operation the driver reads data from the application
buffer. The EEPROM driver does not provide an own data buffer.
Dependencies: --
Supporting Material: --
⌋()
6.1.1.3.5 [SRS_SPAL_12129] The ISRs shall be responsible for resetting the
interrupt flags and calling the according notification function
⌈
Type: Valid
Description: The ISRs shall be responsible for resetting the interrupt flags and calling the
according notification function.
Rationale: The notification functions can be user defined and therefore not allowed to
have direct access to hardware.
Use Case: --
Dependencies: --
Supporting Material: --
⌋()
7 References
7.1 Deliverables of AUTOSAR
[1] Glossary
AUTOSAR_TR_Glossary.pdf