ADuCM320 CRC/Signature

The ADuCM320 documentation mentions a CRC polynomial x24+x23+x6+x5+x+1.  What exactly does this mean and how is it used?

  • 0
    •  Analog Employees 
    on Sep 5, 2014 1:02 PM

    The CRC can be used to check whether an area of memory is corrupted.  If an CRC is calculated for a block of memory and this is stored in the memory then by re-doing the CRC and comparing it with the CRC will indicate whether either is corrupted.  For flash the flash controller SIGN command can be used for the check.  Determining the CRC to be stored might need to be done in software before writing the value to flash.  The best way to understand how the CRC is calculated is to study the following pieces of code:

       FeeSign(0x00800,0x00900);       //SIGN for page1.

       if(FeeCrc(511,(int *)0x00800) != pADI_FEE->FEESIG)

              Error();

    /**
       @brief int FeeCrc(int iLen, int *aiData);
          ===== Calculate the CRC of iLen words from the location aiData points to.

       @param iLen : { }
          The number of words to process. 
             This should be a multiple of 512 minus 1.
       @param aiData : { }
          The pointer to the first word to be processed. 
          This should point to an address that is a multiple of 512.
       @return The 24 bit CRC of the specified block.
       @warning Do not include pages from both flash blocks.
    **/   
    int FeeCrc(int iLen,int *aiData)
       {
       int i1,i2,iCrc;
      
       iCrc = 0xffffffff;            //Seed value.
       for(i1=0; i1<iLen; i1++)      //Starting at lowest address.
          {
          for(i2=31; i2>=0; i2--)    //MSB first.
             {
             iCrc <<= 1;             //Left shift.
             if((*(aiData+i1))&(1<<i2)) iCrc ^= 0x00800063;  //^= Polynomial.
             if(iCrc&(1<<24))           iCrc ^= 0x00800063;
             }
          }
       return(iCrc&0x00ffffff);      //Return 24 bits.
       }

  • 0
    •  Analog Employees 
    on May 8, 2019 10:41 AM
    This question has been closed by the EZ team and is assumed answered.