MICROSAR CAN State Manager
Technical Reference
Version 2.10.01
Authors Mark A. Fingerle
Status
Released
Technical Reference MICROSAR CAN State Manager
Document Information
History
Author
Date
Version
Remarks
Mark A. Fingerle
2012-08-08
Mark A. Fingerle
2012-10-23
2.0.0
2.1.0
Mark A. Fingerle
2013-05-03
2.2.0
Mark A. Fingerle
2013-06-13
2.3.0
Mark A. Fingerle
2013-08-13
2.4.0
Mark A. Fingerle
2014-10-13
2.5.0
Mark A. Fingerle
2015-11-13
2.6.0
Mark A. Fingerle
2016-01-13
2.7.0
Mark A. Fingerle
2016-05-13
2.8.0
Mark A. Fingerle
2016-08-01
2.9.0
Creation from scratch
ESCAN00062053 Interface to provide
internal bus-off recovery level 3.8, Table
3-4, 5.1, 5.2.13
ESCAN00062050 Instruction order for
transition to no communication Figure 3-3
Figure 3-5
Update state machine pictures Figure 3-1,
Figure 3-2, Figure 3-4
ESCAN00065274 Trigger CanIf PduMode
wake up filter in PN use case 6.2.6
Remove chapter “4.2 Include Structure”
and “4.3 Compiler Abstraction and Memory
Mapping”
ESCAN00068036 SetEcuPassive 0,
5.2.14, 6.2.7 ESCAN00068039
PreventBusSleepAtStartUp 3.13, 5.2.15,
6.2.8
ESCAN00069109 3.11 Baud Rate
Adaption
ESCAN00068797 3.14 BusOff Recovery
Notifications
ESCAN00076768 Post-Build Selectable
(Identity Manager) support 6.2.9
ESCAN00076224 Add APIs to Assist EcuM
Wakeup Validation 3.15, 5.2.11, 5.2.12
ESCAN00079340 Description BCD-coded
return-value of GetVersionInfo()
AUTOSAR deviation 6.1
ESCAN00086062 3.10 Swift Tx Timeout
Exception
ESCAN00088643 Extended RAM Check
5.2.2, 5.2.16, 5.2.17, 5.4.8, 5.4.9, 5.5.1,
5.5.2, 5.5.3, 5.5.4
ESCAN00090185 Wakeup validation fail
(Start/Stop wakeup sources); Wakeup
validation must not be used with
asynchronous Trcv (SPI) 5.2.11 5.2.12
ESCAN00090829 Improve description how
to redirect "Error Reporting APIs" 3.17.1,
3.17.2
ESCAN00091303 6.2.13 Expanded Tx
Timeout Exception Handling
© 2017 Vector Informatik GmbH
Version 2.10.01
based on template version 5.0.0
2
Technical Reference MICROSAR CAN State Manager
Mark A. Fingerle
2016-12-01
2.10.00
Mark A. Fingerle
2017-10-23
2.10.01
FEATC-570 Mode Request Repetition Max
is available as Runtime Error (DEM) (see
3.3.1, 3.17.2, 6.1.2)
ESCAN00076256 Critical Sections, new
CANSM_EXCLUSIVE_AREA_6
Reference Documents
No.
Source
Title
[1]
AUTOSAR Specification of CAN State Manager
[2]
AUTOSAR Specification of Development Error Tracer
[3]
AUTOSAR Specification of Diagnostics Event Manager
[4]
AUTOSAR
List of Basic Software Modules
[5]
AUTOSAR Specification of CAN Interface
[6]
AUTOSAR Specification of Communication Manager
[7]
AUTOSAR Specification of Basic Software Mode Manager
Version
2.2.0
3.2.0
4.2.0
1.6.0
5.0.0
4.0.0
1.2.0
Scope of the Document
This technical reference describes the general use of the CAN State Manager basis
software. All aspects which are CAN controller specific are described in the technical
reference of the CAN Interface, which is also part of the delivery.
Caution
We have configured the programs in accordance with your specifications in the
questionnaire. Whereas the programs do support other configurations than the one
specified in your questionnaire, Vector’s release of the programs delivered to your
company is expressly restricted to the configuration you have specified in the
questionnaire.
© 2017 Vector Informatik GmbH
Version 2.10.01
based on template version 5.0.0
3
Technical Reference MICROSAR CAN State Manager
Contents
1 Component History ...................................................................................................... 9
2
Introduction................................................................................................................. 10
2.1
Architecture Overview ...................................................................................... 10
3
Functional Description ............................................................................................... 12
3.1
3.2
3.3
Features .......................................................................................................... 12
Initialization ...................................................................................................... 13
State Machine .................................................................................................. 13
3.3.1
3.3.2
3.3.3
3.3.4
3.3.5
3.3.6
Mode Request Indication and Repetition .......................................... 14
Communication Mode Request Change (During Pending Mode
Indication or Running Bus-Off Recovery) ......................................... 14
CANSM_NO_COMMUNICATION to
CANSM_FULL_COMMUNICATION ................................................. 15
CANSM_FULL_COMMUNICATION to
CANSM_SILENT_COMMUNICATION ............................................. 16
CANSM_SILENT_COMMUNICATION ............................................. 16
CANSM_SILENT_COMMUNICATION to
CANSM_FULL_COMMUNICATION ................................................. 16
3.3.7
Transition to CANSM_NO_COMMUNICATION ................................ 17
Bus-Off Recovery ............................................................................................. 18
Main Function .................................................................................................. 19
Communication Modes .................................................................................... 19
Communication Mode Polling........................................................................... 19
Bus-off Level Polling ........................................................................................ 19
Partial Networking ............................................................................................ 19
Tx Timeout Exception ...................................................................................... 21
Baud Rate Adaption ......................................................................................... 21
ECU Passive Mode .......................................................................................... 22
PreventBusSleepAtStartUp .............................................................................. 22
BusOff Recovery Notifications Extension of Tx Offline Duration ....................... 23
3.4
3.5
3.6
3.7
3.8
3.9
3.10
3.11
3.12
3.13
3.14
3.15 Wake-up Validation Assistance ........................................................................ 23
3.16
Start/Stop Wake-up Sources ............................................................................ 23
3.16.1
Normal Behavior .............................................................................. 23
3.16.2
Usage .............................................................................................. 24
3.16.3
Exceptional Behavior ....................................................................... 24
3.16.4
Potential Effect ................................................................................. 24
3.16.4.1 Start of the Wakeup Sources Fail ................................... 24
3.16.4.2 Stop of the Wakeup Sources Fail ................................... 24
© 2017 Vector Informatik GmbH
Version 2.10.01
based on template version 5.0.0
4
Technical Reference MICROSAR CAN State Manager
3.16.5
Countermeasures ............................................................................ 25
3.17
Error Handling .................................................................................................. 26
3.17.1
Development Error Reporting ........................................................... 26
3.17.2
Production Code Error Reporting ..................................................... 27
4
Integration ................................................................................................................... 29
4.1
Scope of Delivery ............................................................................................. 29
4.1.1
4.1.2
Static Files ....................................................................................... 29
Dynamic Files .................................................................................. 29
4.2
Critical Sections ............................................................................................... 30
5 API Description ........................................................................................................... 32
5.1
5.2
Type Definitions ............................................................................................... 32
Services Provided by CanSM........................................................................... 32
5.2.1
5.2.2
5.2.3
5.2.4
5.2.5
5.2.6
5.2.7
5.2.8
5.2.9
CanSM_InitMemory ......................................................................... 32
CanSM_PreInit ................................................................................. 33
CanSM_Init ...................................................................................... 33
CanSM_MainFunction ...................................................................... 34
CanSM_RequestComMode ............................................................. 34
CanSM_GetCurrentComMode ......................................................... 35
CanSM_GetVersionInfo ................................................................... 35
CanSM_CheckBaudrate .................................................................. 36
CanSM_ChangeBaudrate ................................................................ 36
5.2.10
CanSM_SetBaudrate ....................................................................... 37
5.2.11
CanSM_StartWakeupSources .......................................................... 38
5.2.12
CanSM_StopWakeupSources .......................................................... 38
5.2.13
CanSM_CheckBorLevel ................................................................... 39
5.2.14
CanSM_SetEcuPassive ................................................................... 39
5.2.15
CanSM_PreventBusSleepAtStartUp ................................................ 40
5.2.16
CanSM_RamCheckStatus ............................................................... 40
5.2.17
CanSM_RamCheckEnableMailbox .................................................. 41
Services Used by CanSM ................................................................................ 41
Callback Functions ........................................................................................... 42
5.3
5.4
5.4.1
5.4.2
5.4.3
5.4.4
5.4.5
5.4.6
5.4.7
5.4.8
CanSM_ControllerBusOff ................................................................. 42
CanSM_ControllerModeIndication .................................................... 43
CanSM_TransceiverModeIndication ................................................. 43
CanSM_ClearTrcvWufFlagIndication ............................................... 44
CanSM_CheckTransceiverWakeFlagIndication ................................ 44
CanSM_ConfirmPnAvailability.......................................................... 45
CanSM_TxTimeoutException ........................................................... 45
CanSM_RamCheckCorruptMailbox ................................................. 46
© 2017 Vector Informatik GmbH
Version 2.10.01
based on template version 5.0.0
5
Technical Reference MICROSAR CAN State Manager
5.4.9
CanSM_RamCheckCorruptController .............................................. 46
5.5
Callout Functions ............................................................................................. 47
5.5.1
5.5.2
5.5.3
5.5.4
Appl_CanSM_RamCheckStart ......................................................... 47
Appl_CanSM_RamCheckCorruptController ..................................... 47
Appl_CanSM_RamCheckCorruptMailbox ........................................ 48
Appl_CanSM_RamCheckFinished ................................................... 48
6 AUTOSAR Standard Compliance............................................................................... 50
6.1
Deviations ........................................................................................................ 50
6.1.1
6.1.2
Communication mode requests are acceped if possible ................... 50
Mode Request Timeout is available as Runtime Error (DEM) ........... 50
6.2
Additions/ Extensions ....................................................................................... 50
6.2.1
6.2.2
6.2.3
6.2.4
6.2.5
6.2.6
6.2.7
6.2.8
6.2.9
API CanSM_InitMemory() ................................................................ 50
No Mode Notification During CanSM_Init ......................................... 50
Configuration Options ...................................................................... 50
Additional Bus-Off Recovery in State Silent...................................... 50
API CanSM_CheckBorLevel() .......................................................... 50
Partial Network Wake Up Filter ........................................................ 50
ECU Passive Mode .......................................................................... 50
PreventBusSleepAtStartUp .............................................................. 50
Post-Build Selectable (Identity Manager) ......................................... 51
6.2.10
APIs to Assist EcuM Wakeup Validation ........................................... 51
6.2.11
Swift or Large Tx Timeout Exception handling .................................. 51
6.2.12
Extended RAM Check ...................................................................... 51
6.2.13
Expanded Tx Timeout Exception Handling ....................................... 51
6.3
Limitations........................................................................................................ 51
6.3.1
6.3.2
Controllers ....................................................................................... 51
Configuration Class .......................................................................... 51
7 Glossary and Abbreviations ...................................................................................... 52
7.1
7.2
Glossary .......................................................................................................... 52
Abbreviations ................................................................................................... 52
8 Contact ........................................................................................................................ 53
© 2017 Vector Informatik GmbH
Version 2.10.01
based on template version 5.0.0
6
Technical Reference MICROSAR CAN State Manager
Illustration List
Figure 2-1
Figure 2-2
Figure 3-1
Figure 3-2
Figure 3-3
Figure 3-4
Figure 3-5
Tables
Table 1-1
Table 3-1
Table 3-2
Table 3-3
Table 3-4
Table 3-5
Table 3-6
Table 4-1
Table 4-2
Table 5-1
Table 5-2
Table 5-3
Table 5-4
Table 5-5
Table 5-6
Table 5-7
Table 5-8
Table 5-9
Table 5-10
Table 5-11
Table 5-12
Table 5-13
Table 5-14
Table 5-15
Table 5-16
Table 5-17
Table 5-18
Table 5-19
Table 5-20
Table 5-21
Table 5-22
Table 5-23
Table 5-24
Table 5-25
Table 5-26
Table 5-27
Table 5-28
Table 5-29
Table 5-30
Table 5-31
Table 5-32
AUTOSAR architecture ............................................................................. 10
Interfaces to adjacent modules of the CanSM ........................................... 11
CanSM state machine .............................................................................. 14
Sub state transition to CANSM_FULL_COMMUNICATION ...................... 15
Sub state transition to CANSM_NO_COMMUNICATION .......................... 17
CanSM sub-state bus-off recovery ............................................................ 18
Sub state Partial Network transition to CANSM_NO_COMMUNICATION . 20
Component history...................................................................................... 9
Supported AUTOSAR standard conform features ..................................... 12
Not supported AUTOSAR standard conform features ............................... 12
Features provided beyond the AUTOSAR standard .................................. 13
Service IDs ............................................................................................... 27
Errors reported to DET ............................................................................. 27
Errors reported to DEM ............................................................................. 28
Static files ................................................................................................. 29
Generated files ......................................................................................... 30
Type definitions ......................................................................................... 32
CanSM_InitMemory .................................................................................. 33
CanSM_PreInit ......................................................................................... 33
CanSM_Init ............................................................................................... 34
CanSM_MainFunction .............................................................................. 34
CanSM_RequestComMode ...................................................................... 35
CanSM_GetCurrentComMode .................................................................. 35
CanSM_GetVersionInfo ............................................................................ 36
CanSM_CheckBaudrate ........................................................................... 36
CanSM_ChangeBaudrate ......................................................................... 37
CanSM_SetBaudrate ................................................................................ 37
CanSM_StartWakeupSources .................................................................. 38
CanSM_StopWakeupSources .................................................................. 39
CanSM_CheckBorLevel ........................................................................... 39
CanSM_SetEcuPassive ............................................................................ 40
CanSM_PreventBusSleepAtStartUp ......................................................... 40
CanSM_RamCheckStatus ........................................................................ 41
CanSM_RamCheckEnableMailbox ........................................................... 41
Services used by the CanSM .................................................................... 42
CanSM_ControllerBusOff ......................................................................... 43
CanSM_ControllerModeIndication ............................................................ 43
CanSM_TransceiverModeIndication ......................................................... 44
CanSM_ClearTrcvWufFlagIndication ........................................................ 44
CanSM_CheckTransceiverWakeFlagIndication ........................................ 45
CanSM_ConfirmPnAvailability .................................................................. 45
CanSM_TxTimeoutException ................................................................... 46
CanSM_RamCheckCorruptMailbox .......................................................... 46
CanSM_RamCheckCorruptController ....................................................... 47
Appl_CanSM_RamCheckStart ................................................................. 47
Appl_CanSM_RamCheckCorruptController .............................................. 48
Appl_CanSM_RamCheckCorruptMailbox ................................................. 48
Appl_CanSM_RamCheckFinished ............................................................ 49
© 2017 Vector Informatik GmbH
Version 2.10.01
based on template version 5.0.0
7
Technical Reference MICROSAR CAN State Manager
Table 7-1
Table 7-2
Glossary ................................................................................................... 52
Abbreviations ............................................................................................ 52
© 2017 Vector Informatik GmbH
Version 2.10.01
based on template version 5.0.0
8