DEENESPTFRRUARHIKOZHNL

Platform Types (Platform_Types)

ModulPlatform (Platform Types)
BSW-Modul-ID199
Standard-Header#include "Platform_Types.h"
SWS-SpezifikationAUTOSAR_SWS_PlatformTypes.pdf
ClusterGeneral & Standard Types

Module guideAI-GENERATED

Provides uniformly named base types and identifier symbols for register width and endianness of the target processor.
AI-GENERATED unreviewed Model: claude-opus-5-5 · Effort: high · Temperature: not controllable · Prompt: 7e73f6d7bb31 Provenance Open questions (3)
Causal anchor: R20-11 Valid from R20-11 Synthesized for this specification release.
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Provides uniformly named base types and identifier symbols for register width and endianness of the target processor.

Platform_Types.h provides the platform-dependent base types of the Classic Platform: fixed-width integer types from uint8 to sint64, optimized *_least types, float32/float64, boolean with TRUE/FALSE, and the buffer pointers VoidPtr and ConstVoidPtr. In addition, CPU_TYPE, CPU_BIT_ORDER, and CPU_BYTE_ORDER designate register width and endianness of the target [SWS_Platform_00046]. boolean may only be used with TRUE and FALSE and without arithmetic or bitwise operators [SWS_Platform_00034]. The header must not be extended, otherwise AUTOSAR conformance is lost.

Platform_Types.h is the platform-dependent type base of the Classic Platform. The header encapsulates word widths and endianness of the target behind uniform names and must not be extended, as any extension invalidates AUTOSAR conformance [SWS_Platform_00002]. In the model view, the types are located under a fixed path such as /AUTOSAR_Platform/ImplementationDatatypes/uint8 TPS StandardizationTemplate p. 77.

The header provides the following type groups:

typwahl start Datum festlegen zeiger Pointer to buffer? start->zeiger richtung Pass buffer to callee? zeiger->richtung yes wahr Wahrheitswert? zeiger->wahr no cvp ConstVoidPtr (const void*) richtung->cvp yes vp VoidPtr (void*) Daten an Aufrufer richtung->vp no bool boolean only with TRUE/FALSE wahr->bool yes gleit Gleitkommazahl? wahr->gleit no flt float32 / float64 (IEEE 754-2008) gleit->flt yes least Minimum width sufficient (e.g., loop counter, switch argument)? gleit->least no opt uint8_least … sint32_least least->opt yes fest uint8 … uint64 / sint8 … sint64 least->fest no

Activity diagram: The selection of the suitable platform type follows the questions buffer pointer, boolean value, floating-point number, minimum width, or exact width. Sources: [SWS_Platform_91001], [SWS_Platform_00026], SWS PlatformTypes p. 17

boolean is implemented in R20-11 as the shortest natively supported unsigned integer type, typically 8 bits [SWS_Platform_00027]. Later versions deviate from this and use _Bool SWS PlatformTypes p. 18. The type must be capable of being pointed to [SWS_Platform_00060] and may only be used with TRUE and FALSE. Arithmetic and bitwise operators are prohibited [SWS_Platform_00034], and redefinitions of the symbols must be avoided via conditional checks [SWS_Platform_00054].

In addition, three symbols must be defined per platform: CPU_TYPE for the register width [SWS_Platform_00045], CPU_BIT_ORDER with MSB_FIRST or LSB_FIRST [SWS_Platform_00048] [SWS_Platform_00049], and CPU_BYTE_ORDER with HIGH_BYTE_FIRST or LOW_BYTE_FIRST [SWS_Platform_00050] [SWS_Platform_00051]. Bit names and significance must not be confused here, because the MSB is always on the left in the accumulator SWS PlatformTypes p. 15. Interpretation: The module has no runtime errors; incorrect configurations only become apparent during integration or conformance testing. Question (open)

cpu_symbole start Zielplattform portieren breite Register width of the CPU? start->breite t8 CPU_TYPE_8 breite->t8 8 Bit t16 CPU_TYPE_16 breite->t16 16 Bit t32 CPU_TYPE_32 breite->t32 32 Bit t64 CPU_TYPE_64 breite->t64 64 Bit bit Bitreihenfolge (Register)? t8->bit t16->bit t32->bit t64->bit msb CPU_BIT_ORDER = MSB_FIRST bit->msb Big Endian lsb CPU_BIT_ORDER = LSB_FIRST bit->lsb Little Endian byte Bytereihenfolge (Speicher)? msb->byte lsb->byte high CPU_BYTE_ORDER = HIGH_BYTE_FIRST byte->high Big Endian low CPU_BYTE_ORDER = LOW_BYTE_FIRST byte->low Little Endian ende Symbole als #define in Platform_Types.h high->ende low->ende

Activity diagram: Register width, bit order, and byte order of the target are each mapped to exactly one symbol value. Sources: [SWS_Platform_00045], [SWS_Platform_00048], [SWS_Platform_00050]

Role of Platform_Types.h: The Platform-Dependent Type Base

The module is not an executable building block, but a header. All specified types and symbols are "Available via Platform_Types.h", such as uint8 [SWS_Platform_00013] or CPU_TYPE [SWS_Platform_00064]. The header conceals the properties of the target microcontroller and compiler behind uniform names: word widths, bit order, and byte order. It is therefore part of the microcontroller abstraction with a standardized interface to higher layers required in SRS_BSW_00161 SRS BSWGeneral p. 88. The rules on byte order refer to precisely this upstream requirement SWS PlatformTypes p. 16.

The system boundary is drawn narrowly. The header must not be extended, as any extension voids AUTOSAR conformance [SWS_Platform_00002]. In contrast, return types for the success or failure of an API call are located in Std_Types.h SRS BSWGeneral p. 68. In the model view, the platform types are stored as blueprints, for example under /AUTOSAR/Platform/ImplementationDatatypes_Blueprint/uint8. They are implemented under /AUTOSAR_Platform/ImplementationDatatypes/uint8, so that component suppliers can access them via a predictable path TPS StandardizationTemplate p. 77.

einbettung ziel Target µC / compiler (register width, bit and byte order) pt Platform_Types.h (Basistypen, boolean, TRUE/FALSE, VoidPtr, ConstVoidPtr, CPU_*) ziel->pt bestimmt Belegung modell Modellsicht /AUTOSAR_Platform/ImplementationDatatypes pt->modell entspricht Blueprint-Pfad bfx Bfx (boolean, uint8 … uint64) pt->bfx Typen crc Crc (uint8, uint32, boolean) pt->crc Typen bmc Bmc (Bmc_AtomicFlagType from boolean) pt->bmc Basistyp keym KeyM / Csm (ConstVoidPtr, VoidPtr, uint32) pt->keym Pufferzeiger cansm CanSM (boolean-Parameter) pt->cansm Typen

Context diagram: The target platform determines the definition of Platform_Types.h, whose types are located under a fixed path in the model view and are used by numerous BSW modules. The user examples originate from later releases. Sources: [SWS_Platform_00038], TPS StandardizationTemplate p. 77, SWS BFXLibrary p. 19, SWS CRCLibrary p. 41, SWS BSWMulticoreLibrary p. 16, SWS KeyManager p. 111, SWS CANStateManager p. 83

Integer and Floating-Point Types with Guaranteed Width

At the core of the module are unsigned and signed types with a fixed width of 8 to 64 bits as well as two floating-point types. Normatively, the requirements specify width and range of values, such as "32 bit unsigned" for uint32 [SWS_Platform_00015]. The C typedefs in the API catalog, for example typedef unsigned long uint32;, are likely to be read as a typical mapping that may vary depending on the compiler (interpretation). Question Q-d0ca377fc1abd98a (open)

typeWidth / FormatValue RangeReference
uint88 bit, unsigned0..255[SWS_Platform_00013]
uint1616 bit, unsigned0..65535[SWS_Platform_00014]
uint3232 bit, unsigned0..4294967295[SWS_Platform_00015]
uint6464 bit, unsigned0..18446744073709551615[SWS_Platform_00066]
sint88 bit, signed-128..+127[SWS_Platform_00016]
sint1616 bit, signed-32768..+32767[SWS_Platform_00017]
sint3232 bit, signed-2147483648..+2147483647[SWS_Platform_00018]
sint6464 bit, signed-9223372036854775808..9223372036854775807[SWS_Platform_00067]
float32IEEE 754-2008 binary32-3.4028235e+38..+3.4028235e+38[SWS_Platform_00041]
float64IEEE 754-2008 binary64±1.7976931348623157e+308[SWS_Platform_00042]

For signed types, AUTOSAR exclusively supports two's complement arithmetic for compiler and target. This results in the asymmetrical value ranges in Table [SWS_Platform_00061]. Other specifications consistently require these types. For example, the CRC library defines uint8 Crc_CalculateCRC8(const uint8*, uint32, uint8, boolean) SWS CRCLibrary p. 41. COM must support endianness conversion for uint16 to float64 RS COM p. 14. Both references originate from later releases and merely illustrate the usage.

Optimized Types *_least for Counters and States

In addition to the types with exact width, the module defines six optimized types. They only guarantee a minimum width and are derived from uint and sint, respectively:

The implementation may therefore choose a wider representation. The catalog signatures map all six types to unsigned int and signed int, respectively [SWS_Platform_00020].

As examples of use, the specification cites loop counters (at most 124 iterations ⇒ uint8_least) and switch arguments (17 states ⇒ uint8_least). For details, it refers to the chapter "AUTOSAR Integer Data Types" of the general BSW requirements SWS PlatformTypes p. 17.

Using boolean, TRUE, and FALSE in Compliance with the Rules

boolean has the value range FALSE = 0 and TRUE = 1 and may only be used together with these definitions [SWS_Platform_00026]. For R20-11: boolean is implemented as an unsigned integer type with the shortest bit length natively supported by the platform, typically 8 bits [SWS_Platform_00027]. A document passage from R24-11/R25-11 phrases the same identifier differently: there, boolean is implemented via the C99 type _Bool, and AUTOSAR no longer specifies the exact size SWS PlatformTypes p. 18. For R20-11, this later version is not normative.

boolean must also be mapped to a type that pointers can point to, so that parameters can be passed via API. The efficient bit types of some hardware cannot be pointed to and are therefore excluded [SWS_Platform_00060]. Three rules apply to the symbols TRUE and FALSE:

For assignments to boolean variables, arithmetic and bitwise operators are prohibited: +, ++, -, --, *, /, %, <<, >>, ~, and &. Only the assignment of TRUE or FALSE as well as results from relational expressions, logical operations, and (in)equality checks is permissible. Comparisons are only made with == or != against TRUE/FALSE or via if (var) or if (!var) [SWS_Platform_00034]. Consuming modules follow this pattern. For example, Bfx_GetBit explicitly returns the result of a bit test as TRUE or FALSE SWS BFXLibrary p. 19.

boolean_regeln start Operation on boolean variable art Assignment or comparison? start->art zuw Right-hand side: TRUE/FALSE, relational (<, >, <=, >=), logical (&&, ||, !) or (==, !=)? art->zuw Zuweisung verg Form: == TRUE/FALSE, != TRUE/FALSE, if (var) or if (!var)? art->verg Vergleich ok permitted zuw->ok yes nok prohibited (e.g., +, ++, -, --, *, /, %, <<, >>, ~, &) zuw->nok no verg->ok yes nokv not listed as permitted form verg->nokv no

Activity diagram: For boolean variables, only the listed forms of assignment and comparison are permitted; arithmetic and bitwise operators are not. Sources: [SWS_Platform_00034], [SWS_Platform_00026]

Untyped Buffer Pointers: VoidPtr and ConstVoidPtr

The two pointer types differ in the direction of data flow:

The data flow direction is thus already inherent in the type name SWS PlatformTypes p. 27 SWS PlatformTypes p. 28.

The Key Manager shows how this looks in interfaces. KeyMServiceCertificateByCertId passes RequestData as ConstVoidPtr together with a length of type uint32. The response is received by ResponseData of type VoidPtr; ResponseDataLength (INOUT) specifies the available buffer length SWS KeyManager p. 111. Further examples:

In all three examples, the length is passed along as a separate uint32 parameter or as a dedicated structure element because an untyped pointer does not carry length information.

Buffer passing with ConstVoidPtr and VoidPtr (example KeyM)CallerKeyMStore request data in bufferAntwortpuffer bereitstellenKeyM_ServiceCertificateByCertId(Service, RequestData: ConstVoidPtr,RequestDataLength: uint32,ResponseData: VoidPtr,ResponseDataLength: uint32 [INOUT])ConstVoidPtr: buffer is passed to the calleeVoidPtr: buffer receives data for the calleraltOperation angenommenE_OKnot acceptedE_NOT_OK / KEYM_E_BUSY /KEYM_E_KEY_CERT_SIZE_MISMATCH /KEYM_E_PARAMETER_MISMATCH

Sequence diagram: During a service call, the ConstVoidPtr carries the request to the callee, while the VoidPtr receives the response for the caller. Sources: SWS KeyManager p. 111, [SWS_Platform_91001], [SWS_Platform_91002]

typwahl start Datum festlegen zeiger Pointer to buffer? start->zeiger richtung Pass buffer to callee? zeiger->richtung yes wahr Wahrheitswert? zeiger->wahr no cvp ConstVoidPtr (const void*) richtung->cvp yes vp VoidPtr (void*) Daten an Aufrufer richtung->vp no bool boolean only with TRUE/FALSE wahr->bool yes gleit Gleitkommazahl? wahr->gleit no flt float32 / float64 (IEEE 754-2008) gleit->flt yes least Minimum width sufficient (e.g., loop counter, switch argument)? gleit->least no opt uint8_least … sint32_least least->opt yes fest uint8 … uint64 / sint8 … sint64 least->fest no

Activity diagram: The choice of type follows the questions buffer pointer, boolean value, floating-point number, minimum width, or exact width. Sources: [SWS_Platform_91001], [SWS_Platform_91002], [SWS_Platform_00026], [SWS_Platform_00041], [SWS_Platform_00020], SWS PlatformTypes p. 17

Platform Identification: CPU_TYPE, CPU_BIT_ORDER, CPU_BYTE_ORDER

For each platform, three properties must be defined in the header:

Both order symbols are #defines that carry exactly one of the permissible values [SWS_Platform_00038] [SWS_Platform_00039].

cpu_symbole start Zielplattform portieren breite Register width of the CPU? start->breite t8 CPU_TYPE_8 breite->t8 8 Bit t16 CPU_TYPE_16 breite->t16 16 Bit t32 CPU_TYPE_32 breite->t32 32 Bit t64 CPU_TYPE_64 breite->t64 64 Bit bit Bitreihenfolge (Register)? t8->bit t16->bit t32->bit t64->bit msb CPU_BIT_ORDER = MSB_FIRST bit->msb Big Endian lsb CPU_BIT_ORDER = LSB_FIRST bit->lsb Little Endian byte Bytereihenfolge (Speicher)? msb->byte lsb->byte high CPU_BYTE_ORDER = HIGH_BYTE_FIRST byte->high Big Endian low CPU_BYTE_ORDER = LOW_BYTE_FIRST byte->low Little Endian ende Symbole als #define in Platform_Types.h high->ende low->ende

Activity diagram: When porting to a target, register width, bit order, and byte order are determined and each mapped to exactly one symbol value. Sources: [SWS_Platform_00045], [SWS_Platform_00048], [SWS_Platform_00049], [SWS_Platform_00050], [SWS_Platform_00051]

For big-endian bit order, CPU_BIT_ORDER = MSB_FIRST applies; for little-endian, LSB_FIRST applies [SWS_Platform_00048] [SWS_Platform_00049]. Bit names and significance must be strictly separated here. The MSB is always located on the far left in the accumulator, regardless of the CPU type. In Motorola architectures (Big Endian Bit Order), Bit0 designates the most significant bit; in all others, it designates the least significant bit SWS PlatformTypes p. 15 SWS PlatformTypes Fig. 7.1 p. 14.

bitordnung be CPU_BIT_ORDER = MSB_FIRST (Big Endian, z. B. Motorola) Bit0 = MSB msb Register-MSB (immer links) be->msb Bit0 bezeichnet le CPU_BIT_ORDER = LSB_FIRST (Little Endian) Bit0 = LSB lsb Register-LSB (immer rechts) le->lsb Bit0 bezeichnet w7 Wertigkeit 2^7 = 128 msb->w7 entspricht w0 Wertigkeit 2^0 = 1 lsb->w0 entspricht

Structure diagram according to Fig. 7.1: The significance of the register bits is fixed; only the numbering of Bit0 depends on CPU_BIT_ORDER. Sources: SWS PlatformTypes Fig. 7.1 p. 14, SWS PlatformTypes p. 15

For big-endian byte order, CPU_BYTE_ORDER = HIGH_BYTE_FIRST applies: the most significant byte of a 16-bit value is located at address n, the least significant at n+1. For little-endian, LOW_BYTE_FIRST applies with reversed allocation [SWS_Platform_00050] [SWS_Platform_00051]. The designations Byte0 and Byte1 serve only for illustration and may differ in a manufacturer's reference documentation SWS PlatformTypes p. 16.

byteordnung cluster_high HIGH_BYTE_FIRST (Big Endian) cluster_low LOW_BYTE_FIRST (Little Endian) wert uint16-Wert ms MS Byte (Byte1) Bits 15..8 wert->ms ls LS Byte (Byte0) Bits 7..0 wert->ls hn Adresse n ms->hn ln1 Adresse n+1 ms->ln1 hn1 Adresse n+1 ls->hn1 ln Adresse n ls->ln

Structure diagram according to Fig. 7.2/7.3: The same uint16 is mapped to addresses n and n+1 with swapped bytes depending on CPU_BYTE_ORDER. Sources: SWS PlatformTypes Fig. 7.2 p. 16, SWS PlatformTypes Fig. 7.3 p. 15, [SWS_Platform_00039]

Other specifications justify why these details are necessary. The memory representation of data strongly depends on processor architecture and compiler settings. For this reason, SOME/IP requires a serialization algorithm that converts into a common network representation RS SOMEIPProtocol p. 21. Presumably, such conversions in implementations rely on CPU_BYTE_ORDER; however, the payload does not explicitly verify this. Question Q-87e212e9eb2a2047 (open)

Behavior in the event of an error

Interpretation: Because Platform_Types.h only provides types and symbols, the module has no runtime errors and no error codes. Question Q-e504d08b84d7ff70 (open) Error patterns manifest during compilation, integration, or conformance testing. The requirements state the typical causes [SWS_Platform_00002]:

Further detailed evidence

AI-generated guide based on the requirements of R20-11 and associated document passages, some of which originate from later releases. The specification is authoritative.

Platform Types (Platform_Types)

Platform-specific fundamental data types (integers, booleans, floating-point numbers) mapped to CPU architecture primitives.

Typen — Übersicht

Typen — Detailansicht

type float32 [SWS_Platform_00041] 📄 PDF

typedef float float32;

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".

type float64 [SWS_Platform_00042] 📄 PDF

typedef double float64;

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".

type VoidPtr [SWS_Platform_91001] 📄 PDF

typedef void* VoidPtr;

This standard AUTOSAR type shall be a void pointer Note: This type shall be used for buffers that contain data returned to the caller.

type ConstVoidPtr [SWS_Platform_91002] 📄 PDF

typedef const void* ConstVoidPtr;

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.

type CPU_TYPE [SWS_Platform_00064] 📄 PDF

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.

type CPU_BIT_ORDER [SWS_Platform_00038] 📄 PDF

This symbol shall be defined as #define having one of the values MSB_FIRST or LSB_FIRST according to the platform.

type CPU_BYTE_ORDER [SWS_Platform_00039] 📄 PDF

This symbol shall be defined as #define having one of the values HIGH_BYTE_FIRST or LOW_ BYTE_FIRST according to the platform.

type TRUE_FALSE [SWS_Platform_00056] 📄 PDF

The symbols TRUE and FALSE shall be defined as follows: #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/CP_MOD_Platform
Status
unspecified
Version
AUTOSAR/AP/record/CP_MOD_Platform@rel:R20-11#e1ea6195
Content hash
e1ea6195
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_PlatformTypes.pdf#nameddest=SWS_Platform_00026

Types

boolean type

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.

float32 type

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;
float64 type

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;
sint16 type

This standard AUTOSAR type shall be of 16 bit signed.

typedef signed short sint16;

This optimized AUTOSAR type shall be at least 16 bit signed.

typedef signed int sint16_least;
sint32 type

This standard AUTOSAR type shall be 32 bit signed.

typedef signed long sint32;

This optimized AUTOSAR type shall be at least 32 bit signed.

typedef signed int sint32_least;
sint64 type

This standard AUTOSAR type shall be 64 bit signed.

typedef signed long long sint64;
sint8 type

This standard AUTOSAR type shall be of 8 bit signed.

typedef signed char sint8;

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

uint16 type

This standard AUTOSAR type shall be of 16 bit unsigned.

typedef unsigned short uint16;

This optimized AUTOSAR type shall be at least 16 bit unsigned.

typedef unsigned int uint16_least;
uint32 type

This standard AUTOSAR type shall be 32 bit unsigned.

typedef unsigned long uint32;

This optimized AUTOSAR type shall be at least 32 bit unsigned.

typedef unsigned int uint32_least;
uint64 type

This standard AUTOSAR type shall be 64 bit unsigned.

typedef unsigned long long uint64;
uint8 type

This standard AUTOSAR type shall be of 8 bit unsigned.

typedef unsigned char uint8;

This optimized AUTOSAR type shall be at least 8 bit unsigned.

typedef unsigned int uint8_least;
VoidPtr type

This standard AUTOSAR type shall be a void pointer Note: This type shall be used for buffers that contain data returned to the caller.

typedef void* VoidPtr;