AUTOSAR COM · Sheet

Signal packing

Where a signal's bits sit in a packet (I-PDU). From lesson 16.

Bit numbering

PDU bit p is in byte p / 8, bit p % 8. Bit 0 is the LSB of byte 0. Fixed in AUTOSAR: "sawtooth" counting, "decreasing" bit order (System Template TPS_SYST_01068, TPS_SYST_01069).

bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0
byte 076543210
byte 115141312111098
byte 22322212019181716
byte 33130292827262524

Placement rules

ComSignalEndiannessComBitPosition is the…Walk
LITTLE_ENDIANsignal's LSBTowards the MSB: bit number + 1 each step.
BIG_ENDIANsignal's MSBTowards the LSB: bit number − 1 each step; from bit 0 of a byte go to bit 7 of the next byte (+ 15).
OPAQUEbit 0 of the first byte, "like in little endian byte order"Bytes copied uninterpreted; data is treated as uint8[n] and always maps to n whole bytes.

Sources: System Template Table 6.14 (startPosition) and §6.2.2; SWS COM ECUC_Com_00259, SWS_Com_00472, SWS_Com_00810.

Worked example

10-bit signal, ComBitPosition = 5, value 0x2A5 = 10 1010 0101.

Byte orderPDU bits, MSB → LSBByte 0Byte 1
LITTLE_ENDIAN14 13 12 11 10 9 8 · 7 6 50xA00x54
BIG_ENDIAN5 4 3 2 1 0 · 15 14 13 120x2A0x50

What COM guarantees about byte order