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.

Problem with CRC32 0x4c11db7

Other Parts Discussed in Thread: MSP430F5528, MSP430F5510

Hi,

Im trying to CRC32 (polynomial of 0x4c11db7) two files but I am seeing wierd results on a MSP430F5528. For example I have 2 files (CRC32 checked with Hex workshop and another custom c# app) so i have a correct output, CRC'ing one file consistently outputs the wrong CRC.

Are there any know issue with CRC32 0x4c11db7?

Also the compiler is setup with a large memory model and High (size) optimization. 

Any views would be appreciated.

Kind regards

Des

  • Sorry, it isn't clear what exactly you are doing and what your problem is. Please tell step by step what you're doing and what you're expecting and what happens.
    Do I get you right, your results are correct for one file but not for two? Is it always the same file that fails or is it always the second one?
    I assume you're using the CRC32 module? And the reverse bit order register. The polynomial is fixed in the hardware. It complies to CCITT, but with reverse bit order.
    Do you re-initialize the CRC hardware to -1 between the checks?
  • And why you need CRC32? I am using CRC-CCITT, standard and reversed, calculation by CRCDIRB and CRCDI, without problems.

    D:\msp430>flash -p com14 -f test_msp430f5510.txt -e -ws -crc -crcr

    File: "test_msp430f5510.txt"
    Address: 08000  Words: 16384
    Size: 32768 bytes

    Get Device
    # JTID Fuse Device Core Hard Soft LotWafer DieX DieY
    0  91   OK   3180  1104  12   12  013BB046 2A00 2100
    1  91   OK   3080  1104  30   10  B15B9446 2000 1700
    2  91   OK   3180  1104  12   12  013BB046 1200 1E00
    3  91   OK   3881  1106  10   10  219CA446 1800 0F00

    Erase

    Write Smart
    Time: 208 ms  Speed: 153,8 KB/s

    CRC Calculation
    File  #0   #1   #2   #3
    23B1 23B1 23B1 23B1 23B1
    Time: 33 ms  Speed: 942,9 KB/s

    CRC Rev Calculation
    File  #0   #1   #2   #3
    C841 C841 C841 C841 C841
    Time: 34 ms  Speed: 937,9 KB/s

    Release Device

    Total Time: 406 ms

    D:\msp430>

  • Well im checking the integrity of a file which has a CRC32 value appended to the end of it. I have 2 of these files.

    -File A CRC32 value generated by the firmware matches the file everytime.
    -File B CRC32 value generated by the firmware doesnt the file but is consistent.

    CRC32 is used as the files in question have a CRC32 value appended to the end to check its intergrity so changing to CRC8 / 16 is not an option.

    Yes, CRC32 is initialised to -1 before handling the file.

    The CRC32 is not generated through hardware, but through a CRC32 module.

    The wierd thing is that it has been working up until now but lately started to fail on file B only which is puzzling me.

    Has anybody had similar problems this and/or with the optimiser set to high (with a large memory model)?

    Any thoughts would be appreciated.

    Des
  • So instead of using fast MSP430x5xx CRC16 hardware module, you are using slow software CRC32 calculation, because file has CRC32 value calculated? And software calculation sometimes give strange result? Don't understand why it is impossible to switch to CRC16 hardware module calculation. I will not use for sure software, when there is already existing hardware for the same job.

  • Thank you all for you suggestions, the issue is now resolved. The issue was the SD card corrupted the file in question.

    I will take into consideration the use of HW for CRC.

    Des
  • Well that proves that using a CRC was useful an dworked, whether CRC16 or CRC32 :)
  • zrno soli said:
    Don't understand why it is impossible to switch to CRC16 hardware module calculation.

    I do. In the real world of product design sometimes you don't have control over where your data comes from. It may come from a third-party module that you can't change.

    In this case, sounds like the OP is designing a system where there is some data he needs that is on an SD card, and that's the format provided to him. If the data given to him has a CRC32, then it has a CRC32 and you deal with it.

**Attention** This is a public forum