AUTOSAR CAN State Manager

CAN State Manager (CanSM) – AUTOSAR BSW

CAN State Manager (CanSM) is a submodule of CAN communication. This is a part of the Communication Service Layer in the AUTOSAR Basic Software (BSW) module. This tutorial describes th

e CAN protocol communication state management in AUTOSAR architecture. Then AUTOSAR Group management has defined a couple of rules that have been implemented in the CAN SM module. So that it will help in the automotive vehicle how practically an ECU can be managed well to work seamlessly within a CAN network. It also helps in battery power consumption by controlling the CAN controller in multiple low power modes.

Introduction to CAN State Manager (CanSM) module

An ECU can have different communication networks in a vehicle. Each and every network has to be identified with a unique network handle. The ComM module requests communication modes from the networks. It will get to know by its configuration done in AUTOSAR tools, which handle is assigned to what kind of network. In the case of CAN, it uses the CanSM module. The CAN State Manager Specification defines the main function of this module.

Functions Of CAN State Manager (CanSM)

The main purpose of the CAN State Manager module is to handle the control flow abstraction of the CAN network. You can say technically, the CanSM used to modify the communication modes of the CAN network. There are different types of CAN communication modes defined in AUTOSAR layered software architecture. The CanSM will change these modes as per the request from the Communication Manager (ComM) module.

CAN State Manager (CanSM) Interface

The total CAN State Manager functionality is being implemented in the CanSM module of AUTOSAR. The CanSM communication interface is in between the Communication Manager (ComM) and CAN Interface (CanIf) module. Basically, the CanSM receives the requests from the ComM module, processes them as per the condition and input requests, and then sends the command to CAN Interface (CanIf) for execution. Because the CAN interface module is available in the ECU abstraction layer that can control the CAN controller states via CAN drivers implemented in Microcontroller Layer (MCAL).

The CAN State Manager uses the API of the CAN Interface (CanIf) module. The CanIf module is responsible for the control of CAN controllers and CAN transceivers configured for that particular request. If there is any change in the mode CAN controllers or CAN transceivers, that will be notified to the CAN CanSM module for further action. The CAN CanSM will change the CAN configuration for each network, depending on the notification received from the CanIf module and CAN network States from the CAN Network Management module. The CanSM module will notify the Communication Management (ComM) module and the Basic Software Management (BswM) module about this change.

CanSM Dependent Interface Modules

In the AUTOSAR BSW layer, there are a lot of modules that are interfacing with each other to make a communication between the ECU hardware and the Run-Time Environment (RTE) layer. That communication might be sender-receiver or Client-Server type communication or it can also be a call back function type. The CAN State Manager module is also having some dependent modules through which it is able to communicate between the CAN application code and CAN hardware for its operation as per defined specification implemented. These are:

  • ECU Manager Module (EcuM).
  • Scheduler Manager (SchM).
  • Communication Manager (ComM).
  • CAN Interface Manager (CanIf).
  • Diagnostic Event Manager (DEM).
  • Basic Software Manager (BswM).
  • CAN Network Manager (CanNM).
  • Default Error Trace (DET).
CanSM Dependencies
AUTOSAR CanSM Schematic Interface with Other Modules

CanSM Interface With BSW EcuM

The EcuM module initializes the CanSM module and interacts with the CAN State Manager module for the CAN wake-up validation.

CanSM Interface With BSW SchM

The BSW Scheduler Module used to schedule and call the CAN State Manager Main function. The CanSM will get called periodically by the Basic Software Scheduler Manager (SchM) as per the configured time period.

CanSM Interface With BSW ComM

The main purpose of Basic Software Communication Manager with CAN State Manager is to use the APIs of the CanSM module to request communication modes of CAN networks. Each CAN network is having a unique CAN network handler that can be handled by CAN handler Identifier. The CanSM has also notified the current communication mode of its CAN network to the Communication Manager.

CanSM Interface With BSW CanIf

Basically, the CAN State Manager uses the CAN Interface module APIs to control the operating modes of each CAN Controller and Transceiver. The CAN Interface module is also notified about any interrupt events from the CAN network to CanSM.

CanSM Interface With BSW DEM

The CAN State Manager reports about any faults to Diagnostic Event Management module. So that the DEM module will set any DTC related to it, if it is required.

CanSM Interface With BswM

The CAN State Manager is responsible to notify any BUS-specific mode changes to the Basic Software Management module.

CanSM Interface With CanNM

The CAN State Manager module is also responsible for any kind of partial network availability notification to the CAN Network Management module. It also handles the partial network notified CanNm timeout exceptions.

CanSM Interface With DET

The CAN State Manager will report to Default Error Trace (DET) about any development and run time CAN errors if it is enabled in configuration time.

CAN State Manager (CanSM) State Machine

  • Normal State.
  • Standby State.
  • Sleep State.
  • Stop State.
CAN State Manager State Machine

In the above figure, it shows that how and when the CAN State Manager changes its states from one mode to another mode. Basically, it depends upon the particular CAN controller and transceiver module.


Discover more from PiEmbSysTech

Subscribe to get the latest posts sent to your email.

Leave a Reply

Scroll to Top

Discover more from PiEmbSysTech

Subscribe now to keep reading and get access to the full archive.

Continue reading