前文:
这个章节讲解下UDS中的28服务(Communcation Control)的配置,顾名思义,对当前ECU的通讯状态进行变更,主要设置应用报文,网络管理报文的收发控制,通常应用在刷写APP软件时,降低总线负载。
这里首先要提醒的一点是,28服务几乎不需要手写代码,只有在客户需求要求前置条件不满足时报特定NRC时才需要填充代码。
Note:不同的工具链静态代码可能不同,但配置基本相同。
正文:
实际配置中主要涉及的模块有DCM,BSWM,COM,RTE.
1.DCM模块的配置
<1>DcmGeneral
下面的选项是需要勾选。
Enable Mode Declaration Support: If enabled, the Dcm
acts as a mode manager and is responsible for providing the modes of the ModeDeclarationGroupPrototype
s it defines in its Basic Software Module Description:
Enable RTE usage: Enables RTE
functionality usage by the Dcm
.
<2>DSD
配置支持的子服务,安全等级,会话模式等,这里的配置需要熟悉UDS服务。
<3>DSP
在Com Control中需要reference Com channel,如果项目中启用了网络管理,这里的通道要和网络管理的通道一致。
2.BswM模块的配置
2.1.BswMModeRequestPort
这里要注意的有以下两点:
BswMRequestProcessing:This parameter defines if the processing of the mode arbitration shall be done immediately when a mode request is received or if it shall be deferred to the processing of the main function of BswM.选择立即处理还是在mainfunction中轮询到再处理。
BswMModeRequestSource :这里我推荐选择的是BswMBswModeNotification,因为前面勾选了Enable Mode Declaration Support,也有的同学会去选择BswMDcmComModeCurrentState或者BswMDcmComModeRequest.这里先不详细展开,文末我们再来讨论区别。
2.2.BswMModeCondition
BswConditionType: 选择BSWM_EQUALS,等价于=。
BswMCondtionMode:这里关联前面创建的ModeRequestPort.,做为条件判断的输入。BswCondtionValue