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 7 | bit 6 | bit 5 | bit 4 | bit 3 | bit 2 | bit 1 | bit 0 | |
|---|---|---|---|---|---|---|---|---|
| byte 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| byte 1 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 |
| byte 2 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| byte 3 | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 |
Placement rules
| ComSignalEndianness | ComBitPosition is the… | Walk |
|---|---|---|
LITTLE_ENDIAN | signal's LSB | Towards the MSB: bit number + 1 each step. |
BIG_ENDIAN | signal's MSB | Towards the LSB: bit number − 1 each step; from bit 0 of a byte go to bit 7 of the next byte (+ 15). |
OPAQUE | bit 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 order | PDU bits, MSB → LSB | Byte 0 | Byte 1 |
|---|---|---|---|
LITTLE_ENDIAN | 14 13 12 11 10 9 8 · 7 6 5 | 0xA0 | 0x54 |
BIG_ENDIAN | 5 4 3 2 1 0 · 15 14 13 12 | 0x2A | 0x50 |
What COM guarantees about byte order
- Endianness conversion for all signed and unsigned integer types (SWS_Com_00007).
- Signals and group signals are handled the same way (SWS_Com_00829).
- Sender side: conversion happens before the I-PDU callout (SWS_Com_00221).
- Receiver side: sign extension and conversion happen before filtering and notification (SWS_Com_00352).