AnsweredAssumed Answered

CRC Configuration

Question asked by BJ RAJENDRANATH on Nov 3, 2017
Latest reply on Nov 8, 2017 by BJ RAJENDRANATH

Hello all,

I'm using codewarrior v2.9 platform for my MPC5602P. I adopted the Example MPC5748G CRC32 GHS614 to implement for MPC5602P. Though I initialized the registers, it is not updating properly.

ie., after the line

 CRC.CNTX[1].CRC_CFG.BIT.POLYG = 1;    /* crcCCITT polynomial is selected */

If I check in the debug window, the registers still show 0. One more interesting thing I found is context is defined as structure array of two. If I do this CRC.CNTX[10100].CRC_CFG.BIT.POLYG = 1 still executes without any errors.

 

#include "Pictus_Header_v1_09.h"

const uint8_t TextString1[] = {0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20};

int main(void) {
   volatile int i = 0;
 System_Init();

 CRC.CNTX[1].CRC_CFG.BIT.POLYG = 0;    /* crcCCITT polynomial is selected */
 CRC.CNTX[1].CRC_CFG.BIT.INV = 0;
 CRC.CNTX[1].CRC_CSTAT.H[0] = 0xFFFF;   /* Seed value 0xFFFFFFFF */

 

   for(i=0; i<sizeof(TextString1)-1; i++) /* size of TextString1 is decreased by 1 due to null character of string */
   {
     *(uint8_t*)&(CRC.CNTX[0].CRC_INP) = TextString1[i];
   }

   /* Loop forever */
   for (;;) {
     i++;
   }
}

 

Hope some one comes with the solution.

 

Thanks & Regards,

BJ Rajendranath

Attachments

Outcomes