Other Parts Discussed in Thread: CC1310, CC1350, CC1352R
We have an issue with override crcXor. One of our product is using CRC-CCITT with CRC result as: (ushort)(~crc) :
const ushort Polynome = 0x1021; //Polynome = X^16+X^12+X^5+1 ushort ComputeCrc(ushort crc, byte data) { for(inti= 0; i<8; i++) { if((((crc & 0x8000)>>8)^(data &0x80))!=0) { //shift left once crc^=Polynome; //XOR with polynomial } else //next packetData reg bit } return crc; } public ushort ComputeCrc(byte[] packet) { ushort crc = 0x1D0F; for(int i=0; i<packet.Length; i++) { crc = ComputeCrc(crc, packet[i]); } return (ushort)(~crc); }
There is a need to xor crc result with 0xFFFF at the end. Here are my overrides configuration:
OVERRIDES:
(....)
HW32_ARRAY_OVERRIDE(0x2004,1),
0x10210000, // The CRC-16 polynome: CRC-16-CCITT normal form, 0x1021 is x^16 + x^15 + x^5 + 1
0xC0040051,
0x1D0F0000, // Init value 0x1D0F
0xC0040061, /* Override crcXor */
0xFFFF0000, // 0x0FFFF
0xFFFFFFFF
I did a test RX/TX with SmartRF Studio between two boards and seems that override "0xC0040061" is not working. There is no difference if I add that override to the transmitter device or not - CRC is the same on the receiver side.
Is it possible to add crcXor on the CC1350/CC1310 ?