当前位置:网站首页>基于can总线的A2L文件解析(3)
基于can总线的A2L文件解析(3)
2022-07-05 18:18:00 【赞哥哥s】
文章目录
前言
在第二篇A2L文件解析的文章中,介绍了常用接口的定义内容。在实际使用过程中,进行参数定义。下面介绍具体的配置及定义。

MOD_COMMON
此关键字用于指定模块的通用描述数据,然后将其作为该模块的标准。
/begin MOD_COMMON "This is MOD_COMMON"
BYTE_ORDER MSB_LAST
ALIGNMENT_BYTE 1
ALIGNMENT_WORD 2
ALIGNMENT_LONG 4
ALIGNMENT_FLOAT32_IEEE 4
ALIGNMENT_FLOAT64_IEEE 8
ALIGNMENT_INT64 8
/end MOD_COMMON
ALIGNMENT_BYTE:声明整个模块中的BYTE对齐方式。如果参数缺失,对齐方式为1。其他同理。
BYTE_ORDER:字节序,MSB_LAST=Intel,默认为Intel
MOD_PAR
MOD_PAR关键字用于描述要为设备配置的管理数据。除了注释之外,所有参数都是可选的。暂时没有用到。
XCP数据
在A2ML中定义XCP结构:
"XCP" struct {
taggedstruct Common_Parameters; /* default parameters */
taggedstruct {
block "XCP_ON_CAN" struct {
struct CAN_Parameters; /* specific for CAN */
taggedstruct Common_Parameters; /* overruling of default */
};
}; /* transport layer parameters*/
};
Common_Parameters定义
/*********************** start of Common Parameters ***************************/
taggedstruct Common_Parameters {
block "PROTOCOL_LAYER" struct Protocol_Layer;
block "SEGMENT" struct Segment;
block "DAQ" struct Daq;
block "PAG" struct Pag;
block "PGM" struct Pgm;
block "DAQ_EVENT" taggedunion Daq_Event;
}; /******************** end of Common Parameters *****************************/
定义了第二节介绍的接口。
IF_DATA定义XCP
PROTOCOL_LAYER
/begin IF_DATA XCP
/begin PROTOCOL_LAYER
0x0101
0x07D0
0x2710
0x07D0
0x07D0
0x07D0
0x07D0
0x00
0x08
0x08
BYTE_ORDER_MSB_LAST
ADDRESS_GRANULARITY_BYTE
OPTIONAL_CMD SET_MTA
OPTIONAL_CMD UPLOAD
OPTIONAL_CMD SHORT_UPLOAD
OPTIONAL_CMD TRANSPORT_LAYER_CMD
OPTIONAL_CMD DOWNLOAD
OPTIONAL_CMD DOWNLOAD_NEXT
OPTIONAL_CMD SHORT_DOWNLOAD
OPTIONAL_CMD SET_CAL_PAGE
OPTIONAL_CMD GET_CAL_PAGE
OPTIONAL_CMD GET_PAG_PROCESSOR_INFO
OPTIONAL_CMD GET_PAGE_INFO
OPTIONAL_CMD SET_DAQ_PTR
OPTIONAL_CMD WRITE_DAQ
OPTIONAL_CMD SET_DAQ_LIST_MODE
OPTIONAL_CMD GET_DAQ_LIST_MODE
OPTIONAL_CMD START_STOP_DAQ_LIST
OPTIONAL_CMD START_STOP_SYNCH
OPTIONAL_CMD GET_DAQ_PROCESSOR_INFO
OPTIONAL_CMD GET_DAQ_EVENT_INFO
OPTIONAL_CMD FREE_DAQ
OPTIONAL_CMD ALLOC_DAQ
OPTIONAL_CMD ALLOC_ODT
OPTIONAL_CMD ALLOC_ODT_ENTRY
COMMUNICATION_MODE_SUPPORTED BLOCK
SLAVE
/end PROTOCOL_LAYER
第一个数字是版本号,后面七个是T1-T7

接下来两个为MAX_CTO和MAX_DTO

BYTE_ORDER_MSB_LAST表示Intel格式
后面的是定义的命令,由于本XCP没有用编程,所以跟编程相关的CMD不在定义范围内。
COMMUNICATION_MODE_SUPPORTED定义从机
DAQ
/begin DAQ
DYNAMIC
0x00
0x2D
0x00
OPTIMISATION_TYPE_DEFAULT
ADDRESS_EXTENSION_FREE
IDENTIFICATION_FIELD_TYPE_ABSOLUTE
GRANULARITY_ODT_ENTRY_SIZE_DAQ_BYTE
0x07
OVERLOAD_INDICATION_PID
/begin STIM
GRANULARITY_ODT_ENTRY_SIZE_STIM_BYTE
0x07
/end STIM
目前XCP只支持DYNAMIC DAQ
MAX_DAQ为0.因为是动态DAQ
MAX_EVENT_CHANNEL为0x2D,根据实际EVENT数决定,配置时是大于实际EVENT数的。
MIN_DAQ为0.因为是动态DAQ
OPTIMISATION_TYPE;这个默认
ADDRESS_EXTENSION:free
不知道配置在哪。在标定软件中有显示可以配置。
IDENTIFICATION_FIELD_TYPE_ABSOLUTE,在下图中配置

OVERLOAD_INDICATION_PID,不知道配置在哪。在标定软件中有显示可以配置。
MAX_ODT_ENTRY_SIZE_DAQ:0x07
因为TIMESTAMP选择的是NO_TIME_STAMP,所以时间戳不可用

EVENT
以其中一个event为例:
/begin EVENT
"Dlt_EvtMsg"
"Dlt_EvtM"
0x1E
DAQ
0x01
0x00
0x06
0x00
/end EVENT
事件名:Dlt_EvtMsg
短名:Dlt_EvtM
事件编号:0x1E
数据传输类型:DAQ
最大DAQ LIST数量:1
事件循环周期:0
事件时间单位:6,“UNIT_1NS” = 0,
“UNIT_10NS” = 1,
“UNIT_100NS” = 2,
“UNIT_1US” = 3,
“UNIT_10US” = 4,
“UNIT_100US” = 5,
“UNIT_1MS” = 6,
“UNIT_10MS” = 7,
“UNIT_100MS” = 8,
“UNIT_1S” = 9,
“UNIT_1PS” = 10,
“UNIT_10PS” = 11,
“UNIT_100PS” = 12
事件优先级:0
XCP_ON_CAN
CAN_Parameters
0x0102
CAN_ID_MASTER 0x0xxx
CAN_ID_SLAVE 0x0xxx
BAUDRATE 0x07A120
SAMPLE_POINT 0x50
SAMPLE_RATE SINGLE
BTL_CYCLES 0x0A
SJW 0x01
MAX_DLC_REQUIRED
XCP on CAN version 版本号:0x0102
CAN_ID_MASTER:主机ID-0x0xxx
CAN_ID_SLAVE:从机ID-0x0xxx
BAUDRATE:500K,0x07A120
SAMPLE_POINT:采样点80
SAMPLE_RATE:采样率SINGLE
BTL_CYCLES:每个bit的slot数,10
SJW:同步段长度,1
MAX_DLC_REQUIRED:主从机的DLC始终为8
PROTOCOL_LAYER和前面设置的一致

CAN相关的信息在DBC或Arxml中设置。
总结
至此,A2L文件中的内容就介绍完了。关于XCP协议及代码实现,后面有空再继续学习。
若你觉得本文对你有帮助,欢迎点赞,关注,收藏,转发~~~
你的鼓励是对小弟的最大支持~~~
建了一个WX公众号,《汽车电子学习笔记》感兴趣可以关注一下~~~文章都会同步更新~
边栏推荐
- sample_rate(采样率),sample(采样),duration(时长)是什么关系
- How to improve the thermal management in PCB design with the effective placement of thermal through holes?
- 金太阳开户安全吗?万一免5开户能办理吗?
- Copy the linked list with random pointer in the "Li Kou brush question plan"
- Introduction to VC programming on "suggestions collection"
- 让更多港澳青年了解南沙特色文创产品!“南沙麒麟”正式亮相
- [paddleclas] common commands
- Whether to take a duplicate subset with duplicate elements [how to take a subset? How to remove duplicates?]
- @Extension, @spi annotation principle
- Isprs2022 / Cloud Detection: Cloud Detection with Boundary nets Boundary Networks Based Cloud Detection
猜你喜欢

Can communication of nano

The 11th China cloud computing standards and Applications Conference | China cloud data has become the deputy leader unit of the cloud migration special group of the cloud computing standards working

Vulnhub's darkhole_ two

buuctf-pwn write-ups (9)

Sophon Base 3.1 推出MLOps功能,为企业AI能力运营插上翅膀

第十届全球云计算大会 | 华云数据荣获“2013-2022十周年特别贡献奖”

Privacy computing helps secure data circulation and sharing

The 10th global Cloud Computing Conference | Huayun data won the "special contribution award for the 10th anniversary of 2013-2022"

Record eval() and no in pytoch_ grad()

The 2022 China Xinchuang Ecological Market Research and model selection evaluation report released that Huayun data was selected as the mainstream manufacturer of Xinchuang IT infrastructure!
随机推荐
Leetcode notes: Weekly contest 300
从类生成XML架构
Penetrate the whole intranet through socks agent
node_exporter内存使用率不显示
Access the database and use redis as the cache of MySQL (a combination of redis and MySQL)
U-Net: Convolutional Networks for Biomedical Images Segmentation
Tupu software digital twin | visual management system based on BIM Technology
LeetCode 6109. Number of people who know the secret
Crontab 日志:如何记录我的 Cron 脚本的输出
吳恩達團隊2022機器學習課程,來啦
Is it safe to open an account, register and dig money? Is there any risk? Is it reliable?
关于服装ERP,你想知道的都在这里了
Isprs2022 / Cloud Detection: Cloud Detection with Boundary nets Boundary Networks Based Cloud Detection
Privacy computing helps secure data circulation and sharing
Record a case of using WinDbg to analyze memory "leakage"
[QNX Hypervisor 2.2用户手册]6.3.2 配置VM
彻底理解为什么网络 I/O 会被阻塞?
Clickhouse (03) how to install and deploy Clickhouse
Sibling components carry out value transfer (there is a sequence displayed)
音视频包的pts,dts,duration的由来.