当前位置:网站首页>[AUTOSAR candrive 2. understand the mapping relationship between communication HOH, canid and pduid]

[AUTOSAR candrive 2. understand the mapping relationship between communication HOH, canid and pduid]

2022-07-23 12:27:00 Rest of life

CAN The original intention of interface module design is not to directly access the hardware , Independent of hardware , That means CAN The interface layer can only pass CAN Module interface to obtain hardware related content , Mainly used CAN Module interface has Hth and Hrh. About Hth and Hrh, First, it involves a software filtering selection problem , When Hth and Hrh configure BasicCAN, You need to in CanIf The module performs software filtering ; When Hrh and Hth configure FullCAN, You don't need to be in CanIf The module performs software filtering , But in hardware filtering . Then go to the above mentioned CanId How to map , Namely different CanId How to map to Hrh and Hth, as well as Hrh and Hth And how to map to higher-level modules ( Temporarily called PDU Id), Here's the picture 13 Shown
 Insert picture description here
chart 13 PDU Ids and Hoh Mapping , To quote [1]
In general, the above figure clearly shows various Id Mapping , But to better understand , Here is a detailed introduction :

First , We know CAN Controller There are many hardware object processors in (Hoh), stay CAN Driver Lieutenant general Hoh For receiving and sending purposes , What you receive is called Hrh, It is called Hth. And then Hrh and Hoh Respectively with the corresponding CanId It maps , Here's the picture 14 Shown .

 Insert picture description here
chart 14 Hoh–(Hrh, Hth)-- CanId Mapping diagram
And then define CAN Module and CAN Interface module Hrh and Hth Mapping , Here's the picture 15

 Insert picture description here
chart 15 (Hrh–CanIf Hrh), (Hth–CanIf Hth)
Finally establish CanIf Hrh And RxPduID,CanIf Hth And TxPduID Mapping , Pictured 16, That is for CAN Communication function , Set up CAN Interface module and PduR Modular ID mapping .

 Insert picture description here
chart 16 (CanIf Hrh–RxPdu ID), (CanIf Hth–TxPdu ID)
After establishing the above mappings , It is very easy to understand the parameter relationship of related functions of different modules ( such as indication Functions and confirmation function ). To receive indication Function description , Here's the picture 17 Shown .

 Insert picture description here
chart 17
namely CAN The module reads the data of the relevant register , Which establishes CanId And Hrh Mapping 1, And both are Mailbox The elements of ; The data length and data are PduInfoPtr The elements of . Pass this information to the upper layer CAN Interface module ,CAN The interface module is established according to Hrh And CanIf Hrh Mapping acquisition of CanIf Hrh,CanIf Hrh According to the established CanIf Hrh And RxPduId Mapping 2 obtain RxPduId. Last , take RxPduId and CAN The data transmitted by the module is passed to PduR modular . It's not difficult to find through this process , If known RxPduId, Then we know the corresponding CanId How much is the , vice versa .

If ever AUTOSAR Tool configuration experience , It is not difficult to find that the configuration process generally establishes various mapping relationships according to this logic , And during configuration Id Pay special attention to settings , Must correspond correctly , To ensure the correct function .

Through these two articles CAN Module and CAN Introduction of interface module , Basically straightened out the process of data transmission and software implementation from hardware to software , Here's the picture 18 The first half . That is, the software has obtained the corresponding CanId Of 8 Bytes of data , Then the next natural thing to do is to receive this 8 Byte data is parsed into various signals defined by the corresponding message protocol , Or package the transmitted signal into 8 Bytes of data . Start with the next article to introduce the figure 18 The second half of .

 Insert picture description here
Link:
AUTOSAR in CAN Communication protocol stack configuration details
be based on Autosar Of Can Principle of communication protocol stack

原网站

版权声明
本文为[Rest of life]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/204/202207230539181741.html