BswM-ManagerProcess-Cycle in Autosar

Basic Software Mode Manager In AUTOSAR – BswM

Introduction To BswM In AUTOSAR

The BswM stands for Basic Software Mode Manager Module in AUTOSAR. The BswM Module is present in the System service of Service Layer. The service layer is the higher layer of the BSW Layer in AUTOSAR architecture.

In this article, you will be learning the BSWM module in AUTOSAR. You will get to know what is BswM in AUTOSAR. How does BswM work in the AUTOSAR Software Architecture? etc.

How does BswM Works in AUTOSAR

The main purpose of the BswM module in AUTOSAR is to handle the vehicle and application mode management. In a simple way, we can say that it is responsible for the Basic Software and Application Software component’s Mode Arbitration and Mode Control. The BSWM function is to arbitrate the mode requests from any SW-Cs of the Application Layer or any BSW modules. The Mode arbitration is done using a simple rule defined in the BSWM document. After the arbitration completion of any requests, it performs the actions based on the arbitration results.

Functions Of BswM In AUTOSAR

The BswM is used to enable and disable any routing groups of I-PDUs in the PDUR Module. The Communication protocol-specific SM(State Manager) module (CAN-SM or LIN-SM etc.) related mode switch indications go to the SW-Cs through the BSWM. BSWM is also responsible for some more actions related to the BUS-specific SM’s.

The DCM performs the mode requests to the BswM based on the diagnostic requests it receives from another ECU or any external diagnostic test computer by the tester. BSWM will use the NM interfaces to control the NM communication based on the current BSW mode. BswM has actions causing the NvM to read and write of all blocks during startup and shutdown.

AUTOSAR BswM Mode Arbitration

The Mode arbitration part initiates the mode switches resulting from the rule-based arbitration of Mode requests and the Mode indications received from SW-Cs or any other BSW modules. The Mode arbitration rules are used to execute the actions first. This is basically used for priority purposes. The total software is having a lot of tasks. But all tasks are can not be executed simultaneously, because of the limited or same resources that might be used by multiple tasks.

BSWM has two main tasks that are Mode arbitration and Mode control. The mode is nothing but the current state of a global variable "Startup.Run.Post-Run.Sleep".

There are two methods to process the arbitration mode.

Immediate Operation Arbitration Mode

It executes immediately within the context of a mode request or indication.

Deferred Operation Arbitration Mode

It executes periodically during the main function of BSWM.

This model depends on the configuration done in the BSW layer.

  • BswM Mode request Port
  • BswM Mode Conditions.
  • BswM Mode Logical Expressions.
  • BswM Mode standard Rules.
  • BswM Mode Actions Lists.
  • BswM Mode Actions.

Arbitration Rule Code:

if(MyModeRequestPort == MODE_A && ComMinitiateReset == IS_SET)
{
      Execute the True Actions List;
}
else
{
      Execute the False Actions List;
}

BswM Mode Request Handling

The Mode requester will be having a Mode Declaration Group (MDG) that has a list of all the available modes. The Mode requester SWC requests mode ‘A’ by its sender port, then the RTE distributes the request and the BswM receives it through its Receiver Port.

The BswM evaluates its rules either as a result of a received mode arbitration request, or cyclically during the execution of the BswM main() function. The corresponding Action List will be executed according to the selected execution method. It might be “Triggered” or “Conditional” action lists.

When the actions lists will be executed, the BswM may made one or several calls to the RTE switch API as actions to inform the affected SWCs, about the arbitration result. Any SWC, especially the mode requester also can register to receive the mode switch indications.

AUTOSAR BswM Mode Control

The function of the Mode Control of BswM is to perform all the required actions based on the results of the mode arbitration. This is done by the task actions table nothing but the actions list. This actions list can be controlled or executes by the Mode control. But the control module will trigger it as per the Mode arbitration invoking rules.

This actions table is divided into 3 types of actions list.

  • Calls to other BSW modules or the RTE.
  • Links to other action lists to be included in the execution.
  • Mode arbitration rules. These rules will be evaluated when the corresponding action list is executed. In this way, a hierarchy of rules is obtained.

When any mode will change its state in any module of the BSW layer, they will notify it to the BSWM module of their current state. This will be used further for the Mode arbitration purpose. If it returns E_NOT_OK with the return value, the DET will trigger a run time error or can also cancel the current executing actions list.

Bsw Mode Control Actions List

Mode Processing Cycle In AUTOSAR BswM

The Mode processing cycle is a process for how to request and change the mode of a component. This component is called as Mode Requester Software Component (SW-C).

  1. The Mode Requester SW-C requests mode A through its Sender Port. The RTE distributes the request and the BswM receives it through its Receiver Port.
  2. The BswM evaluates its rules either as a result of a received mode arbitration request, or cyclically during the execution of the BswM main function.
  3. The corresponding Action List is executed according to the selected execution method. This is generally done by the Triggered and Conditional action lists.
  4. When executing any Action List, the BswM may issue one or several calls to the RTE Switch API. Because, it needs to take the actions to inform the affected SW-Cs about the arbitration result. Any SW-C, especially the mode requester can register to receive the mode switch indications. Remember that the mode requester can only receive the mode switch indications from the local BswM; this is true also for requests that originate from a different ECU that is made by a local proxy SW-C.
BswM-ManagerProcess-Cycle in Autosar

BswM Manager Ports And Interfaces:

There are different Interfaces and ports that are provided by the BswM Manager to be used by other components. It has two types of Ports used in BswM.

  • Mode Request Ports:
  • Mode Switch Ports:
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
Scroll to Top