S12Z 128  ROM checksum

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S12Z 128  ROM checksum

566 Views
charudattaingal
Contributor IV

Dear All,

 

I am calculating check-sum of the entire ROM using a simple 2-byte summation of the entire ROM memory block  in application.

Getting reset while passing some particular address range

 

0X00FE0328 -  0x00FE9345 it is working fine, but  for address range 0x00FE0000 - 0x00FFDFFF it is generating reset.

 

Am I accessing any invalid memory ?

 

Please find below map file snapshot for more details

 

SECTION-ALLOCATION SECTION
Section Name                    Size  Type     From       To       Segment
---------------------------------------------------------------------------------------------
.init                             62     R   0xFE0000   0xFE003D   ROM
.startData                        27     R   0xFE003E   0xFE0058   ROM
.rodata                          719     R   0xFE0059   0xFE0327   ROM
.text                          36894     R   0xFE0328   0xFE9345   ROM
.copy                            152     R   0xFE9346   0xFE93DD   ROM
PROMID                             6     R   0xFFDFFA   0xFFDFFF   PROMID_S
.stack                           256   R/W     0x1000     0x10FF   RAM
.data                            164   R/W     0x1100     0x11A3   RAM

 

Best Regards,

Charudatta

Labels (1)
0 Kudos
3 Replies

359 Views
charudattaingal
Contributor IV

Hello  Pascal ,

I am calling given bellow function in 10ms task to calculate checkmate of ROM by performing summation of entire ROM. after compliting summation adding 2's compliment of Result in sum so i will get it zero (0).

bool Calculate_Checksum16_Slice(const uint16_t __far* data, uint32_t size, uint32_t* index, uint16_t* sum)

{

   bool checksum_complete;

  

   /* If about to sum the first value in data, clear the sum. */

   if (0 == *index)

   {

      *sum = 0;

   }

  

   /* If haven't reached the end of data, add the next word to the sum. */

   if (*index < size)

   {

      *sum += *(uint16_t __far*)(uint32_t)(data + *index); /* Equivalent to data[index]. */

      *index += 1 ;

      checksum_complete = false;

   }

   else

   {

      *index = 0;

      checksum_complete = true;

   

      *sum = (~(*sum) + 1) + *sum;

   }

   return checksum_complete;

}

Thanks & Regards,

Charudatta

0 Kudos

359 Views
trytohelp
NXP Employee
NXP Employee

Hi Charudatta,

If I'm right this is duplicated with s12z ROM checksum

Did you used the info provided to the Re: Issue while calculating the CRC for logical address block in Flash to create your application ?

Do you refer to an example provided ?

Pascal

0 Kudos

359 Views
trytohelp
NXP Employee
NXP Employee

Dear Charudatta,

What is the system you're using for the Checksum ?

Can you please share the project or an example  ?

Have a great day,
Pascal
NXP Technical Support

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos