In the previous article, we analyzed the PN function from the CanNM module, and in this article, we analyzed it from the ComM module. Because the PN function of network management is mainly controlled by these two modules. If you do not know the relationship between the CanNM module and PN, you can refer to the previous Autosar network management: Partial Networking from the CanNM module.

For the communication state of each PNC (partial network cluster), the ComM module has an independent set of state machines for management. When CanNM gets the NM PDU from the CanIf layer, it disassembles the part of User Data independently, and sends it to the ComM module in the form of signals through PDUR and COM. Why disassemble the User Data part independently? Because the User Data section contains the PNC information, the information depends on the project requirements: how much User Data space is opened up as many PNCs are needed. That is to say, the PNC information acquired by the ComM corresponds to the User Data in the NM PDU in one-to-one correspondence.

Enabling or disabling the PNC, the final performance is whether the Node (or Channel) associated with the PNC is allowed to communicate or not. We know that the sending/closing of the application message (Pdu corresponding to the Com layer) is controlled by BswM. If the PNC received by the ECU is associated with a corresponding channel, the ComM module will make a communication request (perform state switching), and the BswM obtains the request After the information, enable or disable the communication of the I-PDU groups corresponding to the Com layer.

1

ComM manages PNC

Earlier we said that to enable the PN function, the CanNmPnEnabled parameter needs to be turned on in the CanNM module, and the configuration parameter needs to be set in the ComM module.

ComMPncSupport

Open. In Autosar, it is stipulated that CanNmPnEnabled and ComMPncSupport need to be stored in NVM for the use of diagnostic services, but in actual project development, whether to implement this depends on the specific project requirements.

ComM manages the switching of each PNC state. When the state is switched, it needs to notify the BswM through the interface BswM_ComM_CurrentPncMode(), so that the BswM can communicate with the Com layer.

I-PDU groups

control of communications. Before ComM controls each PNC state machine, it first needs to obtain the PNC information of the corresponding Channel, and the PNC information obtains the ERA signal or EIRA signal through the standard signal interface of the Com layer. If the signal is multi-byte, it is generally configured as a uint8_n type at the Com layer. Autosar specifies that the signal corresponding to PNC can contain a maximum of 56 PNC status bits. How does the maximum 56 come from? For a classic CAN frame, a PDU carries up to 8 bytes of valid data. In the CanNM module,CBV bytes are required, and NodeID is optional, so there can be up to 7 bytes of User Data at the CanNM level, so ComM can control up to 7*8 = 56 PNCs. Although NodeID is optional in CanNM, it is still necessary to identify and filter NM PDUs. When NodeID is optional in CanNM, you can rely on the xxIf layer or the driver layer to filter and identify NM PDUs. It is sent to the xxIf layer, and the xxIf layer is responsible for sending the PDU to the corresponding upper layer by identifying the ID, such as: xx_TP layer, xx_NM layer, etc.

It has been said that ComM obtains the corresponding PNC information through the signal. Here we will talk about it in detail. For ComM, it obtains the EIRA or ERA signal, and the two signals are independent. Either one or both can be used, and ComM is obtained through the Com_ReceiveSignal() interface.

Since ComM will receive the signal, of course, it will also send the PNC status information to the corresponding communication bus through the signal.

The ComM module can handle the reception of EIRA or ERA signals, but the transmission can only handle EIRA signals.

2

ComM PNC state machine For each Partial Network, there will be one PNC state machine, because there can be up to 56 PNCs, so ComM can manage up to 56 PNC state machines. Note: The Channel of the PNC and ComM layers is not a concept, and the Channel of ComM corresponds to the specific number of physical buses.

In the ComM module,

A Channel can correspond to one PNC or multiple PNCs

The PNC state machine managed by ComM includes two modes: PNC_FULL_COMMUNICATION and PNC_NO_COMMUNICATION. PNC_FULL_COMMUNICATION mode contains three sub-states: PNC_PREPARE_SLEEP, PNC_READY_SLEEP, PNC_REQUESTED.

Interpret the state behavior in the above figure:

PNC_NO_COMMUNICATION Primary Status Behavior

When the system is powered on, the default state of PNC is PNC_NO_COMMUNICATION. If a PNC enters the PNC_NO_COMMUNICATION state and does not receive an internal or external request, the state does not jump. (1)

The EcuM or NM module calls the ComM_EcuM_WakeUpIndication() interface, and the configuration parameter ComMSynchronousWakeUp = TRUE

, the state of PNC is switched from PNC_NO_COMMUNICATION to PNC_FULL_COMMUNICATION::PNC_PREPARE_SLEEP state. And the ComMPncPrepareSleepTimer (

ComMPncPrepareSleepTimer

> 0) Start, and notify BswM at the same time, PNC state switch.

(2) The EcuM module calls the ComM_EcuM_WakeUpIndication() interface, and the configuration parameter ComM_PncWakeUpEnabled = TRUE

, The state of PNC is switched from PNC_NO_COMMUNICATION to PNC_FULL_COMMUNICATION::PNC_PREPARE_SLEEP state. And the ComMPncPrepareSleepTimer corresponding to the PNC is started (ComMPncPrepareSleepTimer

> 0), and notify BswM at the same time, PNC state switch.

(3) If the PNC request signal is received (at least one bit is set in EIRA), the state of the PNC is switched from PNC_NO_COMMUNICATION to PNC_FULL_COMMUNICATION::PNC_READY_SLEEP state.

(4) If ComMUser calls the ComM_RequestComMode() interface to request FULL_COMMUNICATION, the state of PNC is switched from PNC_NO_COMMUNICATION to PNC_FULL_COMMUNICATION::PNC_REQUESTED state.

(5)

If PNC request signal is received (at least one bit is set in ERA)

,AND

ComMPncGatewayEnabled= TRUE

,AND

ComMPncGatewayType != NONE

. The state of PNC is switched from PNC_NO_COMMUNICATION to PNC_FULL_COMMUNICATION::PNC_REQUESTED state.

PNC_FULL_COMMUNICATION main state behavior

In this state, all channels associated with this PNC enter the Full Communication state.

Enter the PNC_REQUESTED sub-state condition:

ComMUser requests COMM_FULL_COMMUNICATION for this PNC;

The PNC in the ERA signal is set and this PN is synchronized.

Enter the PNC_PREPARE_SLEEP sub-state condition:

The received EIRA signal PNC is not set;

EcuM notifies ComM that a Passive wake-up event occurs, and it is a synchronous wake-up, and ComMPncPrepareSleepTimer > 0.

Enter the PNC_READY_SLEEP sub-state condition:

All ComMUsers of this PN request COMM_NO_COMMUNICATION, AND the received EIRA signal PNC is set, AND all ERA signals PN are not set, and this PN is synchronized.

3

PNC Gateway

To enable the gateway function of PNC, you need to configure parameters in ComM

ComMPncGatewayEnabled = TRUE

. The default gateway type is: COMM_GATEWAY_TYPE_ACTIVE. There are two types of PNC gateways: Active PNC Gateway and Passive PNC Gateway.

ComM exchanges PNC information with other ECUs through ERA or EIRA. For ERA,

Only when the PNC gateway function is enabled

Available when assigned to multiple ComM channels

. Each PNC uses the same bit position in the bit vector, defined by the PNC ID. For example: define PNC1 and PNC2, both of which are 2 bytes in length, where bit0 indicates whether the specified Channel associated with an ECU is or not.

ComM is responsible for coordinating the gateway behavior of the network,Right nowWill PNC Activation RequestRouting from one channel to other channels.Routing is done by sending the EIRA TX signalThe routing of a channel depends on the gateway type of the channel

PNC request in Passive channel

If a request with ERA=1 is received on a channel with gateway type PASSIVE, the request will not be mirrored back to that channel, i.e. the request will not be set in the EIRA Tx signal and will not be routed to a channel with gateway type PASSIVE . Requests are only routed to channels with gateway type ACTIVE.

PNC request on active channel

If a PN request is received with ERA=1 on a channel with gateway type ACTIVE, the request is mirrored back to this channel and routed to all other coordination channels.

PNC requests on a channel with gateway type NONE

If a request is received with ERA=1 on a channel with gateway type NONE, the request is not stored in the internal ComM ERA signal, i.e. the PNC request is ignored. Therefore, the request is not mirrored back to this channel, nor routed to any other channel, i.e. the request is not set in the EIRA transmit signal. Channels with gateway type NONE ignore PNC requests received via the ERA signal, but they handle PNC requests received via the EIRA Rx signal. In this case, the target PNC state is not affected by PNC requests received via ERA, but state changes are made via PNC requests received with EIRA=1.


Reviewing Editor: Liu Qing

Leave a Reply

Your email address will not be published.