{"id":20180579,"url":"https://github.com/sauci/xcp","last_synced_at":"2025-04-10T04:57:55.457Z","repository":{"id":46589274,"uuid":"450074594","full_name":"Sauci/Xcp","owner":"Sauci","description":"Implementation of the Xcp module according to AUTOSAR specification v4.3.1","archived":false,"fork":false,"pushed_at":"2024-06-27T05:37:58.000Z","size":552,"stargazers_count":20,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-24T06:11:40.808Z","etag":null,"topics":["autosar","c","ecu","xcp"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sauci.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-20T11:45:21.000Z","updated_at":"2025-03-18T21:15:55.000Z","dependencies_parsed_at":"2024-06-27T06:54:16.459Z","dependency_job_id":null,"html_url":"https://github.com/Sauci/Xcp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sauci%2FXcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sauci%2FXcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sauci%2FXcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sauci%2FXcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sauci","download_url":"https://codeload.github.com/Sauci/Xcp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161264,"owners_count":21057554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autosar","c","ecu","xcp"],"created_at":"2024-11-14T02:31:54.042Z","updated_at":"2025-04-10T04:57:55.430Z","avatar_url":"https://github.com/Sauci.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"| branch                                               | build status                                                                                                                                         | coverage                                                                                                                     |\n|:-----------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|\n| [master](https://github.com/Sauci/Xcp/tree/master)   | [![test](https://github.com/Sauci/Xcp/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/Sauci/Xcp/actions/workflows/test.yml)  | [![codecov](https://codecov.io/gh/Sauci/Xcp/branch/master/graph/badge.svg)](https://codecov.io/gh/Sauci/Xcp/branch/master)   |\n| [develop](https://github.com/Sauci/Xcp/tree/develop) | [![test](https://github.com/Sauci/Xcp/actions/workflows/test.yml/badge.svg?branch=develop)](https://github.com/Sauci/Xcp/actions/workflows/test.yml) | [![codecov](https://codecov.io/gh/Sauci/Xcp/branch/develop/graph/badge.svg)](https://codecov.io/gh/Sauci/Xcp/branch/develop) |\n\n# Configure/Compile -time definitions\nThe following definitions might be set by the user, depending on the needs.\n\n| definition                    | values                           | default                    | description                                                                                                                                                                      |\n|:------------------------------|:---------------------------------|:---------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ```AUTOSAR_STD_HEADER_PATH``` | ```-```                          | ```Xcp/test/stub/common``` | specifies the directory containing **AUTOSAR** standard headers ComStack_Types.h and Std_Types.h (used when integrating this module in an other project)                         |\n| ```XCP_CONFIG_FILEPATH```     | ```-```                          | ```Xcp/config/xcp.json```  | specifies which json configuration file should be used to generate the auto-generated code                                                                                       |\n| ```XCP_ENABLE_TEST```         | ```ON```/```OFF```               | ```OFF```                  | enables/disables tests.                                                                                                                                                          |\n| ```ENABLE_DET```              | ```ON```/```OFF```               | ```ON```                   | enables/disables development error detections (see AUTOSAR [DET](https://www.autosar.org/fileadmin/user_upload/standards/classic/4-3/AUTOSAR_SWS_DefaultErrorTracer.pdf) module) |\n| ```ENABLE_DOC_GEN```          | ```ON```/```OFF```               | ```OFF```                  | enables/disables generation of [Doxygen](http://www.doxygen.nl/) documentation                                                                                                   |\n| ```ENABLE_PC_LINT```          | ```ON```/```OFF```               | ```OFF```                  | enables/disables generation of targets related to static code analysis (should be disabled if [PC-Lint](https://www.gimpel.com) software is not available)                       |\n| ```MISRA_C_VERSION```         | ```1998```/```2004```/```2012``` | ```2012```                 | specifies which version of **MISRA** should be used when performing static code analysis (only used if ```ENABLE_PC_LINT``` is set)                                              |\n| ```XCP_SUPPRESS_TX_SUPPORT``` | ```ON / OFF```                   | ```ON```                   | enables/disables transmission functionality of the XCP module                                                                                                                    | \n\nTo use this feature, simply add ```-D\u003cdefinition\u003e=\u003cvalue\u003e``` when configuring the build with CMake.\n\n# Module configuration\nA large part of this module consists of auto-generated code. It takes a *JSON* file as input (the path of this file is\nspecified through the `XCP_CONFIG_FILEPATH` CMake variable, defaulting to [this](config/xcp.json) file), and generates \nthe *Xcp_Cfg.c* and *Xcp_Cfg.h* files. The content of this configuration file is specified with the *JSON* schema\navailable [here](config/xcp.schema.json). Most of the recent IDEs are providing auto-completion of the configuration \nfile based on its schema, thus it is highly recommended using it.\n\n# Implementation details\nThis section gives a few implementation details, where the specification is not very clear or a little bit fuzzy. This\nwill allow the user to properly configure the communication parameters on the master side.\n\n## Seed lifetime\nWhenever the seed is requested by the master trough the `GET_SEED` command, a new seed is requested by the XCP stack \nthrough the `Xcp_GetSeed` function. The idea behind it is that if the slave would not do this, the master could \ncalculate a key for a single seed and use it forever, which would lead to a less secured resource protection.\n\nWhenever the master issues a `UNLOCK` command, the slave will discard the seed as well, either upon successful and \nunsuccessful command result. This implies a new `GET_SEED` request for each `UNLOCK` command.\n\nThe `Xcp_GetSeed` function implementation is left to the stack user. The target on which the stack is integrated could\nprovide some random value generator, thus this is target-specific. The function's prototype is defined \n[here](./test/stub/Xcp_SeedKey.h).\n\n## Key lifetime\nWhenever an `UNLOCK` command is issued by the master, the key is calculated by the slave using the last seed value\nrequested by the master. No matter if the keys are matching or not, the key validity is discarded after the execution of\nthe command following the `UNLOCK` sequence.\n\nIf the master issues a `UNLOCK` command without calling `GET_SEED` first, the stack will respond with and error packet\nidentifier, and the code `ERR_SEQUENCE`.\n\nThe implementation of the function responsible for key calculation, `Xcp_CalcKey` is left to the user. This is required,\nas the function must be shared between the master and the slave.\n\n# Limitations\n- The `GET_SLAVE_ID` command (CTO = `TRANSPORT_LAYER_CMD`, sub-command = `0xFF`) returns the PDU ID of the \n  **CMD**/**STIM** communication channel, not the CAN identifier directly. This is implemented this way to prevent \n  dependencies on the PDU mapping table in this module.\n- The `GET_ID` command only supports the request identification type 0 (*ASCII text*).\n---\n# TODO\n- Protect variables used in both synchronous and asynchronous APIs.\n- Use pre-processor to enable/disable optional APIs.\n- Implement sub-command `SET_DAQ_LIST_CAN_IDENTIFIER` for CTO `TRANSPORT_LAYER_CMD`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsauci%2Fxcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsauci%2Fxcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsauci%2Fxcp/lists"}