nRF5340 shockburst software CRC calculation

Dear nordic team,

we are successfully communicating our old nRF2401 shockburst design to a nRF5340 board; except for the CRC.

The challenge: the nRF2401 shockburst allowed payload lengths which are not multiples of bytes. Our payload length is 95 bit. Therefore we cannot use the nRF5340 integrated algorithm, as this only works when the payload is a multiple of bytes.

Trying to calculate the CRC in software, we ran into a number of issues. We could find the following information in the nRF24L01 datasheet:

CRC-16-CCITT (polynomial 0x1021) with 0xFFFF initial value. The CRC is calculated on address, packet control field, and payload.

A load of questions we would love the answer to please:

  •  easiest one first: for shockburst compatibility, there is no packet control field. We set the length of S0, Length, and S1 to 0. The CRC therefore only includes address and payload - right?

  • address: the address used by our nRF2401 is 0x C5 5A AA. For the nRF5340, we had to deal with endianess, and it's different on air etc. - this work now. But: how does the address go to the CRC algorithm please - which byte first, and which bit first?

  • payload: similar to address: in which byte and bit order is this going into CRC?


Thank you!

Uli

Related