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.

AM2432: SORTE_G, How to check CRC

Part Number: AM2432

[日本語]
1パケットが1000バイト以上のデータを複数パケットで通信を行う事を考えています。
そのため通信時間を短くする為に、図の様に全てのパケットを受信してからCRCチェックを行いたいのですが、その様な方法が可能でしょうか。

[English]
I am thinking of communicating data in multiple packets, each packet containing 1000 bytes or more.
Therefore, in order to shorten the communication time, I would like to perform a CRC check after receiving all packets as shown in the figure. Is such a method possible?

  • CRC check on in-coming packets are performed in hardware. Hardware is reset with new frames. If you want to do firmware CRC32 checks using broadside accelerator there is some overhead to do the calculation with a combination of firmware and CRC32 hardware. My recommendation for frame check sum is to use the built in hardware and only check the crc flag per frame.

    The firmware+broadside accelerator makes sense if you want to protect additional data in the payload. Such scheme is used with functional safety protocols where safe data payload is protected with additional check sum.

    Let me know if you still want to use multi-packet CRC check and I will give you some guidance on how to use the accelerator.

    - Thomas

  • [日本語]
    マルチパケットCRCチェックを検討する為に、アクセラレータの使用方法についてのガイダンスのご提供をお願いいたします。

    [英語]
    Please provide guidance on how to use accelerators to consider multi-packet CRC checking.

  • Hello,

      here is a code snippet to use the CRC widget attached to the PRU.

    ; init CRC32 - set CRC32, default seed of 0xffffffff
    ; reference TRM 6.4.6.2.2.1 PRU and CRC16/32 Interface

         ldi32   r25, 1
         xout    CRC_ID, &r25, 4
         ldi32   r28, 0xffffffff
         xout    CRC_ID, &r28, 4

    ; start CRC32 block calculation r2-r9, 32 bytes
         xout    CRC_ID, &r2, 4

    ; takes 12 cycles before you can read the result

         xin     CRC_ID, &r29, 4

    Note, that for Ethernet frame CRC32 the calculation is done in MII_RT hardware on-the fly and not with the CRC widget attached to the PRU.

    - Thomas