CRC Library (Crc)
AUTOSAR Classic Libraries-Modul CRC Library (Crc, Spezifikation: AUTOSAR_CP_SWS_CRCLibrary.pdf, AUTOSAR_SWS_CRCLibrary.pdf, AUTOSAR_SWS_CRC_Routines.pdf).
Funktionen — Übersicht
uint16 Crc_CalculateCRC16 (const uint8* Crc_DataPtr, uint32 Crc_Length, uint16 Crc_StartValue16, boolean Crc_IsFirstCall);This service makes a CRC16 calculation on Crc_Length data bytes.uint32 Crc_CalculateCRC32 (const uint8* Crc_DataPtr, uint32 Crc_Length, uint32 Crc_StartValue32, boolean Crc_IsFirstCall);This service makes a CRC32 calculation on Crc_Length data bytes.void Crc_GetVersionInfo (Std_VersionInfoType* Versioninfo);This service returns the version information of this module.uint8 Crc_CalculateCRC8 (const uint8* Crc_DataPtr, uint32 Crc_Length, uint8 Crc_StartValue8, boolean Crc_IsFirstCall);This service makes a CRC8 calculation on Crc_Length data bytes, with SAE J1850 parametersuint8 Crc_CalculateCRC8H2F (const uint8* Crc_DataPtr, uint32 Crc_Length, uint8 Crc_StartValue8H2F, boolean Crc_IsFirstCall);This service makes a CRC8 calculation with the Polynomial 0x2F on Crc_Lengthuint32 Crc_CalculateCRC32P4 (const uint8* Crc_DataPtr, uint32 Crc_Length, uint32 Crc_StartValue32, boolean Crc_IsFirstCall);This service makes a CRC32 calculation on Crc_Length data bytes, using the polynomial 0x F4ACFB13.uint64 Crc_CalculateCRC64 (const uint8* Crc_DataPtr, uint32 Crc_Length, uint64 Crc_StartValue64, boolean Crc_IsFirstCall);This service makes a CRC64 calculation on Crc_Length data bytes, using the polynomial 0x42F0E1EBA9EA3693.uint16 Crc_CalculateCRC16ARC (const uint8* Crc_DataPtr, uint32 Crc_Length, uint16 Crc_StartValue16, boolean Crc_IsFirstCall);This service makes a CRC16 calculation on Crc_Length data bytes, using the polynomial 0x8005.
Anforderungen — Übersicht
SWS_Crc_00002The CRC module shall implement the CRC16 routine based on the CCITT-FALSE CRC16 Standard, according to the following table:...SWS_Crc_00003The CRC module shall implement the CRC32 routine based on the IEEE-802.SWS_Crc_00009If the CRC calculation within the function Crc_CalculateCRC16 is performed by hardware, then the CRC module's implementer...SWS_Crc_00010If the CRC calculation within the function Crc_CalculateCRC32 is performed by hardware, then the CRC module's implementer...SWS_Crc_00011The function Crc_GetVersionInfo shall return the version in- formation of the CRC module.SWS_Crc_00013If CRC routines are to be used as a library, the CRC modules' implementer shall develop the CRC module in a way that only...SWS_Crc_00014The CRC function (with parameter Crc_IsFirstCall = TRUE) shall do the following operations: 1.SWS_Crc_00015The function Crc_CalculateCRC16 shall perform a CRC16 cal- culation using polynomial 0x1021 on Crc_Length data bytes, pointed...SWS_Crc_00016The function Crc_CalculateCRC32 shall perform a CRC32 cal- culation using polynomial 0x04C11DB7 on Crc_Length data bytes,...SWS_Crc_00017If source code for caller and callee of the function Crc_GetVer- sionInfo is available, the CRC module should realize this...SWS_Crc_00018Module Header File Imported Type Std Std_Types.SWS_Crc_00030The Crc_CalculateCRC8 function of the CRC module shall im- plement the CRC8 routine based on the SAE-J1850 CRC8 Standard,...SWS_Crc_00032The function Crc_CalculateCRC8 shall perform a CRC8 cal- culation using polynomial 0x1D on Crc_Length data bytes, pointed to...SWS_Crc_00033If the CRC calculation within the function Crc_CalculateCRC8 is performed by hardware, then the CRC module's implementer shall...SWS_Crc_00041The CRC function (with parameter Crc_IsFirstCall = FALSE) shall do the following operations: 1.SWS_Crc_00042The Crc_CalculateCRC8H2F function of the CRC module shall implement the CRC8 routine based on the generator polynomial 0x2F,...SWS_Crc_00044The function Crc_CalculateCRC8H2F shall perform a CRC8 calculation with the polynomial 0x2F on Crc_Length data bytes, pointed...SWS_Crc_00045If the CRC calculation within the function Crc_Calculate- CRC8H2F is performed by hardware, then the CRC module's implementer...SWS_Crc_00048CRC_VENDOR_ID #define/ uint16 Vendor ID of the dedicated implementation of this module according to the AUTOSAR vendor list...SWS_Crc_00050The standardized common published parameters as required by SRS_BSW_00402 in the SRS General on Basic Software Modules [3]...SWS_Crc_00051These requirements are not applicable to this specification.SWS_Crc_00052The Crc_CalculateCRC8 function of the CRC module shall pro- vide the following CRC results, according to the following table:...SWS_Crc_00053The Crc_CalculateCRC8H2F function of the CRC module shall provide the following CRC results, according to the following table:...SWS_Crc_00054The Crc_CalculateCRC16 function of the CRC module shall provide the following CRC results, according to the following table:...SWS_Crc_00055The Crc_CalculateCRC32 function of the CRC module shall provide the following CRC results, according to the following table:...SWS_Crc_00056The CRC module shall implement the CRC32 routine using the 0xF4'AC'FB'13 polynomial, according to the following table: See...SWS_Crc_00057The Crc_CalculateCRC32P4 function of the CRC module shall provide the following CRC results, according to the following table:...SWS_Crc_00059The function Crc_CalculateCRC32P4 shall perform a CRC32 calculation using polynomial 0xF4ACFB13 on Crc_Length data bytes,...SWS_Crc_00060If the CRC calculation within the function Crc_Calculate- CRC32P4 is performed by hardware, then the CRC module's implementer...SWS_Crc_00062The CRC module shall implement the CRC64 routine using the 0x42'F0'E1'EB'A9'EA'36'93 polynomial, according to the following...SWS_Crc_00063The Crc_CalculateCRC64 function of the CRC module shall provide the following CRC results, according to the following table:...SWS_Crc_00064The function Crc_CalculateCRC64 shall perform a CRC64 calculation using polynomial 0x42F0E1EBA9EA3693 on Crc_Length data...SWS_Crc_00065If the CRC calculation within the function Crc_CalculateCRC64 is performed by hardware, then the CRC module's implementer...SWS_Crc_00067The CRC module shall implement the CRC16 based on the CRC- 16/ARC Standard, according to the following table: See Table 7.SWS_Crc_00068The Crc_CalculateCRC16ARC function of the CRC module shall provide the following CRC results, according to the following...SWS_Crc_00069The function Crc_CalculateCRC16ARC shall perform a CRC16 calculation using polynomial 0x8005 on Crc_Length data bytes, pointed...SWS_Crc_00070If the CRC calculation within the function Crc_Calculate- CRC16ARC is performed by hardware, then the CRC module's implementer...SWS_Crc_00072The CRC library functions shall not call any BSW modules func- tions (e.SWS_Crc_NA_00051These requirements are not applicable to this specifica- tion.
Funktionen — Detailansicht
함수 Crc_CalculateCRC16 [SWS_Crc_00019] 📄 PDF
uint16 Crc_CalculateCRC16(const uint8* Crc_DataPtr, uint32 Crc_Length, uint16 Crc_StartValue16, boolean Crc_IsFirstCall);
This service makes a CRC16 calculation on Crc_Length data bytes.
함수 Crc_CalculateCRC32 [SWS_Crc_00020] 📄 PDF
uint32 Crc_CalculateCRC32(const uint8* Crc_DataPtr, uint32 Crc_Length, uint32 Crc_StartValue32, boolean Crc_IsFirstCall);
This service makes a CRC32 calculation on Crc_Length data bytes.
함수 Crc_GetVersionInfo [SWS_Crc_00021] 📄 PDF
void Crc_GetVersionInfo(Std_VersionInfoType* Versioninfo);
This service returns the version information of this module.
함수 Crc_CalculateCRC8 [SWS_Crc_00031] 📄 PDF
uint8 Crc_CalculateCRC8(const uint8* Crc_DataPtr, uint32 Crc_Length, uint8 Crc_StartValue8, boolean Crc_IsFirstCall);
This service makes a CRC8 calculation on Crc_Length data bytes, with SAE J1850 parameters
함수 Crc_CalculateCRC8H2F [SWS_Crc_00043] 📄 PDF
uint8 Crc_CalculateCRC8H2F(const uint8* Crc_DataPtr, uint32 Crc_Length, uint8 Crc_StartValue8H2F, boolean Crc_IsFirstCall);
This service makes a CRC8 calculation with the Polynomial 0x2F on Crc_Length
함수 Crc_CalculateCRC32P4 [SWS_Crc_00058] 📄 PDF
uint32 Crc_CalculateCRC32P4(const uint8* Crc_DataPtr, uint32 Crc_Length, uint32 Crc_StartValue32, boolean Crc_IsFirstCall);
This service makes a CRC32 calculation on Crc_Length data bytes, using the polynomial 0x F4ACFB13. This CRC routine is used by E2E Profile 4.
함수 Crc_CalculateCRC64 [SWS_Crc_00061] 📄 PDF
uint64 Crc_CalculateCRC64(const uint8* Crc_DataPtr, uint32 Crc_Length, uint64 Crc_StartValue64, boolean Crc_IsFirstCall);
This service makes a CRC64 calculation on Crc_Length data bytes, using the polynomial 0x42F0E1EBA9EA3693. This CRC routine is used by E2E Profile 7.
함수 Crc_CalculateCRC16ARC [SWS_Crc_00071] 📄 PDF
uint16 Crc_CalculateCRC16ARC(const uint8* Crc_DataPtr, uint32 Crc_Length, uint16 Crc_StartValue16, boolean Crc_IsFirstCall);
This service makes a CRC16 calculation on Crc_Length data bytes, using the polynomial 0x8005.
requirement SWS_Crc_00002 [SWS_Crc_00002] 📄 PDF
The CRC module shall implement the CRC16 routine based on the CCITT-FALSE CRC16 Standard, according to the following table: See Table 7.5.
requirement SWS_Crc_00003 [SWS_Crc_00003] 📄 PDF
The CRC module shall implement the CRC32 routine based on the IEEE-802.3 CRC32 Ethernet Standard, according to the following table: See Table 7.9.
requirement SWS_Crc_00009 [SWS_Crc_00009] 📄 PDF
If the CRC calculation within the function Crc_CalculateCRC16 is performed by hardware, then the CRC module's implementer shall ensure reentrancy of this function by implementing a (software based) locking mechanism.
requirement SWS_Crc_00010 [SWS_Crc_00010] 📄 PDF
If the CRC calculation within the function Crc_CalculateCRC32 is performed by hardware, then the CRC module's implementer shall ensure reentrancy of this function by implementing a (software based) locking mechanism.
requirement SWS_Crc_00011 [SWS_Crc_00011] 📄 PDF
The function Crc_GetVersionInfo shall return the version in- formation of the CRC module. The version information includes: • Module Id • Vendor Id • Vendor specific version numbers (SRS_BSW_00407).
requirement SWS_Crc_00013 [SWS_Crc_00013] 📄 PDF
If CRC routines are to be used as a library, the CRC modules' implementer shall develop the CRC module in a way that only those parts of the CRC code that are used by other modules are linked into the final binary.
requirement SWS_Crc_00014 [SWS_Crc_00014] 📄 PDF
The CRC function (with parameter Crc_IsFirstCall = TRUE) shall do the following operations: 1. As 'Initial value' of the CRC computation, uses the attribute 'Initial value' of the polynomial: Crc = P olynomialInitV al 2. If the attribute 'Input data reflected' of the polynomial is TRUE, then reflects input data (byte per byte) obtained via parameters Crc_DataPtr and Crc_Length : Data = re ect 8 ( Data ) (in the case 'Input data reflected' is TRUE) 3. Compute the CRC over the data, the last CRC and the CRC polynomial: Crc = f ( Data; Crc; P olynomial ) 4. Execute the XOR operation between crc and 'XOR value' of the polynomial: Crc = Crc P olynomialXORV al 5. If the attribute 'Result data reflected' of the polynomial is TRUE, then reflect the CRC (over 8, 16 or 32 bits, depending on the CRC size): Crc = ref lect Crcsize ( Crc ) (in the case 'Result data reflected' is TRUE) 6. The CRC is returned: return Crc Steps 2 and 3 are performed as long as data are available
requirement SWS_Crc_00015 [SWS_Crc_00015] 📄 PDF
The function Crc_CalculateCRC16 shall perform a CRC16 cal- culation using polynomial 0x1021 on Crc_Length data bytes, pointed to by Crc_- DataPtr , with the starting value of Crc_StartValue16 .
requirement SWS_Crc_00016 [SWS_Crc_00016] 📄 PDF
The function Crc_CalculateCRC32 shall perform a CRC32 cal- culation using polynomial 0x04C11DB7 on Crc_Length data bytes, pointed to by Crc_DataPtr , with the starting value of Crc_StartValue32 .
requirement SWS_Crc_00017 [SWS_Crc_00017] 📄 PDF
If source code for caller and callee of the function Crc_GetVer- sionInfo is available, the CRC module should realize this function as a macro, de- fined in the modules header file.
requirement SWS_Crc_00018 [SWS_Crc_00018] 📄 PDF
Module Header File Imported Type Std Std_Types.h Std_VersionInfoType
requirement SWS_Crc_00030 [SWS_Crc_00030] 📄 PDF
The Crc_CalculateCRC8 function of the CRC module shall im- plement the CRC8 routine based on the SAE-J1850 CRC8 Standard, according to the following table: See Table 7.1.
requirement SWS_Crc_00032 [SWS_Crc_00032] 📄 PDF
The function Crc_CalculateCRC8 shall perform a CRC8 cal- culation using polynomial 0x1D on Crc_Length data bytes, pointed to by Crc_Dat- aPtr , with the starting value of Crc_StartValue8 .
requirement SWS_Crc_00033 [SWS_Crc_00033] 📄 PDF
If the CRC calculation within the function Crc_CalculateCRC8 is performed by hardware, then the CRC module's implementer shall ensure reentrancy of this function by implementing a (software based) locking mechanism.
requirement SWS_Crc_00041 [SWS_Crc_00041] 📄 PDF
The CRC function (with parameter Crc_IsFirstCall = FALSE) shall do the following operations: 1. As 'Initial value' of the CRC computation, uses the parameter Crc_StartValueX (where X is 8, 8H2F, 16, 32, P4 or 64) that should be the CRC result of the last call. The result is then XORed with 'XOR value' and reflected if 'Result data reflected' of the polynomial is TRUE: Crc = Crc _ StartV alueX P olynomialXORV al Crc = re ect Crcsize ( Crc ) (in the case 'Result data reflected' is TRUE) Steps 2 to 6 are identical to [SWS_Crc_00014].
requirement SWS_Crc_00042 [SWS_Crc_00042] 📄 PDF
The Crc_CalculateCRC8H2F function of the CRC module shall implement the CRC8 routine based on the generator polynomial 0x2F, according to the following table: See Table 7.3.
requirement SWS_Crc_00044 [SWS_Crc_00044] 📄 PDF
The function Crc_CalculateCRC8H2F shall perform a CRC8 calculation with the polynomial 0x2F on Crc_Length data bytes, pointed to by Crc_- DataPtr , with the starting value of Crc_StartValue8H2F .
requirement SWS_Crc_00045 [SWS_Crc_00045] 📄 PDF
If the CRC calculation within the function Crc_Calculate- CRC8H2F is performed by hardware, then the CRC module's implementer shall ensure reentrancy of this function by implementing a (software based) locking mechanism.
requirement SWS_Crc_00048 [SWS_Crc_00048] 📄 PDF
CRC_VENDOR_ID #define/ uint16 Vendor ID of the dedicated implementation of this module according to the AUTOSAR vendor list CRC_MODULE_ID #define/ uint16 Module ID of this module from Module List CRC_AR_RELEASE_MAJOR_VERSION #define/ uint8 Major version number of AUTOSAR release on which the appropriate implementation is based on. CRC_AR_RELEASE_MINOR_VERSION #define/ uint8 Minor version number of AUTOSAR release on which the appropriate implementation is based on. CRC_AR_RELEASE_REVISION_VERSION #define/ uint8 Patch level version number of AUTOSAR release on which the appropriate implementation is based on. CRC_SW_MAJOR_VERSION #define/ uint8 Major version number of the vendor specific implementation of the module. The numbering is vendor specific. CRC_SW_MINOR_VERSION #define/ uint8 Minor version number of the vendor specific implementation of the module. The numbering is vendor specific. CRC_SW_PATCH_VERSION #define/ uint8 Patch level version number of the vendor specific implementation of the module. The numbering is vendor specific.
requirement SWS_Crc_00050 [SWS_Crc_00050] 📄 PDF
The standardized common published parameters as required by SRS_BSW_00402 in the SRS General on Basic Software Modules [3] shall be pub- lished within the header file of this module and need to be provided in the BSW Mod- uleDescription. The according module abbreviation can be found in the List of Basic Software Modules [10].
requirement SWS_Crc_00051 [SWS_Crc_00051] 📄 PDF
These requirements are not applicable to this specification.
requirement SWS_Crc_00052 [SWS_Crc_00052] 📄 PDF
The Crc_CalculateCRC8 function of the CRC module shall pro- vide the following CRC results, according to the following table: See Table 7.2.
requirement SWS_Crc_00053 [SWS_Crc_00053] 📄 PDF
The Crc_CalculateCRC8H2F function of the CRC module shall provide the following CRC results, according to the following table: See Table 7.4.
requirement SWS_Crc_00054 [SWS_Crc_00054] 📄 PDF
The Crc_CalculateCRC16 function of the CRC module shall provide the following CRC results, according to the following table: See Table 7.6.
requirement SWS_Crc_00055 [SWS_Crc_00055] 📄 PDF
The Crc_CalculateCRC32 function of the CRC module shall provide the following CRC results, according to the following table: See Table 7.10.
requirement SWS_Crc_00056 [SWS_Crc_00056] 📄 PDF
The CRC module shall implement the CRC32 routine using the 0xF4'AC'FB'13 polynomial, according to the following table: See Table 7.11.
requirement SWS_Crc_00057 [SWS_Crc_00057] 📄 PDF
The Crc_CalculateCRC32P4 function of the CRC module shall provide the following CRC results, according to the following table: See Table 7.12.
requirement SWS_Crc_00059 [SWS_Crc_00059] 📄 PDF
The function Crc_CalculateCRC32P4 shall perform a CRC32 calculation using polynomial 0xF4ACFB13 on Crc_Length data bytes, pointed to by Crc_DataPtr , with the starting value of Crc_StartValue32 .
requirement SWS_Crc_00060 [SWS_Crc_00060] 📄 PDF
If the CRC calculation within the function Crc_Calculate- CRC32P4 is performed by hardware, then the CRC module's implementer shall ensure reentrancy of this function by implementing a (software based) locking mechanism.
requirement SWS_Crc_00062 [SWS_Crc_00062] 📄 PDF
The CRC module shall implement the CRC64 routine using the 0x42'F0'E1'EB'A9'EA'36'93 polynomial, according to the following table: See Table 7.13.
requirement SWS_Crc_00063 [SWS_Crc_00063] 📄 PDF
The Crc_CalculateCRC64 function of the CRC module shall provide the following CRC results, according to the following table: See Table 7.14.
requirement SWS_Crc_00064 [SWS_Crc_00064] 📄 PDF
The function Crc_CalculateCRC64 shall perform a CRC64 calculation using polynomial 0x42F0E1EBA9EA3693 on Crc_Length data bytes, pointed to by Crc_DataPtr , with the starting value of Crc_StartValue64 .
requirement SWS_Crc_00065 [SWS_Crc_00065] 📄 PDF
If the CRC calculation within the function Crc_CalculateCRC64 is performed by hardware, then the CRC module's implementer shall ensure reentrancy of this function by implementing a (software based) locking mechanism.
requirement SWS_Crc_00067 [SWS_Crc_00067] 📄 PDF
The CRC module shall implement the CRC16 based on the CRC- 16/ARC Standard, according to the following table: See Table 7.7.
requirement SWS_Crc_00068 [SWS_Crc_00068] 📄 PDF
The Crc_CalculateCRC16ARC function of the CRC module shall provide the following CRC results, according to the following table: See Table 7.8.
requirement SWS_Crc_00069 [SWS_Crc_00069] 📄 PDF
The function Crc_CalculateCRC16ARC shall perform a CRC16 calculation using polynomial 0x8005 on Crc_Length data bytes, pointed to by Crc_- DataPtr , with the starting value of Crc_StartValue16 .
requirement SWS_Crc_00070 [SWS_Crc_00070] 📄 PDF
If the CRC calculation within the function Crc_Calculate- CRC16ARC is performed by hardware, then the CRC module's implementer shall en- sure reentrancy of this function by implementing a (software based) locking mecha- nism.
requirement SWS_Crc_00072 [SWS_Crc_00072] 📄 PDF
The CRC library functions shall not call any BSW modules func- tions (e.g. the DET).
requirement SWS_Crc_NA_00051 [SWS_Crc_NA_00051] 📄 PDF
These requirements are not applicable to this specifica- tion.
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/CP_MOD_Crc- Status
- unspecified
- Version
AUTOSAR/AP/record/CP_MOD_Crc@rel:R20-11#2bb8759f- Content hash
2bb8759f- Source
- https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_CRCLibrary.pdf#nameddest=SWS_Crc_00019