AUTOSAR Classic General & Standard Types
Die Standard- und Plattformtypen definieren die grundlegenden C-Typen, Rückgabewerte und Kommunikationsdatenstrukturen der AUTOSAR Classic Architektur. Sie stellen hardwareunabhängige Portabilität für Basissoftware und Applikations-SW-Cs sicher.
Cluster guideAI-GENERATED
Provides hardware-independent basic types, status return values, and communication buffer structures for all BSW modules.
Provides hardware-independent basic types, status return values, and communication buffer structures for all BSW modules.
Via the headers Platform_Types.h, Std_Types.h, and ComStack_Types.h, the General & Standard Types module cluster provides the hardware-independent basis for all data types, status reports, and communication buffers of the Classic Platform (AUTOSAR_SRS_BSWGeneral p. 62). It standardizes fundamental architectural features such as endianness models, standardized return values like Std_ReturnType, and communication structures like PduInfoType ([SWS_Std_00005], [SWS_COMTYPE_00008]). Since these are pure header definitions without executable code, the cluster requires no runtime configuration, nor does it have its own tasks or active error handling (SWS_StandardTypes p. 27).
The General & Standard Types module cluster comprises the three basic headers platform (Platform_Types.h), std (Std_Types.h), and comstack (ComStack_Types.h). As pure type definitions, they contain no executable code whatsoever and require no configuration (SWS_StandardTypes p. 27). They form the platform-wide foundation for hardware-independent typing, standardize compiler and hardware specifics, and provide all BSW modules and the RTE with consistent data structures (AUTOSAR_SRS_BSWGeneral p. 62).
Architecture diagram: Static layering and inclusion architecture of the 'General & Standard Types' module cluster with exported type interfaces. Sources: AUTOSAR_SRS_BSWGeneral p. 62, [SWS_Std_00005], [SWS_COMTYPE_00005]
The inclusion hierarchy builds up stepwise: Platform_Types.h encapsulates platform-specific properties such as the C99 type boolean ([SWS_Platform_00027]), universal buffer pointers such as ConstVoidPtr ([SWS_Platform_91002]), and symbols for register bit order CPU_BIT_ORDER ([SWS_Platform_00038]) and memory byte order CPU_BYTE_ORDER ([SWS_Platform_00039]). Building on this, Std_Types.h provides universal standard constants such as STD_ON/STD_OFF ([SWS_Std_00010]), module version structures via Std_VersionInfoType ([SWS_Std_00015]), and the fundamental status system Std_ReturnType with E_OK and E_NOT_OK ([SWS_Std_00005], [SWS_Std_00006]).
For the AUTOSAR communication stack, ComStack_Types.h defines all cross-protocol interface types such as PduIdType ([SWS_COMTYPE_00005]), NetworkHandleType ([SWS_COMTYPE_00038]), and the central buffer structure PduInfoType ([SWS_COMTYPE_00008]). In segmented transport protocols (e.g. CanTp or DoIP), the return type BufReq_ReturnType, together with RetryInfoType, controls synchronous buffer reservation and data copying between BSW layers (SWS_DiagnosticCommunicationManager p. 291, [SWS_COMTYPE_00012]).
Sequence diagram: Segmented reception and buffer path of a transport protocol using ComStack_Types (PduInfoType, BufReq_ReturnType). Sources: SWS_PDURouter p. 112, SWS_DiagnosticCommunicationManager p. 273, SWS_DiagnosticCommunicationManager p. 274
Although the cluster has no error handling of its own or DET reporting (SWS_StandardTypes p. 27), Std_ReturnType structures the error handling of the overall system: bits 0 to 5 (0x00 to 0x3F) are reserved for standard and application errors, while bits 6 and 7 are occupied exclusively by the RTE ([SWS_Std_00011], AUTOSAR_CP_SWS_StandardTypes p. 15). All type definitions are specified for reentrant use in multitasking and interrupt contexts (SWS_CANInterface p. 87).
System Architecture & Role of the Module Cluster
The General & Standard Types module cluster forms the fundamental typological and hardware-abstracting foundation of the AUTOSAR Classic Platform in release R20-11. It is composed of the three header-only modules platform ([SWS_Platform_00038]), std ([SWS_Std_00005]), and comstack ([SWS_COMTYPE_00005]). According to the BSW architecture, these modules neither provide their own executable C code nor request other BSW drivers (SWS_StandardTypes p. 27). Their central task is to encapsulate compiler and processor dependencies, provide platform-wide uniform basic types, and establish standardized data structures for the communication layers.
The layer hierarchy follows a strict, unidirectional inclusion order: the file Platform_Types.h abstracts the properties of the underlying microcontroller architecture (such as register and memory layout and C99 elementary types), while Std_Types.h builds on it and defines universal return values and status constants (AUTOSAR_SRS_BSWGeneral p. 62). Building upon that, ComStack_Types.h declares all bus- and cross-protocol data types for networks such as CAN, FlexRay, LIN, and Ethernet, as well as for transport protocols according to ISO 15765-2 and diagnostic protocols according to ISO 14229 ([SWS_COMTYPE_00008], [SWS_COMTYPE_00011]). This decoupling ensures that higher layers such as the runtime environment (RTE) and application Software Components (SWCs) remain fully portable (SWS_RTE p. 818).
Architecture diagram: Static layering and inclusion architecture of the 'General & Standard Types' module cluster with exported type interfaces. Sources: AUTOSAR_SRS_BSWGeneral p. 62, [SWS_Std_00005], [SWS_COMTYPE_00005]
Interplay & Interaction Paths Between the Modules
Interaction within the cluster is based on a static inclusion chain: ComStack_Types.h includes Std_Types.h, which in turn includes Platform_Types.h (RS_BSWGeneral p. 60). The module platform defines fundamental quantities such as boolean, which must strictly be mapped to the C99 basic type _Bool ([SWS_Platform_00027]), and governs its strict value assignment via the literals TRUE and FALSE ([SWS_Platform_00034]). Furthermore, generic buffer pointers such as ConstVoidPtr are specified, which are used for immutable transfer buffers passed to called function interfaces ([SWS_Platform_91002]).
In addition, platform harmonizes hardware endians via standardized preprocessor symbols: for the bit order in registers, CPU_BIT_ORDER is defined as MSB_FIRST or LSB_FIRST ([SWS_Platform_00038], [SWS_Platform_00048], [SWS_Platform_00049]). The byte order in physical memory is controlled via CPU_BYTE_ORDER, distinguishing HIGH_BYTE_FIRST (big-endian, MSB at lower address) from LOW_BYTE_FIRST (little-endian, LSB at lower address) ([SWS_Platform_00039], [SWS_Platform_00050], [SWS_Platform_00051]).
Structure diagram: Memory layout of scalar multi-byte values in big-endian (HIGH_BYTE_FIRST) vs. little-endian (LOW_BYTE_FIRST). Sources: AUTOSAR_CP_SWS_PlatformTypes p. 16, AUTOSAR_CP_SWS_PlatformTypes p. 15, [SWS_Platform_00050], [SWS_Platform_00051]
At the next abstraction level, the module std defines universal symbols for switching states and logical levels: STD_HIGH (0x01u) and STD_LOW (0x00u) for physical voltage levels ([SWS_Std_00007]), STD_ON (0x01u) and STD_OFF (0x00u) for activation modes ([SWS_Std_00010]), and STD_ACTIVE (0x01u) and STD_IDLE (0x00u) for logical execution states ([SWS_Std_00013]). For message protocols and transformers, std additionally provides Std_MessageTypeType with the literals STD_MESSAGETYPE_REQUEST (0x00) and STD_MESSAGETYPE_RESPONSE (0x01) ([SWS_Std_91001], [SWS_Std_00017]), as well as the function pointer type Std_ExtractProtocolHeaderFieldsType for extracting protocol headers ([SWS_Std_91003]).
The module comstack in turn uses the basic types of platform and std to structure the entire buffer and data exchange in the communication stack. The central interface structure is PduInfoType, which bundles the data pointer SduDataPtr (uint8*), the metadata pointer MetaDataPtr, and the buffer length SduLength of type PduLengthType ([SWS_COMTYPE_00008], [SWS_COMTYPE_00011]). The I-PDU identification is carried out via PduIdType ([SWS_COMTYPE_00005]). For managing entire communication channels and partial networks, comstack defines the channel identifier NetworkHandleType ([SWS_COMTYPE_00038]) and the partial network identifier PNCHandleType ([SWS_COMTYPE_00036]), which are used, for instance, in the Synchronized PNC Shutdown of ComM and Nm (SWS_COMManager p. 171).
In segmented transport protocol (TP) transmissions, buffer negotiation is handled via the return types BufReq_ReturnType and the structure RetryInfoType ([SWS_COMTYPE_00012]). During synchronous copy calls such as CopyTxData or CopyRxData between modules such as CanTp, PduR, DCM, DoIP, or SecOC, BUFREQ_OK signals a successful copy operation, while BUFREQ_E_BUSY communicates that insufficient buffer is temporarily available and that a retry is permitted (SWS_DiagnosticCommunicationManager p. 291, SWS_SecureOnboardCommunication p. 76). Via RetryInfoType with parameters such as TP_CONFPENDING or TP_DATACONF, it is ensured that data remains in the buffer for possible retransmissions or is released after confirmation (SWS_IntrusionDetectionSystemManager p. 49).
Sequence diagram: Segmented reception and buffer path of a transport protocol using ComStack_Types (PduInfoType, BufReq_ReturnType). Sources: SWS_PDURouter p. 112, SWS_DiagnosticCommunicationManager p. 273, SWS_DiagnosticCommunicationManager p. 274
Synchronization, reentrancy and task contexts
Since the modules platform, std, and comstack are header-only files without executable object files, they naturally do not implement any cyclic MainFunctions and do not possess their own task contexts (SWS_StandardTypes p. 27). However, they define the signatures and type conventions for functions called across layer boundaries. All type definitions are designed so that they can be passed in a fully reentrant and stateless manner (SWS_CANInterface p. 87).
The practical use of the types occurs in highly asynchronous and concurrent environments. Data reception callbacks such as CanIf_RxIndication or Dcm_CopyRxData that use PduInfoType and PduIdType are explicitly allowed to be executed in interrupt context (SWS_CANInterface p. 164, SWS_DiagnosticCommunicationManager p. 274). In contrast, routing decisions, buffer allocations, or cyclic transmissions are processed in periodic tasks of the upper layers (e.g. SoAd_MainFunction) (SWS_SocketAdaptor p. 104). Since pointer structures such as PduInfoType can be shared between interrupt level and task level, thread-safe synchronization by means of exclusive areas (protection against concurrency) is the responsibility of the calling and implementing BSW modules.
Typical lifecycles and operating modes
Pure type definitions are not subject to a runtime lifecycle and possess neither initialization nor shutdown functions (SWS_StandardTypes p. 27). They must be statically included at compile time before all processing modules. However, they form the normative framework for mapping and monitoring the lifecycle of other BSW modules: for standardized version queries, std specifies the structure Std_VersionInfoType, which contains vendorID, moduleID, and the software version states (sw_major_version, sw_minor_version, sw_patch_version) ([SWS_Std_00015]).
In addition, types such as NetworkHandleType and PNCHandleType support higher-level network and mode management during operating mode transitions such as startup, normal operation, sleep, and wakeup ([SWS_COMTYPE_00036], [SWS_COMTYPE_00038]). ComM, for instance, uses these identifiers to control coordinated shutdowns and state transitions within the partial network cluster (SWS_COMManager p. 171, SWS_NetworkManagementInterface p. 106).
Error Handling, DET Tracing, and Status Encoding
The module cluster provides no active error handling of its own and reports neither development errors to the DET nor production errors to the DEM (SWS_StandardTypes p. 27). Instead, it standardizes the platform-wide feedback format: the fundamental type Std_ReturnType is based on uint8 and serves across all layers as the standard result of synchronous calls ([SWS_Std_00005], BSWUMLModelModelingGuide p. 28). By default, E_OK (0x00u) represents successful execution and E_NOT_OK (0x01u) a generic error ([SWS_Std_00006]). For reasons of compatibility with ISO 17356-3 (OSEK OS), E_OK is protected against multiple definitions via a guard check (STATUSTYPEDEFINED) (AUTOSAR_SRS_BSWGeneral p. 62).
The bit layout of Std_ReturnType follows a fixed partitioning: bits 0 to 5 (range 0x00 to 0x3F) are reserved for standardized and module-specific return values or application-specific ApplicationError codes in client/server operations ([SWS_Std_00011], AUTOSAR_CP_SWS_StandardTypes p. 15). Module-specific extensions are maintained in UML models as a class with the stereotype «extra_literals» (BSWUMLModelModelingGuide p. 33). Bits 6 and 7 (value range 0x40, 0x80, 0xC0) are strictly reserved for infrastructure error states of the RTE (AUTOSAR_CP_SWS_StandardTypes p. 15). For data transformations in the RTE, std additionally declares the structure Std_TransformerError, consisting of errorCode ([SWS_Std_00022]) and transformerClass ([SWS_Std_00021]), enabling seamless tracking of error chains during serialization or E2E protection.
This guide is based on the normative specifications of AUTOSAR Classic Platform Release R20-11 for StandardTypes, PlatformTypes, and CommunicationStackTypes.
Types
booleanBufReq_ReturnTypeConstVoidPtrCPU_BIT_ORDERCPU_BYTE_ORDERCPU_TYPEE_OK / E_NOT_OKfloat32float64NetworkHandleTypePduIdTypePduInfoTypePduLengthTypePNCHandleTypeRetryInfoTypesint16sint16_leastsint32sint32_leastsint64sint8sint8_leastSTD_ACTIVE / STD_IDLEStd_ExtractProtocolHeaderFieldsTypeSTD_HIGH / STD_LOWStd_MessageResultTypeStd_MessageTypeSTD_ON / STD_OFFStd_ReturnTypeStd_TransformerClassStd_TransformerErrorStd_TransformerForwardStd_TransformerForwardCodeStd_VersionInfoTypeTpDataStateTypeTPParameterTypeTRUE_FALSEuint16uint16_leastuint32uint32_leastuint64uint8uint8_leastVoidPtrTypes
booleanBufReq_ReturnTypeConstVoidPtrCPU_BIT_ORDERCPU_BYTE_ORDERCPU_TYPEE_OK / E_NOT_OKfloat32float64NetworkHandleTypePduIdTypePduInfoTypePduLengthTypePNCHandleTypeRetryInfoTypesint16sint16_leastsint32sint32_leastsint64sint8sint8_leastSTD_ACTIVE / STD_IDLEStd_ExtractProtocolHeaderFieldsTypeSTD_HIGH / STD_LOWStd_MessageResultTypeStd_MessageTypeSTD_ON / STD_OFFStd_ReturnTypeStd_TransformerClassStd_TransformerErrorStd_TransformerForwardStd_TransformerForwardCodeStd_VersionInfoTypeTpDataStateTypeTPParameterTypeTRUE_FALSEuint16uint16_leastuint32uint32_leastuint64uint8uint8_leastVoidPtrNo element data available for this release
ComStack
Variables of this type shall be used to store the result of a buffer request.
typedef enum { BUFREQ_OK, BUFREQ_E_NOT_OK, BUFREQ_E_BUSY, BUFREQ_E_OVFL } BufReq_ReturnType;Variables of the type Network Handle Type shall be used to store the identifier of a communication channel.
typedef uint8 NetworkHandleType;Variables of this type shall be used to store the basic information about a PDU of any type, namely a pointer variable pointing to its SDU (payload), a pointer to Meta Data of the PDU, and the corresponding length of the SDU in byt es.
typedef struct { uint8* SduDataPtr; uint8* MetaDataPtr; PduLengthType SduLength; } PduInfoType;This type shall be used within the entire AUTOSAR Com Stack of an ECU except for bus drivers.
typedef uint16 PduLengthType;Used to store the identifier of a partial network cluster.
typedef uint8 PNCHandleType;Variables of this type shall be used to store the information about Tp buffer handling.
typedef struct { TpDataStateType TpDataState; PduLengthType TxTpDataCnt; } RetryInfoType;Variables of this type shall be used to store the state of TP buffer.
typedef enum { TP_DATACONF, TP_DATARETRY, TP_CONFPENDING } TpDataStateType;Specify the parameter to which the value has to be changed (BS or STmin).
typedef enum { TP_STMIN, TP_BS, TP_BC } TPParameterType;Platform
This standard AUTOSAR type shall only be used together with the definitions TRUE and FALSE.
typedef unsigned char boolean;This standard AUTOSAR type shall be a void pointer to const. Note: This type shall be used for buffers that are passed to the callee.
typedef const void* ConstVoidPtr;This symbol shall be defined as #define having one of the values MSB_FIRST or LSB_FIRST according to the platform.
This symbol shall be defined as #define having one of the values HIGH_BYTE_FIRST or LOW_ BYTE_FIRST according to the platform.
This symbol shall be defined as #define having one of the values CPU_TYPE_8, CPU_TYPE_16, CPU_TYPE_32 or CPU_TYPE_64 according to the platform.
This standard AUTOSAR type shall follow the 32-bit binary interchange format according to IEEE 754-2008 with encoding parameters specified in chapter 3.6, table 3.5, column "binary32".
typedef float float32;This standard AUTOSAR type shall follow the 64-bit binary interchange format according to IEEE 754-2008 with encoding parameters specified in chapter 3.6, table 3.5, column "binary64".
typedef double float64;This optimized AUTOSAR type shall be at least 16 bit signed.
typedef signed int sint16_least;This optimized AUTOSAR type shall be at least 32 bit signed.
typedef signed int sint32_least;This optimized AUTOSAR type shall be at least 8 bit signed.
typedef signed int sint8_least;The symbols TRUE and FALSE shall be defined as follows: #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif
This optimized AUTOSAR type shall be at least 16 bit unsigned.
typedef unsigned int uint16_least;This optimized AUTOSAR type shall be at least 32 bit unsigned.
typedef unsigned int uint32_least;This optimized AUTOSAR type shall be at least 8 bit unsigned.
typedef unsigned int uint8_least;Std
Because E_ OK is already defined within OSEK, the symbol E_ OK has to be shared. To avoid name clashes and redefinition problems, the symbols have to be defined in the following way (approved within implementation): #ifndef STATUSTYPEDEFINED #define STATUSTYPEDEFINED #define E_ OK 0x00u typedef unsigned char Status Type; /* OSEK compliance */ #endif #define E_ NOT_ OK 0x01u
#define E_OK 0x00u #define E_NOT_OK 0x01uThe symbols STD_ ACTIVE and STD_ IDLE shall be defined as follows: #define STD_ ACTIVE 0x01u /* Logical state active */ #define STD_ IDLE 0x00u /* Logical state idle */
#define STD_ACTIVE 0x01u #define STD_IDLE 0x00uType for the function pointer to extract the relevant protocol header fields of the message and the type of the message result of a transformer. - At the time being, this is limited to the types used for C/ S communication (i.e., REQUE ST and RESPONSE and OK and ERROR).
typedef Std_ReturnType (* Std_ExtractProtocolHeaderFieldsType)(const uint8* buffer, uint32 bufferLength, Std_MessageTypeType* messageType, Std_MessageResultType* messageResult);The symbols STD_ HIGH and STD_ LOW shall be defined as follows: #define STD_ HIGH 0x01u /* Physical state 5V or 3.3V */ #define STD_ LOW 0x00u /* Physical state 0V */
#define STD_HIGH 0x01u #define STD_LOW 0x00uThis type is used to encode different types of results for response messages. - Currently this encoding is limited to the distinction between OK and ERROR responses.
typedef uint8 Std_MessageResultType;This type is used to encode the different type of messages. - Currently this encoding is limited to the distinction between requests and responses in C/ S c ommunication.
The symbols STD_ ON and STD_ OFF shall be defined as follows: #define STD_ ON 0x01u #define STD_ OFF 0x00u
#define STD_ON 0x01u #define STD_OFF 0x00uThis type can be used as standard API return type which is shared between the RTE and the BSW modules. It shall be defined as follows: typedef uint8 Std_ Return Type;
typedef uint8 Std_ReturnType;-
typedef uint8 Std_TransformerClass;-
typedef uint8 Std_TransformerError;- Tags: atp.Status=draft
typedef uint8 Std_TransformerForward;- Tags: atp.Status=draft
typedef uint8 Std_TransformerForwardCode;Module im Cluster
Compiler Abstraction (Compiler)
AUTOSAR Classic Special Files-Modul Compiler Abstraction (Compiler, Spezifikation: AUTOSAR_SWS_CompilerAbstraction.pdf).
Communication Stack Types (ComStack_Types)
Standardized types, PDU identifiers, lengths, and buffer request types (PduIdType, PduLengthType, PduInfoType, BufReq_ReturnType) used across all communication layers.
Memory Mapping (MemMap)
AUTOSAR Classic Special Files-Modul Memory Mapping (MemMap, Spezifikation: AUTOSAR_CP_SWS_MemoryMapping.pdf, AUTOSAR_SWS_MemoryMapping.pdf).
Platform Types (Platform_Types)
Platform-specific fundamental data types (integers, booleans, floating-point numbers) mapped to CPU architecture primitives.
Standard Types (Std_Types)
Standard types, return codes (Std_ReturnType, E_OK, E_NOT_OK), version info structures, and error codes shared across the entire AUTOSAR architecture.
gemini-3.8-flash-low· 2026-10-13 · German original