SMCS332SpWUser ManualEADS Astrium GmbH, ASE2Doc No: SMCS_ASTD_UM_100Issue: 1.4Updated: 9-Sep-2006Page: 53 of 131– All Rights Reserved – Copyright per DIN 34 –byte 3: header bytebyte 4: first data byte (included in checksum)..byte n: last data byte (included in checksum)transmitted packet via SpaceWire:byte 1 (header byte)byte 2 (header byte)byte 3 (header byte)byte 4 - byte n (data bytes)byte c1 - byte c2 (2 checksum bytes)EOP5.6.2 Routing and Checksum GenerationAssuming wormhole routing and checksum generation/check is enabled.The first header byte will be removed from the packet on each SpaceWire Router, where the packet is routed through, ifheader deletion is enabled. If the header byte(s) is included in the checksum, the two checksums will never be equal.Therefore it is mandatory to exclude the header byte(s) from checksum if routing over SpaceWire Router is combined withchecksum generation. The number of header bytes deleted during routing can range from one byte to several bytes. Thisdepends on the number of routers a packet is routed through.In this case the SMCS332SpW, generates two checksum bytes from the data bytes and appends these bytes at the end of thedata bytes. The SMCS332SpW at the other end of the virtual link generates again a checksum from the received bytes(without the last 2 bytes) and compares these with the received checksum (last 2 bytes).If routing is combined with checksum generation, set bit 4 in the register CHx_CNTRL1. The SMCS332SpW will use thefirst byte of the incoming data, to be transmitted (from HOCI or COMI), as number of bytes which should be excluded fromchecksum. The allowed range is from 1 up to 15. The number byte and the associated address byte(s) defined as header field.The header field size is minimum 2 and maximum 16 bytes. It is always accessed in blocks of 4 bytes (the first 4, 8, 12 or 16incoming bytes). This means that data which should be included in the checksum has to start at the next modulo 4 bytes. Therest of a 4-byte-block which is not covered by the number of address bytes is not transmitted.Example :Bit 4 is set in register CHx_CNTRL1 AND Bit 7 in register RT_CTRL is set.The first byte contains the number of header bytes excluded from checksum generation (value =1). The second byte is aheader byte. In total 2 bytes. The first 4 bytes built the header field, but the last 2 bytes will be NOT transmitted.byte 0: = 1 number of following header bytes excluded from checksum (NOT transmitted!)byte 1: header bytebyte 2: ignored (NOT transmitted!)byte 3: ignored (NOT transmitted!)byte 4: first data byte (included in checksum)..byte n: last data byte (included in checksum)transmitted packet via SpaceWire:byte 1 (header byte)byte 4 - byte n (data bytes)byte c1 - byte c2 (2 checksum bytes)EOP