今天给大家介绍基于TSMaster的UDS诊断刷写流程。基本流程主要分为基本参数配置、刷写流程两部分。一、基本参数配置
1、新建工程
打开TSMaster软件,选择创建新工程-诊断-UDS诊断,然后选择一个新工作目录,创建一个新文件夹,点击选择之后进入到TSMaster工程文件中。
![图片1.png 图片1.png](https://static.assets-stash.eet-china.com/forum/202301/05/173650w500vzo0aesalvps.png)
2、CAN通道设置
如下图所示,电极最上方硬件、通道选择设置一下CAN通道:点击总线硬件、配置波特率。配置通道一为1000kbps,通道二为500kbps。
![图片2.png 图片2.png](https://static.assets-stash.eet-china.com/forum/202301/05/173736hmmjbcl41rd1mcbx.png)
3、新建UDS诊断模块
打开或者新建一个uds诊断模块。
![图片3.png 图片3.png](https://static.assets-stash.eet-china.com/forum/202301/05/173806tuupk85zo8p8j11r.png)
设置诊断基本参数,Protocal的Transport Layer,通道选择channel 2。
![图片4.png 图片4.png](https://static.assets-stash.eet-china.com/forum/202301/05/173819qf8p4gffennu7ee8.png)
设置Diagnostic layer参数。将安全算法的dll导入。
![图片5.png 图片5.png](https://static.assets-stash.eet-china.com/forum/202301/05/173830rlge2ryuzcltdtur.png)
二、刷写流程
1、进入扩展会话
移步至“Basic Diagnostic Config”选项卡,对照配置文件,对10服务点右键,添加新服务。
![图片6-1.png 图片6-1.png](https://static.assets-stash.eet-china.com/forum/202301/05/180416b2kje4zha2izzg4i.png)
双击新建的服务,修改回话类型为83。
![图片6.png 图片6.png](https://static.assets-stash.eet-china.com/forum/202301/05/173859zrh2118zehex0txi.png)
2、创建BT刷写动作
来到“Automatic Diagnostic”,在左侧空白区域右键,然后选“add a new uds flow”。
![图片7.png 图片7.png](https://static.assets-stash.eet-china.com/forum/202301/05/173910lrb6gi33k78krrzd.png)
切换至“unlock”,然后在方框所示区域右键,依次选“Add new test step”、“Normol”,根据公司刷写流程,选择是用功能ID还是物理ID,在“Request(0x)”一栏下写10 83;根据配置文件依次在“Basic Diagnostic Config”中配置服务以及在“Automatic Diagnostic”中配置刷写流程。
![图片8.png 图片8.png](https://static.assets-stash.eet-china.com/forum/202301/05/173931w36s6eqhhrdee1fh.png)
进入编程会话之后,根据配置文件流程,需要通过安全算法来解锁,添加动作时不要选Select Config,要选Seed&Key;然后根据相应规范,选择对应的level。
![图片9.png 图片9.png](https://static.assets-stash.eet-china.com/forum/202301/05/174027hd9doqmoqnsdkdbm.png)
3、加载待刷写文件
在“Basic Diagnostic Config”选项卡,创建服务,在“Service Name”中修改想要的名字,点击+号选中想要烧录的文件之后,下方会显示出了文件中的数据区,以及每个数据区的参数信息,TSMaster会全自动地把这一切全部刷写进去,之后会得到两个重要信息,待刷写数据的地址、待刷写数据的长度。
![图片10.png 图片10.png](https://static.assets-stash.eet-china.com/forum/202301/05/174042vct4zzucgzucncod.png)
4、手动配置擦除服务
烧录完s19文件后需要进行一个校验,在31服务中创建一个新的服务,改好对应的数据,在下方参数中的“Value Type”里选择“SystemVar”,修改数据长度为32,最后添加变量。
![图片11.png 图片11.png](https://static.assets-stash.eet-china.com/forum/202301/05/174131u64hr64c662424w4.png)
然后点击下方参数列表中右侧的+号,在内部变量中找到相应文件的校验参数。点击确定。
![图片12.png 图片12.png](https://static.assets-stash.eet-china.com/forum/202301/05/174156zgp4tgu0riz7v5rr.png)
完成之后,再去把该动作添加至“Automatic Diagnostic”中相应烧录文件的流程后。
![图片13.png 图片13.png](https://static.assets-stash.eet-china.com/forum/202301/05/174212d37t1kuc3y8v1tpy.png)
然后新建一个“擦除”动作,需要用到上面生成的两个参数。
![图片14.png 图片14.png](https://static.assets-stash.eet-china.com/forum/202301/05/180553gy17ji1re6t0e6xx.png)
然后把该动作添加至“Automatic Diagnostic”中。
![图片15.png 图片15.png](https://static.assets-stash.eet-china.com/forum/202301/05/180606um61an1q6nggkann.png)
5、添加新烧录文件
擦除过后,添加新的烧录文件,重复上面的过程最后在校验,最后根据配置文件把最后的过程添加上去。整个配置过程就完成了,点击左上角的启动后再点击诊断中的运行。
![图片16.png 图片16.png](https://static.assets-stash.eet-china.com/forum/202301/05/180646vexheg8zmzh5efyi.png)
程序正在刷写中。
![图片17.png 图片17.png](https://static.assets-stash.eet-china.com/forum/202301/05/180708n2rrky4z923r4r1m.png)
刷写完成后可在下面直观地观察到响应。
![图片18.png 图片18.png](https://static.assets-stash.eet-china.com/forum/202301/05/180721z23qhhzxln2pppws.png)
6、自动配置擦除服务
如不想手动配置擦除和checksum,可以自动配置擦除服务进行相应配置。
![图片19.png 图片19.png](https://static.assets-stash.eet-china.com/forum/202301/05/180740ewhnxosghobxnsdq.png)
选择相应的回应报文。
![图片20.png 图片20.png](https://static.assets-stash.eet-china.com/forum/202301/05/180753trl5l1zeo0x25uro.png)
![图片21.png 图片21.png](https://static.assets-stash.eet-china.com/forum/202301/05/180805bjw5wwjxalux6s8a.png)
Checksum。
![图片22.png 图片22.png](https://static.assets-stash.eet-china.com/forum/202301/05/180817s4ek16herr9ek1rt.png)
![图片23.png 图片23.png](https://static.assets-stash.eet-china.com/forum/202301/05/180827bhcitfafaj4tet1f.png)