The Partial Networking (PN) function is relatively complex. The realization of the PN function cannot just look at a certain module, because the interactive information between the modules is very important for the switching of the network state. For the PN function, I mainly want to talk about the two modules of CanNM and ComM. In this article, I will start with CanNM. I hope that some concepts can be explained thoroughly, because in actual projects, we may not know much about many configuration items of the tool, which makes us somewhat confused when troubleshooting. Therefore, I want to convey the Autosar information I have interpreted and share it.

hint: Based on CAN bus.

1、Why PN function

Why do you need the PN (Partial Network) function? The essence is to save energy. When there is no PN function, all ECUs in a network segment wake up and sleep together. Sometimes, in a network segment, only some ECUs may be required to work normally, and there is no need to wake up unrelated ECUs (power consumption). Therefore, increasing the PN function is a preferred option for energy saving.

Example:

Network segment without PN function, all ECUs sleep and wake up together. In some working conditions (Condition A), in fact, only ECU2 and ECU4 need to keep working. Because there is no PN function, ECU1, ECU2, ECU3, ECU4, and ECU5 in this network segment are all kept awake, so the cost is power up, as shown below:

Network segment with PN function, Under the same condition of A, ECU2 and ECU4 keep working normally, ECU1, ECU3, ECU5 sleep, compared with the network segment without PN function, the network segment with PN function will be more energy-saving, as shown below:

2、Receive processing of NM PDUs

In embedded, the interaction of any information is nothing more than receiving and sending. The realization of the PN function is no exception. The node receives the network management message, which is the basis for the discussion of the PN function. For the CanNM module, it obtains NM PDUs information through the callback function CanNm_RxIndication() registered in CanIf. After getting the NM PDUs information, the CanNM module starts to disassemble the information, and decides whether to further transmit the information to other modules, such as COM, ComM, NM, etc. by disassembling the information.

In Autosar, the opening of the PN function requires multiple modules to configure the PN parameter options. Let’s talk about the CanNM module first. In the CanNM module, you first need toConfigure the CanNmPnEnabled parameter,Right nowCanNmPnEnabled = TRUE

(1) If the parameter CanNmPnEnabled = FALSE, CanNM directly performs subsequent actions after receiving NM PDUs, that is, notifying the NM module, etc. At this time, the PN function is ignored (invalid). As long as the network management message in the valid range is received (generally, the network management message is specified as a range, such as: 0x500~0x57F), the network can wake up;

(2) The parameter CanNmPnEnabled = TRUE, it cannot be said that the PN function has come into effect. At this time, it is necessary to further judge the parameters CanNmAllNmMessagesKeepAwake and PNI (Partial Network Information Bit) information. The location of PNI in NM PDUs is as follows:

hint: Control Bit Vector is abbreviated as CBV. Like Source Node Identifier (SNI), it generally needs to be configured in the configuration tool, that is, configure the position of CBV and SNI in the PDU.

If PNI = 0 (that is, there is no PN request), there is no further processing of the PN function. At this time, if CanNmAllNmMessagesKeepAwake = TRUE, any valid network management message received will be further processed, which can wake up the node network; if CanNmAllNmMessagesKeepAwake = FALSE , the NM PDUs do not need to be further processed, and the CanNM module directly discards the PDU, that is, the network of the node cannot wake up.

If PNI = 1 (that is, there is a PN request), the CanNM module needs to filter the PNC (Partial Network Cluster) information in User Data, in other words:PN request information is included in User Data. Generally, how much User Data space is used is determined by the number of PNCs. For example, 9 PNCs need to be set, and each PNC occupies one bit, that is, if 9 bits are required, 2 User Data (2 Byte) spaces are required. Filtering has been discussed before, you can refer to Autosar Network Management: CanNM PN function. If the PNC information is filtered and it is found that each bit is not related to the ECU, and CanNmAllNmMessagesKeepAwake = FALSE, then CanNM directly discards the NM PDU. If CanNmAllNmMessagesKeepAwake = TRUE, then the current node network still needs to be woken up.

The location that the PNC information can occupy is as follows (User Data section). If SNI is not used, the User Data can be extended to 7 Bytes, and CBV is configured as the first byte, as shown below:

3、ERA/EIRA

Friends who develop PN functions must be familiar with ERA (External Request Array )/EIRA (External and Internal Request Array ). But can you explain how these two parameters are used? To be honest, I may not have understood it very well, this paragraph is an introduction.

For ERA/EIRA, it can be understood as the state set of the PN request, and the information of this state set is stored in its own Buffer, in short: it can be configured independently.

ERA: It can be understood as an external PN request, for example: after receiving a network management message sent by other ECUs, the PNI is set, and the PNC is valid.

EIRA: It can be understood as an external PN request and an internal PN request. The external PN request is the same as the ERA. The internal PN request can be understood as a PN request forwarded by different channels. For example, an ECU contains two CAN nodes (CAN1 and CAN2), and All can be used as gateway nodes (actually, you need to pay attention to the gateway type). CAN1 receives the network management message, and the corresponding PNC is associated with CAN2. CAN1 can be internally forwarded to CAN2 to wake up the CAN2 network. This is the internal PN request.

The internal request is actually passed to ComM through COM through the signal, which is briefly mentioned here. We will discuss the relationship between ComM and PN later. ERA and EIRA can be regarded as signals, and information is exchanged through the standard transceiver interface of the COM layer. Since it relies on COM, CanNM can be regarded as the underlying module at this time. It is notified to the PDUR through the PduR_CanNmRxIndication() interface, and the PDUR is routed to the COM module. After that, ComM obtains the status information of the PN request through the COM layer signal interface.

PduR_CanNmRxIndication() belongs to the configuration interface, described in Autosar as follows:





Reviewing Editor: Liu Qing

Leave a Reply

Your email address will not be published.