《uds bootloader 论文》由会员分享,可在线阅读,更多相关《uds bootloader 论文(91页珍藏版)》请在金锄头文库上搜索。
1、 Bootloader with reprogramming functionality for electronic control units in vehicles: Analysis, design and Implementation David Pehrsson Jess Garza EXAM WORK 2012 ELECTRICAL ENGINEERING This thesis work is performed at Jnkping University, School of Engineering, within the subject area Electrical En
2、gineering. The work is part of the two year masters degree programme with the specialization in Embedded Systems. The author is responsible for the given opinions, conclusions and results. Examiner: Shashi Kumar Supervisor: Alf Johansson Scope: 30 credits (second cycle) Date: 2012-12-18 i Acknowledg
3、ements We would like to thank everyone at QRTECH for the help they have given us and we would especially like to thank Andreas Kck for the technical support he provided when we needed it. We will also like to thank Lars Carlsson on QRTECH for all the help regarding the master thesis. We would also l
4、ike to thank the teachers at JTH, Alf Johansson and Shashi Kumar for their support. Abstract ii Abstract In an automotive context todays need of testing functions while in factory, correcting faults in the workshop or adding extra value in the aftermarket makes it very important to easily be able to
5、 download new software to the electronic control units in vehicles. In the platform for standard automotive software development called AUTOSAR, two known protocols are presented to specify the procedure on how to implement this download operation: Unified Diagnostic Services (UDS) and the Universal
6、 Measurement and Calibration Protocol (XCP). However the part of the UDS and XCP standards that is about reprogramming is not completely a part of the AUTOSAR standard yet. In this thesis, UDS and XCP have been compared to evaluate which of the two that has most support in AUTOSAR today and are most
7、 likely to be fully integrated into AUTOSAR in the future. Since UDS already has support in AUTOSAR for some of the functions needed for reprogramming and because of the fact that UDS is a part of the extensively used On-board Diagnostic standard (OBD-II), UDS is chosen to be the most suitable proto
8、col for implementing reprogramming functionality according to AUTOSAR. A bootloader with the ability to download data has been developed using only relevant functions from UDS and following the AUTOSAR specifications where it is applicable. Sammanfattning iii Sammanfattning Fr att kunna testa fordon
9、sfunktioner i fabriken, tgrda mjukvarufel under service eller fr att uppgradera fordonet med nya funktioner r det viktigt att kunna ladda ner ny mjukvara till fordonets styrsystem. Den standardiserade mjukvaruplattformen fr fordonsindustrin, AUTOSAR, innehller tv protokoll som bda specificerar hur m
10、jukvara kan laddas ner: Unified Diagnostic Services (UDS) och Universal Measurement and Calibration Protocol (XCP). Tyvrr r de delarna av UDS och XCP som beskriver mjukvarunerladdning inte en del av AUTOSAR n. I det hr examensarbetet har UDS och XCP jmfrts fr att utvrdera vilken av de bda som i dags
11、lget har strst std fr nerladdning av mjukvara i AUTOSAR och vilken som troligast kommer att bli en del av AUTOSAR i framtiden. Eftersom AUTOSAR redan stdjer ngra av de funktioner i UDS som behvs fr nerladdning av mjukvara samt p grund av att UDS r en del av branschstandarden fr fordonsdiagnostik OBD
12、-II, har UDS valts som den mest lmpade att i dagslget anvndas fr att implementera nerladdning av mjukvara enligt AUTOSAR. En bootloader som stdjer nerladdning av mjukvara via UDS har sedan implementerats enligt AUTOSAR-specifikationen s lngt som mjligt. Keywords iv Keywords AUTOSAR UDS XCP Bootloade
13、r Reprogramming ECU Software Downloads CAN Table of Contents v Table of Contents 1 Introduction . 1 1.1 BACKGROUND . 1 1.2 PURPOSE AND RESEARCH QUESTIONS 1 1.3 DELIMITATIONS 2 1.4 OUTLINE . 2 2 Theoretical background 3 2.1 BOOTLOADER 3 2.2 CONTROLLER AREA NETWORK . 5 2.2.1 Concept of CAN 5 2.3 AUTOS
14、AR . 6 2.4 UNIFIED DIAGNOSTIC SERVICES (UDS) 9 2.4.1 Relationship between UDS and AUTOSAR 14 2.4.2 An UDS use case: Flash Reprogramming 19 2.5 UNIVERSAL MEASUREMENT AND CALIBRATION PROTOCOL (XCP) 20 2.5.1 Packets 21 2.5.2 Security . 22 2.5.3 Flash programming 22 2.5.4 Flash memory access 23 2.5.5 Re
15、lationship between XCP and AUTOSAR 25 2.6 ODEEP QR5567 DEVELOPMENT PLATFORM 28 2.6.1 MPC5567 29 3 Method and implementation 30 3.1 BOOTLOADER FUNCTIONALITY . 30 3.1.1 Setup of MCU (Primary Bootloader) 30 3.1.2 Reprogramming of MCU (Secondary Bootloader) . 34 3.1.3 Creating the bootloaders 34 3.2 USE
16、 OF UDS . 35 3.3 UDS MESSAGES 35 3.3.1 Frames 35 3.3.2 Implemented UDS services . 36 3.4 TOOLS USED . 57 3.4.1 Arctic Studio . 57 3.4.2 PEEDI . 58 3.4.3 SRecord . 59 3.4.4 CANalyzer and CANcaseXL . 60 4 Findings and Analysis . 63 4.1 COMPARISON BETWEEN UDS AND XCP . 63 4.2 INITIALIZATION AND STARTUP 65 4.3 COMMUNICATION . 65 4.3.1 Data flow through layers 65 4.3.2 Data flow through layers, Example: . 67 4.3.3 Diagnostic Sessions 69 4.4 REPROGRAMMIN