CRC on the nrf52840

Hello!

Regarding the CRC on the nrf52840 the specifications make it clear that the maximum length of the CRC is 3 bytes, We are working on an industrial communication protocol that we want to implement on the nrf52840. This protocol needs 4 bytes crc (crc32), is there a workaround for this? 

Thanks! 

  • Hello,

    The 3 byte CRC is first and foremost the standard of Bluetooth Low Energy, and not specific for the nRF52840.

    For a 4 byte CRC, check out the function crc32_compute() found in nRF5 SDK 17.1.0\components\libraries\crc32\crc32.c

    If you are using a different nRF5 SDK version, you will probably find something similar. If you are using NCS (and not the nRF5 SDK), there is probably something similar to that as well. In that case, please let me know if you can't find it.

    Best regards,

    Edvin

  • So to clarify what you are suggesting, the nrf52840 is capable of a 4-byte crc? Do you just need to configure it in such a way?

    Am I understanding you correctly?

  • Depends on what you intend to use it for. Yes. The nRF52840 can generate a 4 byte CRC. No, it can not use this 4 byte CRC instead of the 3 byte CRC in the end of Bluetooth Low Energy packets, because the Bluetooth stack uses a 3 byte CRC. But I suspect you are not using Bluetooth, since you are using a 4 byte CRC?

    Best regards,

    Edvin

  • Okay fair enough, What we are trying to figure out is whether the nrf52840 will be able to support an industrial communication protocol called IO-Link Wireless. This protocol builds upon Bluetooth Low Energy version 4.2, but it requires 4 bytes CRC instead of 3. With that information, do you conclude that the nrf52840 board will not be able to support IO-Link Wireless since it has this specification? 

  • That depends on how the IO-Link Wireless does this. To be fair, I don't think that everyone using this protocol has written their own Bluetooth stacks (but they could of course be using some sort of open source stack. I don't know). If they use 4 bytes instead of 3, they will also be breaking the specification, so they will not be able to certify it with Bluetooth SIG. 

    Are you sure that the 4 byte CRC is not just added to the Bluetooth payload packet (and then the standard 3 byte CRC follows after that)? I am not familiar with IO link (in fact I never heard of it before now), and a quick google search didn't really make me a lot smarter on that topic. Either way, if your question is whether it is possible to increase the CRC from 3 to 4 bytes inside our Bluetooth stack, then I am afraid the answer is no.

    But if that is the case, I doubt that there exists another wireless protocol that is an exact copy of the Bluetooth Low Energy standard, with the only difference being one extra byte of CRC, so in that case, I guess it wouldn't work anyway.

    It may be that I don't understand this fully, but perhaps you can ask the developers/owners of IO-Link whether that is actually the case (that they are equivalent to BLE apart from the amount of CRC bytes)

    Best regards,

    Edvin

Related