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.

RM44L920: CRC Question

Part Number: RM44L920

Hi

     I want to ask what PSA_SIGREGH1 and PSA_SIGREGL1  mean, and how to use them.

    If I use RM44L920 ,it says  that the  CRC module uses a fixed 64-bit polynomial    f(x) =x^64 + x^4 + x^3  +x +1.

   So  how do I set it up?

    Best regards

     HK

  • Hello,
    can you check if this document will answer your question?
    www.ti.com/.../spna146.pdf

    Michail
  • Hello Kai,

    Enclosed please find the CRC calculation in semi-CPU mode:


    int main(void)
    {
    /* USER CODE BEGIN (3) */
    uint32_t i, counter;
    /* clear the ESM error manually */
    esmREG->SR1[2] = 0x00000008U;
    esmREG->SSR2 = 0x00000008U;
    esmREG->EKR = 0x0000000AU;
    esmREG->EKR = 0x00000005U;

    //using CRC auto mode
    crcInit();
    _enable_IRQ();

    /** - Reset PSA*/
    crcREG->CTRL0 = (uint32)((uint32)1U << 0U)
    | (uint32)((uint32)1U << 8U);

    /** - Setup the Data capture mode to clear PSA counter */
    crcREG->CTRL2 = 0x00000000;

    /** - Pulling PSA out of reset */
    crcREG->CTRL0=0x00000000U;

    /** - Setup the Data trace for channel1 */
    crcREG->CTRL2 |= (uint32)0U << 4U;

    //change to CRC semi-CPU mode
    crcREG->CTRL2 = (uint32)(CRC_SEMI_CPU); //semi-CPU mode is used

    crcREG->SCOUNT_REG1= 0x1;
    crcREG->PCOUNT_REG1= 0x20; /*32 double-words; Length of crc pattern defined in crc_pattern.c*/

    crcDisableNotification(crcREG, 0x1F1F);
    crcEnableNotification(crcREG, CRC_CH1_CC); //channel 1 compression complete interrupt

    dma_config.SADD = (uint32_t)&CRC_Pattern[0];
    dma_config.DADD = (uint32_t)&(crcREG->PSA_SIGREGL1 );
    dma_config.CHCTRL = 0;
    dma_config.FRCNT = 0x20; //0x20, 64-bit, length of crc pattern
    dma_config.ELCNT = 1;

    dma_config.ELDOFFSET = 0;
    dma_config.ELSOFFSET = 0;
    dma_config.FRDOFFSET = 0;
    dma_config.FRSOFFSET = 0;
    dma_config.PORTASGN = 4;
    dma_config.RDSIZE = ACCESS_64_BIT;
    dma_config.WRSIZE = ACCESS_64_BIT;
    dma_config.TTYPE = BLOCK_TRANSFER;
    dma_config.ADDMODERD = ADDR_INC1;
    dma_config.ADDMODEWR = ADDR_FIXED;
    dma_config.AUTOINIT = AUTOINIT_OFF;

    // setting dma control packets for receive
    dmaSetCtrlPacket(DMA_CH0, dma_config);
    dmaReqAssign(DMA_CH0, 26); //DMA request line 26, CRC1 channel0
    dmaSetChEnable(DMA_CH0, DMA_SW);

    dmaEnable();

    //delay
    for(i=0; i<0x100000; i++);

    if ((CRC_Test[0] == CRC_Ref[0]) && (CRC_Test[1] == CRC_Ref[1]))
    {
    CRC_Error = 0;
    } else{
    CRC_Error = 1;
    }

    while(1);
    /* USER CODE END */

    return 0;
    }
  • Hello
    Thank you very much for your reply. I know how to use the CRC . But I have a quesition: Why add a delay time program
    //delay
    for(i=0; i<0x100000; i++);

    If it is to wait for the judgement that the CRC calculation is completed,Why not use the busy flag of CRC register to judge?

    Thanks and Regards,
    HK