TechnicalReference CanNm Autosar
TechnicalReference CanNm Autosar
Technical Reference
Nm_Asr4NmCan
Version 6.02.00
Document Information
History
Reference Documents
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.
Contents
2. Introduction .................................................................................................................. 11
2.1 Naming Conventions .............................................................................................. 11
2.2 Architecture Overview ............................................................................................ 12
2.2.1 Architecture of AUTOSAR Network Management .......................................... 12
4. Integration .................................................................................................................... 40
4.1 Scope of Delivery ................................................................................................... 40
4.1.1 Static Files .................................................................................................... 40
4.1.2 Dynamic Files ............................................................................................... 40
4.2 Include Structure .................................................................................................... 41
4.3 Main Functions ....................................................................................................... 42
7. Contact.......................................................................................................................... 63
Illustrations
Figure 2-1 AUTOSAR 4.x Architecture Overview ....................................................... 12
Figure 2-2 Interfaces to adjacent modules of the CANNM ......................................... 13
Figure 3-1 State Diagram of CAN NM from SWS CAN NM [3] ................................... 18
Figure 3-2 Usual Behavior of NM Transmissions when Repeat Message is entered .. 25
Figure 3-3 Immediate Transmission due to Signal Change inside User Data I-PDU .. 33
Figure 3-4 Immediate Nm Transmissions ................................................................... 35
Figure 3-5 Behavior for NM Transmissions if Immediate Restart Enabled is ON ........ 36
Figure 4-1 Include structure ....................................................................................... 41
Tables
Table 1-1 Reference Documents ................................................................................ 3
Table 1-1 Component history.................................................................................... 10
Table 2-1 Naming Conventions ................................................................................ 11
Table 3-1 Supported AUTOSAR standard conform features ..................................... 15
Table 3-2 Not supported AUTOSAR standard conform features ............................... 15
Table 3-3 Features provided beyond the AUTOSAR standard .................................. 16
Table 3-4 PDU NM Message Layout ........................................................................ 24
Table 3-5 Control Bit Vector ...................................................................................... 25
Table 3-6 Service IDs ............................................................................................... 30
Table 3-7 Errors reported to DET ............................................................................. 31
Table 3-8 Development Error Reporting: Assignment of checks to services ............. 32
Table 3-9 Errors reported to DEM ............................................................................. 32
Table 3-10 Configuration Precondition Overview for AUTOSAR ECU Configurations . 34
Table 4-1 Static files ................................................................................................. 40
Table 4-2 Generated files ......................................................................................... 40
Table 4-3 Critical Section Codes .............................................................................. 43
Table 5-1 Specification Version API Data ................................................................. 44
Table 5-2 Component Version API Data ................................................................... 44
Table 5-3 Vendor/Module ID ..................................................................................... 45
Table 5-4 CanNm_Init .............................................................................................. 46
Table 5-5 CanNm_MainFunction .............................................................................. 47
Table 5-6 CanNm_InitMemory .................................................................................. 47
Table 5-7 CanNm_GetVersionInfo ............................................................................ 48
Table 5-8 CanNm_GetState ..................................................................................... 48
Table 5-9 CanNm_PassiveStartUp ........................................................................... 49
Table 5-10 CanNm_NetworkRequest ......................................................................... 50
Table 5-11 CanNm_NetworkRelease ......................................................................... 50
Table 5-12 CanNm_SetUserData ............................................................................... 51
Table 5-13 CanNm_GetUserData............................................................................... 51
Table 5-14 CanNm_GetPduData ................................................................................ 52
Table 5-15 CanNm_RepeatMessageRequest ............................................................ 52
Table 5-16 CanNm_GetNodeIdentifier........................................................................ 53
Table 5-17 CanNm_GetLocalNodeIdentifier ............................................................... 54
Table 5-18 CanNm_RequestBusSynchronization ....................................................... 54
Table 5-19 CanNm_CheckRemoteSleepIndication ..................................................... 55
Table 5-20 CanNm_Transmit...................................................................................... 56
Table 5-21 CanNm_DisableCommunication ............................................................... 56
Table 5-22 CanNm_EnableCommunication ................................................................ 57
Table 5-23 CanNm_SetSleepReadyBit....................................................................... 57
Table 5-24 Services used by the CANNM .................................................................. 58
1. Component History
The component history gives an overview over the important milestones that are
supported in the different versions of the component.
Component Version New Features
1.00.00 Adaption to AUTOSAR Release 4
1.02.00 Support Variant Post-Build-Loadable
2.00.00 Added Runtime Measurement Support
3.00.00 Support Variant Post-Build-Selectable
Table 1-1 Component history
2. Introduction
This document describes the functionality, API and configuration of the AUTOSAR BSW
module CANNM as specified in [1] and [3]. Also the integration of the Network
Management into the AUTOSAR stack is covered by this document.
The FlexRay Network Management, LIN Network Management and the UDP Network
Management are not covered by this document.
Please note that in this document the term Application is not used strictly for the user
software but also for any higher software layer, like e.g. the Communication Manager
(ComM). Therefore, Application refers to any of the software components using the CAN
NM.
For further information please also refer to the AUTOSAR SWS specifications, referenced
at the beginning of this document in Table: ‘Reference Documents’.
Naming conventions
Nm_ Services of NM Interface.
CanNm_ Services of CAN NM.
Det_ Services of Development Error Tracer.
Dem_ Services of Diagnostic Event Manager.
Nodes which are configured to be passive will be also referred to as passive nodes.
Accordingly nodes that are not passive will be termed as active nodes.
1
Not covered by this document.
The next figure shows the interfaces to adjacent modules of the CAN NM. These
interfaces are described in chapter 5 ‘API Description’.
cmp Interfaces
Nm::Nm PduR::PduR
PduR_CanNm
Nm_Cbk
CanNm
CanNm_ConfirmPnAvailability
CanNm::CanNm CanSM::CanSM
CanSM_TxTimeoutException
Det_ReportError
Det::Det
SchM_CanNm SchM::SchM
CanNm_Cbk
CanIf
CanIf::CanIf
Applications do not access the services of the BSW modules directly. They use the service
ports provided by the BSW modules via the RTE. Since the CAN NM has no service ports,
the CAN NM cannot be accessed via RTE by the application.
3. Functional Description
3.1 Features
The Network Management is a network comprehensive protocol that provides services for
the organization of the network. It is a decentralized and direct network management. That
means that every ECU transmits a special network management message, which is
reserved for the network management only.
The features listed in the following tables cover the complete functionality specified for the
CanNm.
The AUTOSAR standard functionality is specified in [3], the corresponding features are
listed in the tables
> Table 3-1 Supported AUTOSAR standard conform features
> Table 3-2 Not supported AUTOSAR standard conform features
Vector Informatik provides further CanNm functionality beyond the AUTOSAR standard.
The corresponding features are listed in the table
> Table 3-3 Features provided beyond the AUTOSAR standard
Note
Some additional non-AUTOSAR features are only available if they are explicitly
ordered by the customer.
Caution
The transmission of application messages, e.g. transmitted by the Com, does not stop
immediately after the last NM message has been transmitted.
FAQ
The application is in charge of the decision whether the bus communication is required
or not.
The following figure shows the state diagram of the CAN NM. The events are calls of CAN
NM functions by the application or data link layer or the timeout of internal timers.
stm State Machine
Ready Sleep
3.3 Initialization
Before the CAN NM can be used it has to be initialized by the application. The initialization
has to be carried out before any other functionality of the CAN NM is executed. It shall
take place after initialization of the CAN Interface and prior to initialization of the NM
Interface.
Also refer to chapter 5.3.1.1 ‘CanNm_Init: Initialization of CAN NM’.
Caution
The CAN NM assumes that some variables are initialized with zero at start-up. If the
embedded target does not initialize RAM within the start-up code the function
‘CanNm_InitMemory’ has to be called during start-up and before the initialization is
performed. Refer also to chapter 3.1.2.2 ‘Memory Initialization’.
Note
In an AUTOSAR environment where the ECU Manager Fixed is used, the initialization
is performed within the ECU Manager. If the ECU Manager Flex is used, the
initialization is usually carried out by the BswM.
Info
The Com is active during Network Mode. It is started upon entry and stopped upon exit
of Network Mode. I.e. application messages are transmitted and received within Network
Mode!
3.5.1.1 Repeat Message State
The Repeat Message State is entered:
> If a NM message has been received in Prepare Bus-Sleep Mode.
> If the network has been requested by a call of CanNm_NetworkRequest() in Bus-
Sleep or Prepare Bus-Sleep Mode.
> If the network is woken up from Bus-Sleep Mode or from Prepare Bus-Sleep Mode by
a call of CanNm_PassiveStartUp().
> If any network node (including itself) has requested node detection in Ready Sleep or
Normal Operation State.
In Repeat Message State the NM messages are transmitted cyclically regardless whether
bus load reduction is enabled or disabled.
The Repeat Message State is left after a certain customizable time.
Depending on the bus-communication need of the application Normal Operation State or
Ready Sleep State is entered upon exit of Repeat Message State.
3.5.1.2 Normal Operation State
The network management stays in Normal Operation State until the bus-communication is
released. The local bus-communication request of the application is distributed in the
network by the transmission of NM messages.
3.5.1.3 Ready Sleep State
The network management stays in Ready Sleep State as long as the application does not
request bus-communication and the application of any other node still requests bus-
communication (by transmitting NM messages).
A certain customizable time after the last network node has released bus-communication a
transition to Prepare Bus-Sleep Mode is performed (i.e. Network Mode is left).
3.5.2 Prepare Bus-Sleep Mode
The transmission of application messages is stopped when entering Prepare Bus-Sleep
Mode. The bus activity is calmed down (pending message are still transmitted) in this
mode and finally there is no more activity on the bus.
After the ‘wait bus sleep time’ the drop out of Prepare Bus-Sleep Mode to Bus-Sleep Mode
the NM Interface is notified by the service call:
Nm_BusSleepMode() (5.4)
Caution
When entering Bus-Sleep Mode the physical bus interface has to be put into sleep
mode.
On CAN channels the transceiver and the CAN-Controller have to be put in sleep
mode. This information is forwarded by this callback to the ComM.
Note
If both NmOsek and CanNm are used on the same channel, CanNm is aware of the
prolonged shutdown of the NmOsek in case of a Limphome condition if the Wait Bus
Sleep Extensions feature is turned ON. For details see the following chapter 3.5.2.1.
The Prepare Bus-Sleep Mode is left to Network Mode upon successful reception of a NM
message or if the network has been requested by a call of CanNm_NetworkRequest()
or if the network has been woken up by a call of CanNm_PassiveStartUp().
3.5.2.1 Wait Bus Sleep Extensions
If both NmOsek and CanNm are coordinated on the same channel, the internal state of
NmOsek influences the shutdown behavior of the CanNm.
Note
This feature is automatically enabled when NmOsek and CanNm are configured
on the same channel and “Wait Bus Sleep Extensions” feature is enabled in
NmOsek.
Caution
When the communication control service is used the bus-communication shall not be
released as long as the NM message transmission ability is disabled.
Note that a bus-communication request is handled within the next task. Nevertheless it is
ensured that a communication request always leads to start-up even if the communication
is released before the next task is executed. Within Network Mode a fast toggling (i.e.
without task execution in between) of the communication status does not lead to any
action.
3.5.5 User Data Handling
The user data for the NM message transmitted next on the bus can be set by the service:
CanNm_SetUserData() (5.3.2.5.1)
The service
CanNm_GetUserData() (5.3.2.5.2)
allows reading the user data of the last received message on the bus.
As the NM PDU layout is completely configurable, the user data placement depends on
the given configuration.
The PDU layout and the content of the user data itself are OEM specific and therefore
provided by the OEM.
Note that for setting of NM user data a second possibility can be configured. Refer to
chapter 3.13 ‘Com User Data Support’ for more information. If the feature ‘Com User Data
Support’ is used the API CanNm_SetUserData() is not available.
3.6 Network Management Message Transmission and Reception
3.6.1 AUTOSAR CAN Interface
The network management requests the transmission of NM messages by calling the
service CanIf_Transmit [2]. The application has to take care of the user data. For
details refer to chapter 3.5.5 ‘User Data Handling’.
The successful transmission of every network management message is confirmed by the
CAN Interface with the service
CanNm_TxConfirmation() (5.5.1.1)
The CAN Interface indicates the reception of NM message by calling the service
CanNm_RxIndication() (5.5.1.2)
3.6.2 PDU Message Layout
The default PDU Message Layout is described in the following table:
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Byte 7 User data 5
Byte 6 User data 4
Byte 5 User data 3
Byte 4 User data 2
Byte 3 User data 1
Byte 2 User data 0
Byte 1 Control Bit Vector
Byte 0 Source Node Identifier
Table 3-4 PDU NM Message Layout
The number of User Data Bytes as well as the positions of the Control Bit Vector and
Source Node Identifier can be configured arbitrarily but depend on the availability of the
corresponding features (User Data Support / Node Detection Enabled / Node Identifier).
The Repeat Message Request Bit is only used if the ‘Node Detection’ feature is active.
Refer to chapter 3.7 for more information.
The NM Coordinator Sleep Ready Bit is only used if the ‘Coordinator Synchronization
Support’ is active. See chapter 3.11 for more details.
The Active Wake-up Bit is used for the ‘Active Wake-up Handling’ (chapter 3.14).
The Cluster Request Information Bit is used for ‘Partial Networking’ (chapter 3.18).
All bits inside the Control Bit Vector are optionally used and depend on the setting of these
features. If the feature is not used, the bit value is 0.
3.6.3 Message Transmissions
A standard sequence for NM message transmissions when Repeat Message is entered is
depicted in Figure 3-2.
Usual behavior without immediate transmissions
NM Message Transmissions
Figure 3-2 Usual Behavior of NM Transmissions when Repeat Message is entered
The first NM message is transmitted when ‘Msg Cycle Offset’ ms has been elapsed after
Repeat Message has been entered. The next NM message will be transmitted after Msg
Cycle Time has been elapsed. The configuration settings that influence this behavior are:
> ‘Msg Cycle Offset’: time before the transmission of the first NM message
> ‘Msg Cycle Time’: time between each message transmission
> ‘Immediate Restart Enabled’: if enabled, an additional NM message will be sent
immediately upon an active request (CanNm_NetworkRequest was called) from
Prepare Bus Sleep to Repeat Message (see also chapter 3.16) in case ‘Msg Cycle
Offset’ is greater than zero
2
This bit is also called ‘Partial Network Information Bit’
Note
The lower layer (e.g. CAN Interface) may reject the send request if Network Mode has
just been entered.
CanNm usually does not retry to issue the send request of the NM message. There are
features, which may enable retries in certain conditions:
If ‘Immediate Nm Transmissions’ are greater than zero, the rejected send request is not
considered as ‘Immediate Transmission’ (see chapter 3.15).
Note
Bus Load Reduction cannot be used on the channel if Partial Networking is used on the
same channel and vice versa. However setups like Bus Load Reduction is active on
the one channel and Partial Networking is active on the other channel is allowed.
Note
The setting is enabled, if a macro definition of
CANNM_CANIF_RANGE_CONFIG_DLC_CHECK can be found in CanNm_Cfg.h.
In case the ‘CanIf Range Config DLC Check’ setting is disabled, it is assumed that the
CanIf module accepts NM messages with different DLCs. The minimum DLC for NM
messages may be configured in the CanIf module, messages with a DLC less than the
configured value for the DLC check will be discarded. Messages with the same DLC or
greater DLC will be received and forwarded to CanNm.
However, the maximum number of bytes that is evaluated from the received message is
equal to the ‘Pdu Length’ setting of the corresponding channel. For messages with a
length n smaller than ‘Pdu Length’, the bytes n … (‘Pdu Length’ - 1) are considered as
being zero.
Examples:
The length of a received message is 8, ‘Pdu Length’ is configured to 6. In this case, the
last two user data bytes are not further processed by CanNm (e.g. CanNm_GetUserData
does not return data for these two bytes).
The length of a received message is 4, ‘Pdu Length’ is configured to 6. In this case, bytes
4 and 5 are considered as being zero (e.g. CanNm_GetUserData returns 0 for these
bytes).
The minimum required number of bytes for a received NM message that should be
processed by CanNm may be configured by using the CanIf DLC Check feature [2].
If the ‘CanIf Range Config DLC Check’ setting is enabled, either the CanIf DLC feature
must be enabled to accept only NM messages with a DLC greater than or equal to the
‘Pdu Length’ setting or there must not be any ECU that sends NM messages with a DLC
less than the ‘Pdu Length’ setting. Otherwise, the behavior of the CanNm will be arbitrary.
3.7 Node Detection
In order to detect which nodes are currently present within the network, this mechanism
can be used. If a network node requests node detection, the requesting node performs a
transition to Repeat Message State and sets the Repeat Message Bit within the NM PDU.
Upon reception of the Repeat Message Bit all network nodes perform a transition to
Repeat Message State. This allows the requesting node to collect all source node
identifiers from active nodes.
The local source node identifier can be retrieved by the service
CanNm_GetLocalNodeIdentifier() (5.3.2.6.3)
The source node identifier from the last received message can be retrieved by the service
CanNm_GetNodeIdentifier() (5.3.2.6.2)
Caution
An ECU shall not shut down if the NM PDU transmission ability is disabled.
Caution
The ‘Coordinator Synchronization Support’ requires the Control Bit Vector.
Therefore this feature has to be enabled if the Coordination Synchronization Support is
used.
Service ID Service
0x03 CanNm_NetworkRelease
0x04 CanNm_SetUserData
0x05 CanNm_GetUserData
0x06 CanNm_GetNodeIdentifier
0x07 CanNm_GetLocalNodeIdentifier
0x08 CanNm_RepeatMessageRequest
0x0A CanNm_GetPduData
0x0B CanNm_GetState
0x0C CanNm_DisableCommunication
0x0D CanNm_EnableCommunication
0x13 CanNm_MainFunction
0x14 CanNm_Transmit
0x16 CanNm_ConfirmPnAvailability
0x17 CanNm_SetSleepReadyBit
0x40 CanNm_TxConfirmation
0x42 CanNm_RxIndication
0xC0 CanNm_RequestBusSynchronization
0xD0 CanNm_CheckRemoteSleepIndication
0xF1 CanNm_GetVersionInfo
Table 3-6 Service IDs
3.12.1.1 Det_ReportError
Development errors are reported by the service
Det_ReportError() (5.4)
Please refer to the documentation of the development error tracer [5] for further
information and a detailed description of the API. The module Id, API Ids and error Ids can
be found within the software components’ header file.
The errors reported to DET are described in the following table:
Error Code Description
0x01 CANNM_E_NO_INIT API service used without module initialization.
0x02 CANNM_E_INVALID_CHANNEL API service used with wrong channel handle.
0x03 CANNM_E_INVALID_PDUID API service used with wrong PDU ID
0x04 CANNM_E_NET_START_IND Reception of NM Message in Bus Sleep Mode
0x05 CANNM_E_INIT_FAILED CAN NM initialization has failed.
0x11 CANNM_E_NETWORK_TIMEOUT NM-Timeout Timer has abnormally expired
outside of the Ready Sleep State.
CANNM_E_RXINDICATION_DLC_
CANNM_E_PDUR_TRIGGERTX_ER
Check
CANNM_E_INVALID_CHANNEL
CANNM_E_NETWORK_TIMEOUT
CANNM_E_INVALID_PDUID
CANNM_E_NET_START_IND
CANNM_E_NULL_POINTER
CANNM_E_INIT_FAILED
CANNM_E_NO_INIT
ERROR
Service ROR
5
CanNm_Init
6
CanNm_PassiveStartUp
6,7
CanNm_NetworkRequest
6,7
CanNm_NetworkRelease
7 6,7 7
CanNm_SetUserData
6,7
CanNm_GetUserData
6,7
CanNm_GetPduData
5,7 6,7
CanNm_RepeatMessageRequest
6,7
CanNm_GetNodeIdentifier
6,7
CanNm_GetLocalNodeIdentifier
3
Error does not apply to the function CanNm_Init.
4
Vector extension
5
Only checked if CANNM_DEV_ERROR_DETECT is STD_ON
6
Only checked if CANNM_OPTIMIZE_CHANNEL_ENABLED is not defined (‘Api Optimization’ is OFF)
CANNM_E_RXINDICATION_DLC_
CANNM_E_PDUR_TRIGGERTX_ER
Check
CANNM_E_INVALID_CHANNEL
CANNM_E_NETWORK_TIMEOUT
CANNM_E_INVALID_PDUID
CANNM_E_NET_START_IND
CANNM_E_NULL_POINTER
CANNM_E_INIT_FAILED
CANNM_E_NO_INIT
ERROR
ROR
Service
7 6,7
CanNm_RequestBusSynchronization
7 6,7 7
CanNm_CheckRemoteSleepIndication
6,7
CanNm_GetState
5
CanNm_GetVersionInfo
7 7 5,7
CanNm_Transmit
7 6,7,7
CanNm_EnableCommunication
7 6,7
CanNm_DisableCommunication
6,7
CanNm_ConfirmPnAvailability
6,7
CanNm_SetSleepReadyBit
5 5
CanNm_RxIndication
6,7 5 5
CanNm_MainFunction
7 5,7
CanNm_TxConfirmation
Table 3-8 Development Error Reporting: Assignment of checks to services
7
Only checked if CANNM_PASSIVE_MODE_ENABLED is STD_OFF
NM updates its transmission buffer each time before sending a NM message with the
current data. Therefore it calls the function:
PduR_CanNmTriggerTransmit() (5.4)
When the NM message has been successfully transmitted the confirmation is forwarded to
PduR by calling the function:
PduR_CanNmTxConfirmation() (5.4)
Depending on the signal and I-PDU configuration a signal change can lead to a request for
an immediate NM message transmission by calling the function
CanNm_Transmit() (5.3.2.9.1)
The CAN NM then transmits the changed data in the next main function when the
transmission of NM messages is allowed. Afterwards the message cycle timer is restarted,
i.e. the cyclic message transmission raster changes.
The spontaneous transmission through CanNm_Transmit is allowed in the NM states
Repeat Message and Normal Operation if and only if
> ‘Pn Enabled’ is ON and ‘Pn Handle Multiple Network Requests’ is OFF AND/OR
> ‘Car Wake Up Rx Enabled’ is ON.
Behavior with CanNm_Transmit usage
0
... Repeat Message Normal Operation t
CanNm_Transmit CanNm_Transmit
Msg Cycle Offset Msg Cycle Time Msg Cycle Time Msg Cycle Time
...
NM Message Transmissions
Figure 3-3 Immediate Transmission due to Signal Change inside User Data I-PDU
The following chapters describe more detailed the configuration preconditions of this
feature.
Note that some additional configuration for this feature has to be done in the PDU Router.
Refer to [10] for details.
3.13.1 Configuration Preconditions in an AUTOSAR ECU Configuration
For using the feature ‘Com User Data Support’ some additional configuration content
within the AUTOSAR system description / ECU Extract is necessary. The following table
provides an overview of the items that have to be added to the system description.
Configuration Element Description
Signal I-PDU For each NM message one signal I-PDU must be configured. An
appropriate signal mapping to the I-Signals has to be defined here. I-
PDUs are defined in the ECU-specific part.
Additionally, a reference from the NM PDU to the related I-PDU with the signals must be
established by adding ‘ISignalToIPduMappings’ to the NM PDU. The following example
demonstrates how this should be done:
<NM-PDU>
<SHORT-NAME>NM_PDU</SHORT-NAME>
<LENGTH>8</LENGTH>
<I-SIGNAL-TO-I-PDU-MAPPINGS>
<I-SIGNAL-TO-I-PDU-MAPPING>
<SHORT-NAME>NM_USR_DT </SHORT-NAME>
<I-SIGNAL-REF DEST="I-
SIGNAL">/ISignal/NM_USR_DT_SIGNAL</I-SIGNAL-REF>
<PACKING-BYTE-ORDER>MOST-SIGNIFICANT-BYTE-LAST</PACKING-
BYTE-ORDER>
<START-POSITION>32</START-POSITION>
</I-SIGNAL-TO-I-PDU-MAPPING>
</I-SIGNAL-TO-I-PDU-MAPPINGS>
</NM-PDU>
NM messages CAN NM uses a faster NM message cycle time. Afterwards it uses the
normal NM message cycle time. This behavior is illustrated in Figure 3-4.
Behavior with n := Immediate Nm Transmissions > 0
Immediate Nm Immediate Nm
... Immediate Nm Msg Cycle Time
...
CycleTime CycleTime CycleTime
NM Message Transmissions
Figure 3-4 Immediate Nm Transmissions
The number of ‘Immediate Nm Transmissions’ is the number that is configured for this
parameter. As it can be seen in Figure 3-4, after the first Immediate Nm Transmission the
interval between the NM messages is ‘Immediate Nm CycleTime’ for (n-1) times. Then, the
usual interval ‘Msg Cycle Time’ is used again.
Note that “Any state except Repeat Message” in Figure 3-4 refers to ‘Bus Sleep’ and
‘Prepare Bus Sleep’. If the setting ‘Pn Handle Multiple Network Requests’ is ON, it also
refers to ‘Ready Sleep’ and ‘Normal Operation’.
This feature is optional and has to be enabled in the configuration. The amount of
messages that are transmitted faster (‘Immediate Nm Transmissions’) and the fast
message cycle time (‘Immediate Nm Cycle Time’) can also be configured.
Note
This feature should not be confused with the possibility for an immediate transmission if
the ‘Com User Data Support’ feature is on (chapter 3.13) and should also not be
confused with the ‘Immediate Restart Enabled’ feature described in the following
chapter.
Note
If the send request of an ‘immediate transmission’ is rejected by the lower layer (e.g.
CanIf), the rejected send request is not considered as ‘immediate transmission’. That
means that the counter that counts the number of ‘immediate transmissions’
ImmediateNmMsgCount is not decremented.
Example: Let ‘Immediate Nm Transmissions’ := 2. The initial counter value of
ImmediateNmMsgCount is 1.
1. When Repeat Message has just been entered, the first transmission request
TReqA is rejected. ImmediateNmMsgCount is not decremented.
2. CanNm waits ‘Immediate Msg CycleTime’ (first interval tint1st).
3. CanNm sends the NM message successfully. ImmediateNmMsgCount is
decremented to 0.
4. CanNm waits ‘Immediate Msg CycleTime’ again (second interval tint2nd).
5. CanNm sends the next NM message successfully.
6. Then ‘Msg Cycle Time’ is waited until the next NM message is sent because
ImmediateNmMsgCount is already 0.
If the first NM transmission request TReqA was successful (step 1), the second interval
time tint2nd would be ‘Msg Cycle Time’ instead of ‘Immediate Msg CycleTime’.
NM Message Transmissions
Figure 3-5 Behavior for NM Transmissions if Immediate Restart Enabled is ON
This behavior is depicted in Figure 3-5. Note that the only difference to the standard
transmission behavior (i.e. ‘Immediate Restart Enabled’ would be OFF, for the behavior
see also chapter 3.6.3) is the additional NM message right after Repeat Message has
been entered.
Note
The additional NM message is only sent if the ‘Msg Cycle Offset’ setting is greater than
0 and if ‘Immediate Nm Transmissions’ = 0 (refer to chapter 3.15 for details).
3.17.2 Tx-Path
For the transmission of the Car Wake-up Bit it has to be set at the corresponding location
within the NM user data. If the feature ‘Com User Data Support’ is used and the
corresponding signal and I-PDU are configured for directly transmitting a changed signal
the information is sent immediately. Refer also to chapter 3.13 ‘Com User Data Support’.
Info
It is recommended to use the feature ‘Com User Data Support’ for the transmission
path.
combined to one aggregated state. Therefore this state contains the information which
partial networks are active on the whole ECU.
The ERA algorithm performs the evaluation of the received NM messages and storage of
the relevant PN information (according to the PN filter mask and the CRI bit) per network.
Therefore the ERA state contains for each network the information which partial networks
are requested by other ECUs and have to be active due to external needs.
Whenever a cluster is requested the first time (i.e. a bit is set the first time within this PN
information) the new request is stored and a timer is started. When the request is repeated
before the timer elapses the timer is restarted. When the timer elapses the request is
deleted.
Any change (storing or deleting a request) within the EIRA or ERA leads to an update of
the content of the EIRA or ERA I-PDU in the Com. Therefore the following function is
called with the corresponding EIRA or ERA PDU handle:
PduR_CanNmRxIndication() (5.4)
Note that one ERA I-PDU exists for each network.
3.18.5 Spontaneous Sending of NM Messages
When a new PN is internally requested the corresponding bit in the NM message user
data will be set. This request must be immediately visible on the bus by sending the
updated user data content as fast as possible. Therefore two mechanisms can be used.
3.18.5.1 Using Com Transmission on Change Mechanism
When the NM user data is set via Com the signals can be configured for immediate
transmission on change. This would lead to one additional NM message transmission
whenever the content of the signal changes. Refer also to chapter 3.13 ‘Com User Data
Support’.
To enable this behavior, the setting ‘Pn Handle Multiple Network Requests’ has to be
turned OFF.
3.18.5.2 Using NM Request and Immediate Nm Transmission
When CAN NM is in Network Mode and the upper layer requests network again by calling
the function ‘CanNm_NetworkRequest’ (see chapter 5.3.2.4.1‘CanNm_NetworkRequest:
Request the Network’ for details) the CAN NM performs a state transition to Repeat
Message. This leads to an immediate transmission of the NM message followed by
several transmissions with a faster cycle time.
Caution
Note that the feature ‘Immediate Nm Transmission’ (refer to chapter 3.15 ‘Immediate
Nm Transmissions’) must be enabled when using this mechanism for spontaneous
sending of NM messages.
4. Integration
This chapter gives necessary information for the integration of the MICROSAR CANNM
into an application environment of an ECU.
«include»
PduR_CanNm.h CanNm.c
«include» «include»
«include»
CanNm.h
«include» «include»
«include» «include»
«include»
ComM_Types.h ComM_Nm.h
«include»
Note
In an AUTOSAR environment where the BSW Scheduler (SchM) is used the main
functions are called by the SchM and must not be called by the application.
5. API Description
These constants are declared as external and can be read by the application at any time.
5.2.3 Vendor and Module ID
CAN NM provides the vendor identifier according to AUTOSAR as defines:
Functional Description
Main function of the CanNm which processes the NM algorithm. This function is responsible to handle all
CanNm instances. (CANNM234).
Particularities and Limitations
> Service ID: see table 'Service IDs'
> This function is non-reentrant.
> This function is synchronous.
> This function is called by SchM.
Expected Caller Context
> Task level
Table 5-5 CanNm_MainFunction
Return code
- -
Functional Description
CanNm_GetVersionInfo() returns version information, vendor ID and AUTOSAR module ID of the
component.
The versions are BCD-coded.
Particularities and Limitations
> Service ID: see table 'Service IDs'
> This function is reentrant.
> This function is synchronous.
> This function is available if CANNM_VERSION_INFO_API is STD_ON
Expected Caller Context
> Task level
Table 5-7 CanNm_GetVersionInfo
Return code
Std_ReturnType E_OK - No error
E_NOT_OK - Getting the PDU data has failed
Functional Description
Get the whole PDU data out of the last NM message received from the bus (CANNM138).
Particularities and Limitations
> Service ID: see table 'Service IDs'
> This function is reentrant.
> This function is asynchronous.
> This function is called from NM Interface.
Expected Caller Context
> Task and interrupt level
Table 5-14 CanNm_GetPduData
Parameter
nmChannelHandle Index of the network channel
nmRemoteSleepIndPtr Pointer where PDU Data out of the most recently received NM message shall
be copied to
Return code
Std_ReturnType E_OK - No error
E_NOT_OK - Checking remote sleep indication has failed
Functional Description
Check if remote sleep was indicated or not (CANNM227).
Particularities and Limitations
> Service ID: see table 'Service IDs'
> This function is reentrant.
> This function is synchronous.
> This function is called from NM Interface
Expected Caller Context
> Task and interrupt level
Table 5-19 CanNm_CheckRemoteSleepIndication
Return code
Std_ReturnType E_OK - No error
E_NOT_OK - Enabling NM Message transmission control status has failed
Functional Description
Enable NM message transmission control status (CANNM216).
Particularities and Limitations
> Service ID: see table 'Service IDs'
> This function is reentrant.
> This function is asynchronous.
> This function is called from NM Interface
Expected Caller Context
> Task and interrupt level
Table 5-22 CanNm_EnableCommunication
8
Service only used if the feature ‘Passive Mode’ is disabled
9
Service only used if ‘Immediate Tx Conf Enabled’ is disabled and ‘Pn Enabled’ is enabled and if CanSM
provides this function
10
Service only used if the feature ‘Dev Error Detect’ is enabled
11
Service only used if the feature ‘Car Wake Up Rx Enabled’ is enabled.
12
Service only used if the feature ‘Coordinator Sync Support’ is enabled.
13
Service only used if the feature ‘Pdu Rx Indication Enabled’ is enabled.
14
Service only used if the feature ‘Bus Nm Specific Pdu Rx Indication Enabled‘ is enabled in NmIf.
15
Service only used if the feature ‘Remote Sleep Ind Enabled’ is enabled.
16
Service only used if the feature ‘Repeat Msg Ind Enabled’ is enabled.
17
Service only used if the feature ‘State Change Ind Enabled’ is enabled.
18
Service only used if the feature ‘Immediate Tx Conf Enabled’ is enabled.
19
Service only used if the feature ‘Com User Data Support’ is enabled.
20
Service only used if the feature ‘Immediate Txconf Enabled’ is disabled.
21
Service only used if the features ‘Pn Eira Calc Enabled’ or ‘Pn Era Calc Enabled’ is enabled.
6.1 Glossary
Term Description
Confirmation Notification by the data link layer on asynchronous successful
transmission of a CAN message
Identifier Identifies a CAN message
Indication Notification by the data link layer on asynchronous reception of a CAN
message
Message One or more signals are assigned to each message.
Signal Signals describe the significance of the individual data segments within a
message. Typically bits, bytes or words are used for data segments but
individual bit combinations are also possible. In the CAN database, each
data segment is assigned a symbolic name, a value range, a conversion
formula and a physical unit, as well as a list of receiving nodes.
Table 6-1 Glossary
6.2 Abbreviations
Abbreviation Description
API Application Programming Interface
AUTOSAR Automotive Open System Architecture
BswM Basic Software Mode Manager
CAN Controller Area Network
CanIf Can Interface
CCL Communication Control Layer
ComM Communication Manager
CRI Partial Network Cluster Request Information
DET Development Error Tracer
DEM Diagnostic Event Manager
DLC Data Length Code (Number of data bytes of a CAN message)
DLL Data link layer
ECU Electronic Control Unit
EIRA External Internal Requests Aggregated
ERA External Requests Aggregated
FIBEX Field Bus Exchange
ID Identifier (of a CAN message)
IL Interaction Layer
7. Contact
> News
> Products
> Demo software
> Support
> Training data
> Addresses
www.vector.com