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.

TMS320F280025C: VCRC expected results for verification purpose.

Part Number: TMS320F280025C

I have used 2838x_vcrc_crc_16 example project as reference to implement VCRC on TMS320F280025C. I have used the same data as in the example i.e. 
static const uint16_t testInput[NWORDS] = {
0x4001, 0x8002, 0xC003, 0x0004, 0x4005, 0x8006, 0xC007, 0x0008,
0x4009, 0x800A, 0xC00B, 0x000C, 0x400D, 0x800E, 0xC00F, 0x0010,
0x4011, 0x8012, 0xC013, 0x0014, 0x4015, 0x8016, 0xC017, 0x0018,
0x4019, 0x801A, 0xC01B, 0x001C, 0x401D, 0x801E, 0xC01F, 0x0020,
0x4021, 0x8022, 0xC023, 0x0024, 0x4025, 0x8026, 0xC027, 0x0028,
0x4029, 0x802A, 0xC02B, 0x002C, 0x402D, 0x802E, 0xC02F, 0x0030,
0x4031, 0x8032, 0xC033, 0x0034, 0x4035, 0x8036, 0xC037, 0x0038,
0x4039, 0x803A, 0xC03B, 0x003C, 0x403D, 0x803E, 0xC03F, 0x0040,
};

The CRC has been calculated using 16 bit polynomial : CRC.run          = (void (*)(void *))CRC_run16BitPoly1;
After running the code I get following CRC: 0x9331.
I want to know if my implementation is correct. Therefore please let me know if 0x9331 is the correct result or I should be getting some other value?.

  • Hi Hameed,

    I will run it on 2838x and let you know what value you should get. 

    Thanks

    Aravindhan

  • Hi Hameed,

    yes. 0x9331 is correct value. 

    Thanks

    Aravindhan

  • Dear Aravindhan,

       Thankyou very much for confirmation. I think that using CRC_run16BitPoly1 function should be faster than table lookup approach?. Please confirm. Moreover I have not assigned the CRC data to any particular RAM location. It is declared as "static const uint16_t" so most probably residing in FLASH. I think that removing "static const" should allocate it to RAM and have some improvement in calculation time?. Actually I would like to go for the least time consuming approach.

  • Hi Hameed,

    You can profile and decide which function is better. I have a feeling that the CRC_run16BitPoly1 will be faster since, It will be good to profile and see before deciding. Can you profile and check ? In terms of where data needs to reside, there is nothing specific that it has to be in flash or RAM. You need to make sure your data is in RAM memory using linker cmd file, I do not think defining as static const uint16_t makes it go automatically to FLASH. You need to make sure the data array is placed in RAM using linker cmd file. 

    Thanks

    Aravindhan 

  • I also think CRC_run16BitPoly1 should be faster as it make use of the VCRC hardware unit. Anyways I will profile and share the results with you. My main objective is to implement CRC on the communication data buffer with minimum CPU processing overhead. The CPU bandwidth is limited because of some time critical and lengthy control tasks. The buffering of data is being done by the DMA controller. I think CRC_run16BitPoly1 needs to be called and executed by the main CPU in the DMA receive interrupt every time reception is complete. Do you have any more efficient way of doing this in mind?.

  • Hi Hameed,

    This is the right approach. You are on the right track. 

    Thanks

    Aravindhan