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.

CRC engine or library for Keystone devices

I am currently use C6670 for my project. I have extensive use for CRC32 and CRC8 in many places in my code. I am looking for if there is any optimized library for CRC in TI that I can use to improve my code speed. I notice there are also 6 CRC engine in Packet accelerator (PA). How can I use one of them without break PA. I use PA in my code for UDP packets. 

Can anyone help me in this?

  • I'm unaware of any library support for CRC, but I will ask internally.

    Regarding the PA and their support for CRC, I'm not sure what exactly you are asking.  The PA can support CRC generation and checking in HW for your ethernet traffic so that software is not needed at all.  Are you asking if this is possible, or if you can use the CRC from the PA in some other way?

    Regards,

    Travis

  • I am asking if I can use CRC from PA  or any other HW peripheral to calculate CRC for my internal frame to reduce load of CPU.

    Thanks

    Nedal

  • When you say internal, I assume you want to generate a CRC for a given on-chip data buffer(frame) and have the result given back to the CPU, not sending it directly to the Ethernet port for transmission.  Is this correct?  You could use the PA to generate CRC for your frame, but it probably depends on your frame size whether or not it is worth it.  There is overhead associated with the PA generating the CRC and providing back the results, so my understanding is that for small packets it may not be worth it but for larger data sizes it may work fine.  The procedure would be something like..

    - Iniitally configure the CRC polynomial you want to use.  This is a one-time operation by programming the command into the #5 PDSP within the PA.

    - For each frame you submit to the PA for CRC generation, you specify the: offset of where to begin the CRC calulation with the buffer, the length of the calcuation, place to store the CRC result (generally end of payload), and finally the next queue where the descriptor is place when done (queue can point back to the CPU)

    Regards,

    Travis

  • What I mean by internal that this frame not intention to transfer outside DSP.

    I try to implement this test in PA_emacExample project

    -The first command I able to use Pa_configCrcEngine  and get ok response

    -I have problem to understand how to use Pa_configCmdSet  I don't know what is  command set index and number of command. Should I set all command or only

    pa_CMD_CRC_OP.

    -when I prepare frame and push the descriptor what should I do to be sure it will go to PDSP #5.

    Thanks.

  • Hi, Nedal:

    The command set is designed to be executed after packet classification in the Rx (From-network) direction.
    You may want to use the tx command feature to perform internal paylaod CRC calculation. You will need to use  API Pa_formatTxCmd() to construct the following two tx commands:
    - pa_CMD_CRC_OP: CRC generation instruction
    - pa_CMD_NEXT_ROUTE: instruct PASS to send the packet to the desired host queue after CRC calculation

    You wll then send the packet to the sixth PASS Tx queue (645).

    Please refer to the PA LLD doxygen or pa.h for tx command operation in detail and PA UnitTest/test3.c for some example code.

    Best regards,

    Eric

     

     

     

  • In example PA_UnitTest, in test3 as you mention, code done what you described. First configure CRC engine for CRC16 (for PDSP 5) and then Pa_formatTxCmd()  for both

     pa_CMD_CRC_OP and pa_CMD_NEXT_ROUTE also for PDSP5 . However, I don't see any CRC16 in the received packet anywhere.

    What is wrong in this test if it follow all steps?

  • Please send us the sample packet and the CRC command settings!

    Best regards,

    Eric

     

     

     

  • I don't modify anything in PA UnitTest/test3.c use the same CRC command setting and same packet.

  • Hi, Nedal:

    You are right. The offsets at the CRC command are incorrect. Please try the following CRC command configuration:

    /* CRC */
    static paCmdCrcOp_t t3pktCrc = {
       
        0,     /* ctrlbit */
        42,    /* startoffset */
        78,    /* len */
        0,
        0,
        0,
        78,    /* crcoffset */
        0      /* frametype */

    };

    You can see the calculated CRC appear at the last two bytes of the output packet.

    Thank you so much for pointing out this error. We will fix it at the future releases.

    Best regards,

    Eric

     

  • Thanks for your help. Now I able to use PDSP 5 CRC engine to calculate CRC for user specific packet.