This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LAUNCHXL-CC1352R1: Change CRC xor value

Part Number: LAUNCHXL-CC1352R1
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 ?

  • Hi, 

    In order to help you with your issue, I need some more information. Can you provide as much background information as possible including:

    Which version of the SDK are you using? 

    Which project are you using and what kind of modifications have you made? 

    Are you using a LaunchPad or a custom board? 

    Can you please also clarify your last question? I'm unsure what you mean.

    Thanks, 
    Elin

  • I would suggest you take the rfPacketRX/ TX examples and add the overrides you require and test with this to see if it works, if not, please post the project and we can take a look at it. Also, it's not clear which chip you are using since you are mentioning to different in your post. 

  • I did a test with two boards: (TX) CC1352R1 Launchpad and  (RX) CC1350 SensorTag using SmarRF Studio

    Configuration of RX side - CC1350:

    TX side (CC1352R):

    CRC on the RX (CC1350) is correct - no CRC Error. 

    There is no difference if I add (0xC0040061 with 0xFFFF0000) or not, always packet is received with no CRC error. CC1352R - has ability to Xor returned CRC.

    The question: Why CRC is correct (on CC1350) despite the fact that I have override (0xC0040061 with 0xFFFF0000) on CC1352R ?

  • Hi,

    Apologies for the delay. 

    Have you made any progress to or have you been able to solve your issue? 

    Thanks, 
    Elin

  • Hi Elin,

    still waiting for an answer. 

    Best Regards,

    Mariusz

  • Hi Mariusz,

    Thanks for sharing. 

    Can you share the project(s) and we'll try and reproduce the issue here? 

    Thanks, 
    Elin

  • Hi Elin,

    Please use example from my post: Dec 14, 2020 9:56 AM with SpartRF Studio settings. There is no difference in the communication when I add  0xC0040061, 0xFFFF0000 in the overrides. It seems that 1352 ignore that settings the same as 1310.

     

    Is there any way to get CRC calculated by RF core?

    Best Regards,

    Mariusz

  • Could you make a software example with the overrides you are using (rfPacketRX/TX)? I want to avoid any potential issues caused by the override editor. 

    Then it's easier to test and reproduce? 

  • Please see attached 2 projects:

    - rfPacketRx_CC1310_LAUNCHXL_nortos_ccs

    - rfPacketTx_CC1352R1_LAUNCHXL_nortos_ccs

    Overrides in the CC1352:

    HW32_ARRAY_OVERRIDE(0x2004,1),
    // The CRC-16 polynome: CRC-16-CCITT normal form, 0x1021 is x^16 + x^15 + x^5 + 1
    0x10210000,
    0xC0040051,
    // Init value  0x1D0F
    0x1D0F0000,
    // Override crcXor
    0xC0040061,
    // 0xFFFF     
    0xFFFF0000,

    Overrides in the CC1310:

    HW32_ARRAY_OVERRIDE(0x2004,1),
    0x10210000,
    0xC0040051,
    0x1D0F0000,

    The CC1352 has extra override 0xC0040061 (// Override crcXor) but the CC1310 receives packets without CRC errors. There is no difference if there is 0xFFFF0000 or other value in the crcXor override.

    rfPacketTx_CC1352R1_LAUNCHXL_nortos_ccs.ziprfPacketRx_CC1310_LAUNCHXL_nortos_ccs.zip

    Best Regards,

    Mariusz

  • Thank you. It could look like the documentation for crcXor  is not correct. I'm able to replicate what you are seeing. But it could look like that the last override operate on the 16 LSB bits and not the 16 MSB bit as indicated in the documentation. I changed

    0xC0040061,
    // 0xFFFF     
    0xFFFFxxxx,

    the 2 LSB bytes marked with x and that had an effect. 

    Could you check on your end to see if you get the wanted effect if you change the LSB bytes?

  • Hi TER,

    now it is working as should, crc is correct. I changed the LSB bytes:

    0xC0040061,

    0x0000FFFF,

    Thank you.

    Best Regards,

    Mariusz

  • Hi TER,

    I verified Override crcXor on the CC1310 and it seems to work also. I did a test and set the same overrides 0xC0040061, 0x0000FFFF, on the CC1352(TX) and CC1310(RX) - CRC is OK. 

    Documentation for CC1310 says that it is not possible.

    Best Regards,

    Mariusz