Specification Of A Request Manager For SAE J1939 - AUTOSAR

Transcription

Specification of a Request Manager for SAE J1939AUTOSAR CP Release 4.3.1Document TitleSpecification of a RequestManager for SAE J1939Document OwnerDocument ResponsibilityDocument Identification NoDocument StatusPart of AUTOSAR StandardPart of Standard ReleaseAUTOSARAUTOSAR611FinalClassic Platform4.3.1Document Change HistoryDateRelease Changed nagement2014-03-314.1.3AUTOSARReleaseManagement1 of 80Change Description Clarified availability ofJ1939Rm ComRxIpduCallout Added internal feedback of ACKM Clarification of extIdInfo parameterand underlying standard Improved parameter checks Request2 support Improved handling of meta data Reliable TxConfirmation replacestimeout Separate configuration of differentusers Fixed names and signatures ofservice ports Support for explicit broadcast ofACKM Introduction of further error classes Improved interaction with COM Harmonized with SWS BSWGeneral Clarified availability of callbacks Standardized callback headernames Fixed UserType EnumDocument ID 611: AUTOSAR SWS SAEJ1939RequestManager- AUTOSAR confidential -

Specification of a Request Manager for SAE J1939AUTOSAR CP Release 4.3.1Document Change HistoryDateRelease Changed 52 of 804.1.1AUTOSARAdministrationChange Description Additional development error forfunction parameter checks Clarification of Request timeout andstate handling Separate configuration of receivedand transmitted PGNs Removed change documentation Initial ReleaseDocument ID 611: AUTOSAR SWS SAEJ1939RequestManager- AUTOSAR confidential -

Specification of a Request Manager for SAE J1939AUTOSAR CP Release 4.3.1DisclaimerThis work (specification and/or software implementation) and the material containedin it, as released by AUTOSAR, is for the purpose of information only. AUTOSARand the companies that have contributed to it shall not be liable for any use of thework.The material contained in this work is protected by copyright and other types ofintellectual property rights. The commercial exploitation of the material contained inthis work requires a license to such intellectual property rights.This work may be utilized or reproduced without any modification, in any form or byany means, for informational purposes only. For any other purpose, no part of thework may be utilized or reproduced, in any form or by any means, without permissionin writing from the publisher.The work has been developed for automotive applications only. It has neither beendeveloped, nor tested for non-automotive applications.The word AUTOSAR and the AUTOSAR logo are registered trademarks.3 of 80Document ID 611: AUTOSAR SWS SAEJ1939RequestManager- AUTOSAR confidential -

Specification of a Request Manager for SAE J1939AUTOSAR CP Release 4.3.1Table of Contents1Introduction and functional overview . 71.11.21.3Request Management according to SAE J1939 . 7J1939 Request Manager BSW Module . 7J1939 Terminology . 72Acronyms and abbreviations . 93Related documentation. 103.13.23.34Input documents . 10Related standards and norms . 11Related specification . 11Constraints and assumptions . 124.14.25Limitations . 12Applicability to car domains . 12Dependencies to other modules . 135.1 File structure . 135.1.1 Code file structure . 135.1.2 Header file structure . 136Requirements traceability . 157Functional specification . 167.1 Overview . 167.2 Module Handling . 167.2.1 Initialization . 167.2.2 Timing Related Functionality . 177.3 Communication State Handling . 177.4 Reception of Requests . 177.4.1 Request Forwarding . 187.4.2 Request Handling via COM. 187.4.3 Request of Unknown PGNs . 197.5 Transmission of Acknowledgements . 197.6 Transmission of Requests . 207.7 Reception of Acknowledgements . 217.8 Timeout Supervision . 227.9 Error classification . 237.9.1 Development Errors . 237.9.2 Runtime Errors . 237.9.3 Transient Faults . 247.9.4 Production Errors . 247.9.5 Extended Production Errors . 247.10API Parameter Checking . 248API specification . 258.1 Imported types . 258.2 Type definitions . 258.2.1 J1939Rm ConfigType . 258.2.2 J1939Rm StateType . 254 of 80Document ID 611: AUTOSAR SWS SAEJ1939RequestManager- AUTOSAR confidential -

Specification of a Request Manager for SAE J1939AUTOSAR CP Release 4.3.18.3 Function definitions. 258.3.1 J1939Rm Init . 268.3.2 J1939Rm DeInit . 268.3.3 J1939Rm GetVersionInfo . 268.3.4 J1939Rm SetState . 278.3.5 J1939Rm SendRequest . 288.3.6 J1939Rm CancelRequestTimeout . 298.3.7 J1939Rm SendAck . 308.4 Call-back notifications. 318.4.1 J1939Rm RxIndication . 318.4.2 J1939Rm TxConfirmation . 318.4.3 J1939Rm ComRxIpduCallout. 328.5 Scheduled functions . 338.5.1 J1939Rm MainFunction . 338.6 Expected Interfaces . 338.6.1 Mandatory Interfaces . 338.6.2 Optional Interfaces . 338.6.3 Configurable interfaces . 348.7 Service Port Descriptions . 368.7.1 Provided Service Ports . 368.7.2 Required Service Ports . 378.7.3 Client-Server Interfaces . 388.7.4 Implementation Data Types . 479Sequence diagrams . 499.19.29.39.49.59.69.710Reception of Request PG . 49Transmission of Acknowledgement PG . 49Handling of Request for a COM Pdu . 50Handling of Request for a Diagnostic Pdu . 51Transmission of Request PG . 51Reception of Acknowledgement PG . 52Monitoring of Request Timeout . 53Configuration specification . 5410.1Containers and configuration parameters . 5410.1.1J1939Rm . 6010.1.2J1939RmGeneral . 6010.1.3J1939RmConfigSet. 6310.1.4J1939RmChannel . 6310.1.5J1939RmAckmRxPdu. 6510.1.6J1939RmAckmTxPdu . 6610.1.7J1939RmRqstRxPdu . 6710.1.8J1939RmRqstTxPdu. 6710.1.9J1939RmRqst2RxPdu . 6810.1.10 J1939RmRqst2TxPdu. 6910.1.11 J1939RmNode . 7010.1.12 J1939RmUser . 7010.1.13 J1939RmNmUser . 7110.1.14 J1939RmDcmUser . 7110.1.15 J1939RmCddUser . 7210.1.16 J1939RmRteUser . 755 of 80Document ID 611: AUTOSAR SWS SAEJ1939RequestManager- AUTOSAR confidential -

Specification of a Request Manager for SAE J1939AUTOSAR CP Release 4.3.110.1.17 J1939RmComUser . 7810.1.18 J1939RmComIPdu . 7910.2Published Information. 806 of 80Document ID 611: AUTOSAR SWS SAEJ1939RequestManager- AUTOSAR confidential -

Specification of a Request Manager for SAE J1939AUTOSAR CP Release 4.3.11Introduction and functional overviewThis specification specifies the functionality, API and the configuration of theAUTOSAR Basic Software module J1939 Request Manager.1.1 Request Management according to SAE J1939J1939 defines a special parameter group (PG) called Request (RQST, PGN 0x0EA00), which may be used to request transmission of any other parameter group.The Request parameter group just contains the PGN of the requested parametergroup.Depending on the destination address used by the Request PG, the response mustbe sent directly to the requesting ECU, or to all ECU. For short parameter groupswith PDU1 format, the destination address is set accordingly1, for large parametergroups the suitable transport protocol mode (BAM or CMDT, see [9] and [18]) isused.Depending on the requested parameter group and the destination address of theRequest PG, ECUs answer either with the requested parameter group, with thespecial Acknowledgement parameter group (ACKM, PGN 0x0E800), or not at all.Finally, J1939 defines that the response to a Request will be expected within 1.25safter the Request was sent. The responding node is required to answer within200ms.Besides the Request PG, J1939 also defines a Request2 PG (RQST2,PGN 0xC900). The behavior of this PG is identical to that of the Request PG, withthe following extensions: A transmission with the transfer function can be requested to provide thesame PG from multiple ECUs. Extended identifier bytes can be specified to request a defined layout of amultiplexed message.1.2 J1939 Request Manager BSW ModuleThe J1939 Request Manager (J1939Rm) handles received and transmitted Request,Request2, and Acknowledgement PGs. It natively supports handling of incomingrequests for address claim and is configurable to support incoming requests fordiagnostic and other J1939 PGNs. Unknown incoming requests are answered with anegative Acknowledgement PG if they address a specific destination address.The J1939Rm also supports transmission of requests and timeout supervision for theresulting PG or acknowledgement.1.3 J1939 TerminologyThe terminology of J1939 differs noticeably from the usual AUTOSAR terminology.For consistency reasons, this introduction used the terms of the J1939 specification,1Short parameter groups with PDU2 format have no destination address, they are broadcast PGs bynature.7 of 80Document ID 611: AUTOSAR SWS SAEJ1939RequestManager- AUTOSAR confidential -

Specification of a Request Manager for SAE J1939AUTOSAR CP Release 4.3.1while the remainder of this specification will use terms that are more common withinAUTOSAR:- ‘I-PDU’ replaces ‘parameter group’8 of 80Document ID 611: AUTOSAR SWS SAEJ1939RequestManager- AUTOSAR confidential -

Specification of a Request Manager for SAE J1939AUTOSAR CP Release 4.3.12Acronyms and abbreviationsAbbreviation STRQST2RTESW-CXFER9 of 80Description:J1939 AddressClaimed PG (PGN 0x0EE00)J1939 Acknowledgement PG (ACKM) with control byte set to 0J1939 Acknowledgement PG (PGN 0x0E800)Basic Software (module)Controller Application, role of an ECU tied to one addressDefault Error Tracer, supports development and runtime error reportingData Page, the most significant bit (MSB) of the 18 bit PGNExtended Data Page, the second bit (after MSB) of the 18 bit PGNJ1939 Acknowledgement PG (ACKM) with control byte set to 1PDU Format, the middle byte of the 18 bit PGNPDU Specific, the lower byte of the 18 bit PGNParameter GroupParameter Group Number (18 bits, contains EDP, DP, PDUF, PDUS)J1939 Request PG (PGN 0x0EA00)J1939 Request2 PG (PGN 0x0C900)AUTOSAR Runtime EnvironmentAUTOSAR Software Component (of the Application)J1939 Transfer PG (PGN 0x0CA00)Document ID 611: AUTOSAR SWS SAEJ1939RequestManager- AUTOSAR confidential -

Specification of a Request Manager for SAE J1939AUTOSAR CP Release 4.3.13Related documentation3.1 Input documents[1] List of Basic Software ModulesAUTOSAR TR BSWModuleList.pdf[2] Layered Software ArchitectureAUTOSAR EXP LayeredSoftwareArchitecture.pdf[3] General Requirements on Basic Software ModulesAUTOSAR SRS BSWGeneral.pdf[4] General Specification of Basic Software ModulesAUTOSAR SWS BSWGeneral.pdf[5] Requirements on BSW Modules for SAE J1939AUTOSAR SRS J1939.pdf[6] Specification of Communication Stack TypesAUTOSAR SWS CommunicationStackTypes.pdf[7] System TemplateAUTOSAR TPS SystemTemplate.pdf[8] Specification of CAN InterfaceAUTOSAR SWS CANInterface.pdf[9] Specification of a Transport Layer for SAE J1939AUTOSAR SWS SAEJ1939TransportLayer.pdf[10] Specification of PDU RouterAUTOSAR SWS PDURouter.pdf[11] Specification of CommunicationAUTOSAR SWS COM.pdf[12] Specification of Network Management for SAE J1939AUTOSAR SWS SAEJ1939NetworkManagement.pdf[13] Specification of a Diagnostic Communication Manager for SAE J1939AUTOSAR SWS SAEJ1939DiagnosticCommunicationManager.pdf[14] Specification of Default Error TracerAUTOSAR SWS DefaultErrorTracer.pdf[15] Specification of BSW SchedulerAUTOSAR SWS BSWScheduler.pdf10 of 80Document ID 611: AUTOSAR SWS SAEJ1939RequestManager- AUTOSAR confidential -

Specification of a Request Manager for SAE J1939AUTOSAR CP Release 4.3.1[16] Specification of ECU ConfigurationAUTOSAR TPS ECUConfiguration.pdf[17] Specification of Memory MappingAUTOSAR SWS MemoryMapping.pdf3.2 Related standards and norms[18]J1939-21 MAR2016, Data Link Layer3.3 Related specificationAUTOSAR provides a General Specification on Basic Software modules [4] (SWSBSW General), which is also valid for the SAE J1939 Request Manager.Thus, the specification SWS BSW General shall be considered as additional andrequired specification for SAE J1939 Transport Layer.11 of 80Document ID 611: AUTOSAR SWS SAEJ1939RequestManager- AUTOSAR confidential -

Specification of a Request Manager for SAE J1939AUTOSAR CP Release 4.3.14Constraints and assumptions4.1 LimitationsThe J1939 Request Manager only implements Request, Request2,Acknowledgement PGs. It does not provide support for the Transfer PG.and4.2 Applicability to car domainsJ1939 is developed by the SAE as a standard for heavy-duty on-highway, farming,and construction vehicles. It is not applicable to passenger cars or light trucks.12 of 80Document ID 611: AUTOSAR SWS SAEJ1939RequestManager- AUTOSAR confidential -

Specification of a Request Manager for SAE J1939AUTOSAR CP Release 4.3.15Dependencies to other modulesThe J1939 Request Manager (J1939Rm) has interfaces towards COM, the PDURouter (PduR), the J1939 Network Management module (J1939Nm), the J1939Diagnostic Communication Management module (J1939Dcm), the Default ErrorTracer (DET), and application software components (SW-Cs) via the AUTOSARRuntime Environment (RTE). It also supports Complex Drivers (CDD).The J1939 Request Manager includes header files of COM, J1939Nm, J1939Dcm,PduR, DET, CDDs, and the RTE.5.1 File structure5.1.1 Code file structureFor details, refer to the section 5.1.6 "Code file structure" of the SWS BSW General[4].5.1.2 Header file structureBesides the files defined in section 5.1.7 “Header file structure” of the SWS BSWGeneral [4], the J1939 Request Manager needs to include the files defined below.[SWS J1939Rm 00001] ⌈The implementation and callback header files (J1939Rm.hand J1939Rm Cbk.h) shall include the file J1939Rm Types.h.⌋ (SRS BSW 00415)[SWS J1939Rm 00032] ⌈The header file J1939Rm Types.h shall include the fileComStack Types.h.⌋ (SRS BSW 00415)[SWS J1939Rm 00114] ⌈J1939Rm shall include the header file Com.h if at least oneJ1939RmComUser is configured. ⌋ ()[SWS J1939Rm 00111] ⌈J1939Rm shall include the header file J1939Nm Cbk.h ifat least one J1939RmNmUser is configured.⌋ ()[SWS J1939Rm 00112] ⌈J1939Rm shall include the header file J1939Dcm Cbk.h ifat least one J1939RmDcmUser is configured.⌋ ()[SWS J1939Rm 00113] ⌈J1939Rm shall include a header apiServicePrefix Cbk.h for every configured J1939RmCddUser.⌋ ()filenamedPlease note: Complex driver (CDD) APIs use the module prefix configured by theapiServicePrefix of the CDD’s module description file.[SWS J1939Rm 00110] ⌈J1939Rm shall include the header file Rte J1939Rm.h.⌋ ()The following picture shows the include hierarchy of the J1939 Request Manager.13 of 80Document ID 611: AUTOSAR SWS SAEJ1939RequestManager- AUTOSAR confidential -

Specification of a Request Manager for SAE J1939AUTOSAR CP Release 4.3.1Figure 1: Include hierarchy of J1939Rm14 of 80Document ID 611: AUTOSAR SWS SAEJ1939RequestManager- AUTOSAR confidential -

Specification of a Request Manager for SAE J1939AUTOSAR CP Release 4.3.16Requirements traceabilityRequirementDescriptionSRS BSW 00407Each BSW module shallprovide a function to read outthe version information of adedicated moduleimplementationSWS J1939Rm 00039SRS BSW 00415Interfaces which are providedexclusively for one moduleshall be separated into adedicated header fileSWS J1939Rm 00001, SWS J1939Rm 00032SRS J1939 00012 The J1939 Request Managershall provide an interface formodule initializationSWS J1939Rm 00012, SWS J1939Rm 00037,SWS J1939Rm 00073SRS J1939 00013 The J1939 Request Managershall provide an interface formodule shutdownSWS J1939Rm 00013, SWS J1939Rm 00038SRS J1939 00014 The J1939 Request Managershall forward incomingrequests to configureddestinationsSWS J1939Rm 00002, SWS J1939Rm 00003,SWS J1939Rm 00007, SWS J1939Rm 00008,SWS J1939Rm 00063, SWS J1939Rm 00100,SWS J1939Rm 00107, SWS J1939Rm 00115,SWS J1939Rm 00116SRS J1939 00015 The J1939 Request Managershall forward incomingacknowledgements toconfigured destinationsSWS J1939Rm 00026, SWS J1939Rm 00027,SWS J1939Rm 00028, SWS J1939Rm 00064,SWS J1939Rm 00066, SWS J1939Rm 00101,SWS J1939Rm 00106, SWS J1939Rm 00126SRS J1939 00016 The J1939 Request Managershall provide an interface fortransmission of requestmessagesSWS J1939Rm 00016, SWS J1939Rm 00021,SWS J1939Rm 00022, SWS J1939Rm 00023,SWS J1939Rm 00025, SWS J1939Rm 00054,SWS J1939Rm 00097, SWS J1939Rm 00104,SWS J1939Rm 00118SRS J1939 00017 The J1939 Request Managershall provide an interface fortransmission ofacknowledgement messagesSWS J1939Rm 00008, SWS J1939Rm 00009,SWS J1939Rm 00018, SWS J1939Rm 00019,SWS J1939Rm 00020, SWS J1939Rm 00056,SWS J1939Rm 00098, SWS J1939Rm 00103SRS J1939 00026 The J1939 Request Managershall support timeoutsupervision for outgoingrequestsSWS J1939Rm 00017, SWS J1939Rm 00024,SWS J1939Rm 00029, SWS J1939Rm 00030,SWS J1939Rm 00055, SWS J1939Rm 00065,SWS J1939Rm 00099, SWS J1939Rm 00102,SWS J1939Rm 00105, SWS J1939Rm 0010815 of 80Satisfied byDocument ID 611: AUTOSAR SWS SAEJ1939RequestManager- AUTOSAR confidential -

Specification of a Request Manager for SAE J1939AUTOSAR CP Release 4.3.17Functional specificationThis chapter defines the behavior of the J1939 Request Manager. The API of themodule is defined in chapter 8, while the configuration is defined in chapter 10.7.1 OverviewOn one side, the J1939 Request Manager is responsible for routing incoming RQSTand RQST2 PGs to the correct destination, and to provide an infrastructure forsending responding ACKM PGs.On the other side, the J1939 Request Manager also provides an infrastructure tosend RQST and RQST2 PGs, and to supervise timeout of the response(s), includingbut not limited to ACKM PGs.The J1939 Request Manager uses meta data items of type CAN ID 32 of thereceived and transmitted ACKM and RQST PGs to access the source address, thedestination address, and the priority which are encoded in the CAN ID.[SWS J1939Rm 00119] ⌈Meta data items of type CAN ID 32 contain the sourceaddress in the fourth (least significant) byte.⌋ ()[SWS J1939Rm 00120] ⌈Meta data items of type CAN ID 32 contain thedestination address in the third byte.⌋ ()[SWS J1939Rm 00121] ⌈Meta data items of type CAN ID 32 contain the priority inthe bits 2-4 of the first (most significant) byte, where bit 0 is the least significant bit ofa byte.⌋ ()7.2 Module HandlingThis section contains description of auxiliary functionality of the J1939 RequestManager.7.2.1 InitializationThe J1939 Request Manager is initialized via J1939Rm Init, and de-initialized viaJ1939Rm DeInit. Except for J1939Rm GetVersionInfo and J1939Rm Init, the APIfunctions of the J1939 Request Manager may only be called after the module hasbeen properly initialized.[SWS J1939Rm 00012] ⌈A call to J1939Rm Init initializes all internal variables andsets the J1939 Request Manager to the initialized state.⌋ (SRS J1939 00012)[SWS J1939Rm 00013] ⌈A call to J1939Rm DeInit sets the J1939 RequestManager back to the uninitialized state.⌋ (SRS J1939 00013)16 of 80Document ID 611: AUTOSAR SWS SAEJ1939RequestManager- AUTOSAR confidential -

Specification of a Request Manager for SAE J1939AUTOSAR CP Release 4.3.1[SWS J1939Rm 00010] ⌈If DET reporting is enabled via J1939RmDevErrorDetect,the J1939 Request Manager shall call Det ReportError with the error codeJ1939RM E UNINITwhenanyAPIotherthanJ1939Rm InitorJ1939Rm GetVersionInfo is called in uninitialized state.⌋ ()[SWS J1939Rm 00011] ⌈When J1939Rm Init is called in initialized state, the J1939Request Manager shall not re-initialize its internal variables. It shall instead callDet ReportError with the error code J1939RM E REINIT if DET reporting is enabled(see J1939RmDevErrorDetect).⌋ ()7.2.2 Timing Related FunctionalityTo be able to measure times, the J1939 Request Manager is triggered cyclically viathe J1939Rm MainFunction.[SWS J1939Rm 00072] ⌈The J1939 Request Manager shall use theJ1939Rm MainFunction for timing related purposes.⌋ ()7.3 Communication State HandlingIn general, request handling is only active when the ECU is online (see [12] fordetails). The exceptions to this rule are received and transmitted requests for theAddressClaimed PG, which must be possible in all cases. The J1939 RequestManager provides an API that is used by the BSW Mode Manager (BswM) to notifythe J1939 communication state.[SWS J1939Rm 00073] ⌈During initialization via J1939Rm Init, the J1939 RequestManager assumes the offline state for all nodes on all channels.⌋(SRS J1939 00012)[SWS J1939Rm 00014] ⌈A call to J1939Rm SetState sets the state of a node'schannel to online or offline.⌋ ()[SWS J1939Rm 00015] ⌈In the offline state, the J1939 Request Manager onlyprocesses requests for the AddressClaimed PG, while timeout supervision andacknowledgement handling are completely disabled.⌋ ()7.4 Reception of RequestsThe J1939 Request Manager receives request PGs (RQST and RQST2) viaJ1939Rm RxIndication from the CAN Interface. The J1939 Request Manager shalluse the meta data item type CAN ID 32 to be able to identify the sender, thedestination address, and the priority of the request.[SWS J1939Rm 00122] ⌈The J1939 Request Manager shall use a meta data item oftype CAN ID 32 to determine the source address, destination address, and priorityof received Request PGs.⌋ ()17 of 80Document ID 611: AUTOSAR SWS SAEJ1939RequestManager- AUTOSAR confidential -

Specification of a Request Manager for SAE J1939AUTOSAR CP Release 4.3.1[SWS J1939Rm 00007] ⌈The J1939 Request Manager shall only accept requestsaddressed to the whole network (global DA), or to one of the configured addresses ofthe ECU (see J1939RmNmNodeRef).⌋ (SRS J1939 00014)Requests for the AddressClaimed PG (AC, PGN 0x0EE00) always go to the J1939Network Management module. Requests for the DMx PGs (DM01 to DM57) alwaysgo to the J1939 Diagnostic Communication Manager, the destination of these andother PGNs is configured via J1939RmUserRequestPGN.Besides forwarding to the J1939 Network Management module, the J1939Diagnostic Communication Manager, and CDDs, the J1939 Request Manager canalso forward requests to SW-Cs, and trigger COM to send requested PGs.7.4.1 Request ForwardingForwarding to other BSW modules is done via the generic callout function User RequestIndication (see section 8.6.3.1). Forwarding to SW-C uses adedicated service port function with the same signature as the User RequestIndication.[SWS J1939Rm 00002] ⌈When J1939Rm RxIndication is called by the PDU Routerto indicate reception of a request, and the requested PGN is configured viaJ1939RmUserRequestPGN to trigger either the J1939 Diagnostic CommunicationManager or a CDD, the J1939 Request Manager shall call the corresponding User RequestIndication.⌋ (SRS J1939 00014)[SWS J1939Rm 00116] ⌈When J1939Rm RxIndication is called by the PDU Routerto indicate reception of a request, and the requested PGN is AddressClaimed (AC,0xEE00), the J1939 Request Manager shall call J1939Nm RequestIndication.⌋(SRS J1939 00014)[SWS J1939Rm

AUTOSAR Basic Software module J1939 Request Manager. 1.1 Request Management according to SAE J1939 J1939 defines a special parameter group (PG) called Request (RQST, PGN 0x0EA00), which may be used to request transmission of any other parameter group. The Request parameter group just contains the PGN of the requested parameter group.