AUTOSAR

Autosar CANNM - Part 1

kkingjae 2024. 6. 17. 19:53

출처 : https://www.youtube.com/watch?v=nzfjxRhtx54

OVERVIEW

CAN NM is module which is present in service layer of AUTOSAR

CAN NM은 autosar의 서비스 레이어에 존재하는 모듈이다.

CAN NM Module is reponsible for initiating wake up and shutdown of CAN Bus and synchronization of all nodes in a cluster.

CAN NM 모듈은 CAN Bus의 wake up 시동과 shutdown, 클러스터안의 모든 노드들의 동기화에 책임이 있다.

In an CAN Node we have 2 types of frames mainly. Application frames, Network Management frames.

우리는 두가지 주요한 타입의 CAN Node(Application frames, Network Management frames)가 있다. 

One CAN Cluster can have many nodes. if a node needs to infrom other nodes that it needs bus communication then it shall transmit periodic Network Management frames.

하나의 CAN 클러스터는 많은 노드를 가지는 것이 가능하다. 만약 한 노드가 다른 노드에게 정보를 알리는 것이 필요하다면, Bus 통신이 필요하고, 그것은 아마 주기 Network frame을 전송할 것이다.

If a node doesn't need bus communication it shall transmit no Network Management frames.

만약, Bus 통신이 필요 없다면 그것은 Network frame을 전송하지 않는다. 

 

Operational Mode

The AUTOSAR CAN NM shall contain 3 operational modes

- network mode*

- prepare bus-sleep mode

- bus-sleep mode

*Network mode is further divided into below states:

- repeat message state

- normal operation state

- ready sleep state 

 

Wake up and Shutdown

Wake up : if any node in the network management cluster requires bus-communication, it can wake-up the network management cluster from the Bus-sleep mode by transmitting Network Management frame.

만약 네트워크 관리 노드의 어떤 한 노드가 bus 통신이 필요하다면, network frame을 전송함으로써 bus sleep mode로부터 네트워크 관리 클러스트를 깨운다. Reception of network management frame indicates that sending nodes want to keep the network management cluster awake. network frame을 받는 것은 이를 보낸 노드가 네트워크 관리 클러스터가 깨 있음을 원하는 것을 암시하는 것이다. 

 

Shut down : if any node is ready to go th the bus-sleep mode, it stops sending netwrok management PDUs, but as long as Network Management PDUs from other nodes are receiver, it postpones transition to the Bus-sleep mode. 만약 한 노드가 bus-sleep mode로 갈 준비가 되었다면, network PDU를 보내는 것을 멈춘다. 하지만 타 노드로부터 network PDU를 지속적으로 받는다면, bus sleep mode로 가는 것을 연기한다. Finally, if a dedicated timer elapses because no Network management PDUs are receiver anymore, every node initiates transition to the Bus-sleep mode. 마침내, 만약 네트워크 관리 PDU가 더이상 수신되지 않는다면 그 타이머는 다 경과될 것이고 모든 노드는 bus sleep mode로 이동을 시작한다. 

 

State machine overview

master ECU will go to the normal operation state

not master ECU will go to the ready sleep state

 

Types of Wakeup

Passive wakeup : 

when other ECU is reason for wakeup we call it as passive wakeup. 만약 다른 EUC가 wakeup의 이유가 되었다면, 우리는 이를 passive wakeup - 수동 웨이크업이라고 부른다. In this case ECU should receive NM frame to keep the ECU in passive wakeup mode. 이러한 경우 ECU는 passive wakeup mode를 유지하기 위해 NM을 받아야한다.

 

Active wakeup :

when current ECU is the source of the wake-up it is called active wakeup. 만약 현재 ECU가 wakeup의 근원이 되었다면, 우리는 이를 active wakeup - 능동 웨이크업이라고 부른다. example : If there is any sensor within ECU or a simple button within ECU. 만약 ECU내에 어떤 센서가 있거나 간단한 버튼이 있다면. 

 

Network Management frame structure

Setting the Cannmpdunidposition to off means that in the nm pdu no space is occupied by the source node identifier. 'cannmpdunidposition'이 off로 설정되있다는 것은 nm pdu안에 어떠한 공간도 source node identifier에 의해 차지되지 않는 다는 것이다. Hence one more byte is available for user data. 따라서 하나 더 바이트가 user data로 사용가능하다.

The location of the control bit vector shall be configurable by means of Cannmpducbvpsotion to byte 0, byte 1, or off.

'control bit vector'의 위치는 아마 Cannmpducbvposition의 byte 0, 1 그리고 꺼짐의 수단으로 구성되어 진다.

 

 

네트워크 메시지 프레임 구성 중 control bit vector의 구성은 다음과 같다.

Bit 0 : 반복 메시지 설정

- 0 : 반복 메시지 요청 / 1 : 반복 메시지 미요청

Bit 3 : NM Coordinator or sleep bit

- 0 : shutdown 동기화 미요청 / 1 : shutdown 동기화 요청

Bit 4 : Active Wakeup bit 

- 0 : passive wakeup / 1 : active wakeup

Bit 6 : Partial network infomation bit

- 0 : NM PDU가 partial network request 정보 미포함 / 1 : NM PDU가 partial network request 정보 포함

 

BUS Load reduction mechanism

this is a mechanism which is used to reduce the number of frames transmitted in CAN BUS at a same time. 이것은can bus 상에서 전송되는 프레임의 수를 감소시키기 위한 메커니즘이다. Usually frames will be transmitted based on CANNM_MSG_CYCLE_TIME. 보통 프레임들은 이 신호를 기반으로 전송되어진다. In this mechanism frames will be transmitted based on CANNM_MSG_Reduced time after reception of NM PDU CAN NM MSG Cycle timer is loaded with Cannmmsgreducedtime. 이 메커니즘에서 프레임들은 Cannmsgreducedtime에 실린 타이머를 받음으로써 reduced 시간으로 전송되어 진다. 

 

If bus load reduction mechanism is enabled in a cluster only 2 nodes having smallest Cannmmsgreducetime will transmit nm frame. 버스 부하 감소 메커니즘이 클러스터에서 활성화되면 가장 작은 Cannmmsg 감소 시간을 갖는 2개의 노드만 nm 프레임을 전송한다. this mechanism will be activated only when the normal operation state is entered from repeat message state or ready sleep state and Cannmbusloadreductionenabled is true. 이 메커니즘은 repeat message satae나 ready sleep state 상태에서 normal operation 상태로 들어갈 때와 이 변수가 true일 때 동작되어 진다. 

Cannmmsgreducedtime = (1/2)cannmmsgcycletime && < cannmmsgcycletime

Cannmmsgcycleoffset reduces bus-load independent of size of the network management cluster at the start of NM frame transmission 이 신호는 nm frame의 시작 시 network 관리 사이즈의 독립적 버스 부하를 감소시킨다. 

 

Partial networking

if parameter Cannmpnenalbed, then PN functionality is enabled. 만약 이 파라미터가 enable 되면, PN은 기능적으로 enable 된다. To reduce the bus load and cpu load partial networking concept was used. 부분 네트워크 콘셉의 버스 로드와 cpu 로드를 줄이기 위해 사용되어 진다. How to reduce load : it is done by reducing some functionality. 어떻게 부하를 줄일까? 그것은 기능적으로 감소되어 진다. Usecase to reduce bus-load : if nm frame with PN active bit is received ECU should send NM frame. 버스 로드 감소 케이스 : 만약 pn이 활성화 된 nm frame이 받아지면, ECU는 NM frame을 보내야 한다. Here byte 4 and byte 5 deals with PN. 여기 4,5바이트가 PN을 다룬다. Consider byte 4 bit 0 indicates engine management functionality. 바이트 4의 0비트가 엔진 관리를 기능적으로 암시한다. byte 4 bit 1 indicates infotainment functionality. 

인포테인먼트와 연결된 ecu는 nm frame을 전송할 것이며, 이후 pn bit가 활성화되므로 다른 비 인포테인먼트는 종료 상태로 이동할 수 있습니다. 엔진 관리와 연결된 ecu는 nm frame을 보내지 않습니다. 그러면 pn bit이 비활성화되므로 다른 엔진 관리 ecu는 종료 상태로 이동할 수 있습니다.

 

CBV : 0x40 0100 0000 → partial network information bit '1' = NM PDU가 partial network request 정보 포함

PN Info : 0x12 → wake up just infotainment ECU