AnsweredAssumed Answered

CRC Calculation for HCS08

Question asked by Preetu Abraham on Aug 2, 2016
Latest reply on Aug 4, 2016 by Alice_Yang

I would like to know the CRC calculation for MC9S08AC128 pagine meory devices .Whether the CRC should be calculated for all the pages or it is enough to calculate the CRC for only the memory ranges where code is allocated . I am storing the Final value at location 0xfFFC0 .The memory ranges are as shown below to calculate the CRC

 

 

1)First block of memory: 0x20F0 to 0x7FFF

 

2)Second block of memory :0x8000 to 0xBFFF

3)Third block of memory : 0xC000 to 0xff9b

4) fourth block of memory : 0xFFCC to 0xFFFF

5)Last Block : 0x28000 to 0x2bFFF

 

 

I had the linker file for my project as below:

 

SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */
    MY_STK                   =  NO_INIT      0x15FF TO 0x17FF;
    RAM1                     =  READ_WRITE   0x0080 TO 0x01FF;
    RAMSEG                   =  READ_WRITE   0x0200  TO 0x0370;
    RAM2                     =  READ_WRITE   0x0372 TO 0x15FE;
    RAM3                     =  READ_WRITE   0x1870 TO 0x20EF;
    ROM                      =  READ_ONLY    0x20F0 TO 0x7FFF;
    ROM1                     =  READ_ONLY    0xC000 TO 0xFF9B;
    /* banked FLASH ROM */
    PPAGE_0                  =  READ_ONLY    0x008000 TO 0x00BFFF; /* PAGE partially contained in ROM segment */
    PPAGE_2                  =  READ_ONLY    0x028000 TO 0x02Bfff;
    //PPAGE_4                  =  READ_ONLY    0x048000 TO 0x04BFFF;
    //PPAGE_5                  =  READ_ONLY    0x058000 TO 0x05BFFF;
    //PPAGE_6                  =  READ_ONLY    0x068000 TO 0x06BFFF;
    //PPAGE_7                  =  READ_ONLY    0x078000 TO 0x07BFFF;
END

PLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */
    MySeg                      INTO  RAM1;
    DEFAULT_RAM                   INTO  RAM2,RAM3;
    DEFAULT_ROM, ROM_VAR, STRINGS INTO  ROM,PPAGE_0,ROM1,PPAGE_2;//PPAGE_4,PPAGE_5,PPAGE_6,PPAGE_7; /* See compiler option -OnB=b. */
    //PAGED_ROM                      INTO  PPAGE_0,ROM1,PPAGE_2,PPAGE_4,PPAGE_5,PPAGE_6,PPAGE_7;    
   SSTACK                        INTO  MY_STK;

Outcomes