当前位置:网站首页>[bootloader architecture and brushing process based on UDS service]
[bootloader architecture and brushing process based on UDS service]
2022-07-23 12:39:00 【Rest of life】
be based on UDS Of BootLoader download , Can support ECU Infinite strokes of the life cycle , adopt CAN There is no need to dismantle the shell and DEBUG Application swiping of port , This paper introduces the brush writing service and the three-stage brush writing process . It can also be upgraded in the air through wireless modules , namely OTA technology .
See the following two pictures bootloader Software stack architecture and brushing process .


Questions
Q: The burning order in the figure is 34-36-34-36-34-36-37, But the order in other materials is 34-36-36-36-37.
A: This problem is understood in this way ,34-36-36-36-37 The premise is that the data you want to download is continuous data , Every 36 Address information used , All are 34 The address information contained in plus a certain offset . If you need to download discontinuous data , It needs to be repeated 34 Service or 31( erase )-34 service .
1 Why do we have to do Bootloader? Why based on UDS To make Bootloader
If your controller has a shell , But there is no design bootloader Words , Each update ECU The program , You need to take the shell apart , Use the burner to update the program . With bootloader, You can go through CAN Line to update the program . If it's more convenient , Even through OTA Perform a remote upgrade .
Then why use UDS Well ? It's mainly to standardize bootloader The whole process . For example, burning Xiaoming cards ECU when , We definitely want other brands ECU In a state of silence , Have a rest , This requires a common standard to be standardized , When to stop sending data , When can I no longer store DTC Wait a minute .
Another example is when debugging , You must want your controller to pass CAN The process of burning is understandable , Is satisfied with a certain specification . thus ,UDS In the design, we considered bootloader The needs of , Specially for bootloader Designed several services , For your use . When the main engine factory sends out the demand, it naturally requires everyone to UDS Complete on the basis of specifications bootloader The function of .
2 Bootloader What should be supported UDS service
obviously bootloader No support required 19/14 And other fault Services .
stay boot In the program ,10/27/11/3E Such basic diagnostic services need support ,22/2E Reading and writing DID Our services need support ,31/34/36/37 this 4 individual bootloader The main service needs support , common 10 individual .
stay app In segment program ,85 and 28 Service needs support , Make sure to pause CAN Normal communication , Pause recording DTC, Let the upgraded device concentrate on upgrading .

3 Bootloader—— Three paragraph
(1) Pre programming phase
3E TP message .
10 Service switch to 03 Extended mode .
85 Service and 28 service , Turn off DTC And non diagnostic messages . Make the whole CAN The network is quiet . This is to operate the whole vehicle network , Generally, it is sent in the way of functional addressing . Pay attention to use first 85 Service closing DTC, Reuse 28 Service close message .
(2) Main programming phase
10 The service switches to programming mode , Pay attention here , The right way is App Segment program reply 0x78 NRC, Next, jump to boot This program , Finally by Boot Segment program to reply 10 02 Positive response . The wrong way is by App Paragraph reply 10 02 Positive response , Then jump .
Read a DID,tester To judge the return value . The return value may contain some information of the key .
27 service , Unlock , Through security verification .
Be careful 10 02 The service should not directly respond positively , Risk exists
Write DID The fingerprint , Mark the identity of the person who wrote the software ,ECU Reply to write fingerprint successfully .( according to OEM Request to execute )
31 service - erase Flash.ECU Positive response , Erase succeeded .
34 service , Request data download ,ECU Reply to confirm the maximum block size .
36 service , Start transmitting data . After each block transmission is completed ,ECU Positive response . Determine if there are more blocks to download . Can support at most 255 Block .
37 service , Request to exit the transmission .ECU Positive response .
31 service - check APP This program , Check programming consistency / integrity .ECU Positive response . Check success .
If there are more blocks to download , Re execution 31( erase Flash Area )-34-36-37-31( check ) service . If there is no , To perform the .
11 service ,ECU Reset . Then you should jump directly to the newly downloaded APP In segment program .
(3) Post programming status
10 Service switch to 03 Extended session .
perform 28 Service and 85 service , Enable non diagnostic messages and DTC. This is to operate the whole vehicle network , Generally, it is sent in the way of functional addressing . Pay attention to execute first 28, After execution 85, avoid DTC False positives .
27 service , Security check , Prepare to write data .
2E service , Write programming information to ECU in .
10 service , return 01 Default session . end .
4 BootLoader Start sequence and conversion process
The following process is for reference only , There are many irregularities . Welcome to leave a message to discuss .
ECU After power on or reset , Enter the first Boot paragraph . from Flash/EEPROM Read from App Valid marks , function boot sign .
Judge function boot sign , if 1, entering Boot Segment programming session ( The safety level is locked ), Then write Flash/EEPROM( Unsafe operation ), function boot sign Zero clearing . if S3 If the timer times out, it will return Boot Segment default session .
Enter after security access Level2 Unlock state , Start execution App Memory erase , After erasing App Valid marks Zero clearing ( Unsafe operation ).
Start burning . After burning successfully function boot sign Write 0,App Valid marks Write 1.
2*. Judge function boot sign , if 0, entering Boot Default session for segment .
3*. 50ms Post judgment App Valid marks , if 1, be Jump to App Segment default session . Assembly instructions are used to execute APP This program ; if 0, return Boot Segment default session , And no longer judge App Valid marks , No more attempts to enter App paragraph .
4*. App If a program receives a programming session request , function boot The sign reads 1 , Execute immediately ECU Reset , This will re-enter boot This program .
notes : from BOOT Jump in APP Before you need to judge APP Data integrity , For example, to CRC check .
5 The problem is
Q: If it's burned, it's bad App This program , Can't return boot What about the segment program ?
A: Refer to the startup mode of the computer , stay ECU After power on , Set aside a short period of time to maintain boot state , In the meantime , If the specified message is received ( such as , The computer is pressed F8), Then don't jump to App It's a paragraph .
Q: function boot Logo and App Valid signs for safety , Where should I save it ?
A: function boot Signs can be placed on RAM in , from Boot and App share .
Q: In the figure above CAN Data instance , Why did it happen twice CRC The check ?CRC Verification is the verification of which data ?
A:OEM Don't want to ECU It can be erased Flash Code for , therefore BootLoader Need to burn App Before , First erase Flash The code passed UDS Burn writing RAM in , Let's do it after burning 31 Under service CRC check . After burning ECU Of App Program ,App It may be downloaded in many segments due to discontinuous addresses . After downloading, you need to do a general CRC check . No matter which calibration ,CRC The verified data is the data segment of the code , namely 36 Valid data transmitted in the service .
边栏推荐
- Flask项目中创建数据库表db.create_all()
- Implementation of heap and heap sorting
- C语言数据库:详细的说明用学生管理系统了解数据库的操作,简单易懂。
- TeX or LaTeX or MikTeX or TeX Live or CTeX
- 钢结构基本原理试题及答案
- 大白话说说synchronized关键词的三种用法
- Desktop remote protocol - codec
- [talent column] can't you use Apache dolphin scheduler? It takes a month to write the most comprehensive introductory teaching [2]
- 【AUTOSAR COM 1.通信协议栈介绍】
- 常见的排序—交换排序
猜你喜欢

Review of basic principles of steel structure

博客搭建二:NexT主题相关设置beta

主机字节序的判定
![[talent column] can't you use Apache dolphin scheduler? It takes a month to write the most comprehensive introductory teaching [2]](/img/34/abc6ef91d0b735f713f76da5a4b537.png)
[talent column] can't you use Apache dolphin scheduler? It takes a month to write the most comprehensive introductory teaching [2]

Blog building 4: how to add your blog to Baidu and Google

C language small project - student achievement management system

表格个人简历

【学习总结】

【存储器了解 RAM flash和eeprom存储器的区别和作用】

【AUTOSAR CanDrive 2.了解通信Hoh、CanId与PduID的Mapping关系】
随机推荐
【AUTOSAR CanTP 1.学习UDS诊断的网络层协议】
Tencent cloud client command line tool tccli main process analysis
DICOM open source tool library
[CAN总线的物理层 ]1.CAN/CANFD采样的点的内容分享
TeX or LaTeX or MikTeX or TeX Live or CTeX
博客搭建五:图床选择
1. Ten principles of Economics
Object based - two classic classes
[introduction to AUTOSAR com 4.com service layer module]
Jetson TX1 installation pytoch
URL查询参数编码问题(golang)
嵌入式从入门到精通(入土)——超详细知识点分享3
堆的实现与堆排序实现
Vscode configuration
LeetCode——136. 只出现一次的数字
vscode配置
合成中文识别数据集的相关repo
Upper and lower case letter conversion
[learning summary]
Redis——配置及应用