EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Excluding a segment from checksum (IAR)

Started by Stephen Bashford May 13, 2004
I have a segment of code memory that I wish to exclude from the IAR Linker
checksum calculation.

We wish to have a code checksum for the whole of the memory except a single
segment that contains field programmable data.

Does anybody know if this possible?

TIA

	Stephen


Beginning Microcontrollers with the MSP430

 --- Stephen Bashford <sbashford@sbas...>
wrote: > I have a segment of code memory that I wish
to
> exclude from the IAR Linker
> checksum calculation.
> 
> We wish to have a code checksum for the whole of the
> memory except a single
> segment that contains field programmable data.
> 
> Does anybody know if this possible?
> 
> TIA
> 
> 	Stephen

I have repeatedly asked IAR support to put this
facility into their tools but without any success so
far.

Ian


	
	
		
____________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html

--- In msp430@msp4..., "Stephen Bashford" <sbashford@m...> 
wrote:
> I have a segment of code memory that I wish to exclude from the IAR 
Linker
> checksum calculation.
> 
> We wish to have a code checksum for the whole of the memory except 
a single
> segment that contains field programmable data.
> 
> Does anybody know if this possible?
> 
> TIA
> 
> 	Stephen
I use the INFO segment for storage of variable data (how large a data 
block do you need to exclude?). I also use the checksum/CRC from IAR. 
I play some tricks to avoid running the CRC on the memory between the 
end of code and the vectors. The CRC is placed just below the 
vectors. This works with IAR 2.20A. Here is the xcl file:

-D_STACK_SIZEP
-D_HEAP_SIZEP

// -------------------------------
// Define CPU
// -------------------------------

-cmsp430

// -------------------------------
// RAM memory
// -------------------------------

-Z(DATA)DATA16_I,DATA16_Z,DATA16_N,HEAP+_HEAP_SIZE00-0A00
-Z(DATA)CSTACK#0a00
-Z(DATA)CSTOREC0

// -------------------------------
//  Information memory (FLASH)
// -------------------------------

-Z(CODE)INFO00-10FF


// -------------------------------
// ROM memory (FLASH)
// -------------------------------

//  Code 

-Z(CODE)CSTART00-FFDF
-Z(CODE)CODE00-FFDF


// Constant data

-Z(CODE)DATA16_C,DATA16_ID,DIFUNCT,ENDOFMEMORY00-FFDD
-Z(CODE)CHECKSUMDE-FFDF

// Interrupt vectors

-Z(CODE)INTVECE0-FFFF

-J2,CRC16
// fill trick to avoid having to download a bunch of zeros
-H00
-hFFE0-FFE0


// -------------------------------
// End of File
// -------------------------------



--- In msp430@msp4..., "mjruley" <mjriley@a...> wrote:
> --- In msp430@msp4..., "Stephen
Bashford" <sbashford@m...> 
> wrote:
> > I have a segment of code memory that I wish to exclude from the 
IAR 
> Linker
> > checksum calculation.
> > 
> > We wish to have a code checksum for the whole of the memory 
except 
> a single
> > segment that contains field programmable data.
> > 
> > Does anybody know if this possible?
> > 
> > TIA
> > 
> > 	Stephen
> I use the INFO segment for storage of variable data (how large a 
data 
> block do you need to exclude?). I also use the
checksum/CRC from 
IAR. 
> I play some tricks to avoid running the CRC on the
memory between 
the 
> end of code and the vectors. The CRC is placed
just below the 
> vectors. This works with IAR 2.20A. Here is the xcl file:
> 
> -D_STACK_SIZEP
> -D_HEAP_SIZEP
> 
> // -----------------------------
--
> // Define CPU
> // -----------------------------
--
> 
> -cmsp430
> 
> // -----------------------------
--
> // RAM memory
> // -----------------------------
--
> 
> -Z(DATA)DATA16_I,DATA16_Z,DATA16_N,HEAP+_HEAP_SIZE00-0A00
> -Z(DATA)CSTACK#0a00
> -Z(DATA)CSTOREC0
> 
> // -----------------------------
--
> //  Information memory (FLASH)
> // -----------------------------
--
> 
> -Z(CODE)INFO00-10FF
> 
> 
> // -----------------------------
--
> // ROM memory (FLASH)
> // -----------------------------
--
> 
> //  Code 
> 
> -Z(CODE)CSTART00-FFDF
> -Z(CODE)CODE00-FFDF
> 
> 
> // Constant data
> 
> -Z(CODE)DATA16_C,DATA16_ID,DIFUNCT,ENDOFMEMORY00-FFDD
> -Z(CODE)CHECKSUMDE-FFDF
> 
> // Interrupt vectors
> 
> -Z(CODE)INTVECE0-FFFF
> 
> -J2,CRC16
> // fill trick to avoid having to download a bunch of zeros
> -H00
> -hFFE0-FFE0
> 
> 
> // -----------------------------
--
> // End of File
> // -----------------------------
--

I forgot about the ENDOFMEMORY allocation. Here it is:

; end of memory allocation
       PUBLIC ENDOFMEMORY_VECTOR
  RSEG ENDOFMEMORY(0)
ENDOFMEMORY_VECTOR
; The following is needed to get contiguous sections
  RSEG DATA16_C(1)
  DB 0
  DB 0
  RSEG DATA16_C(1)
  DB 0
  DB 0
	END



> I use the INFO segment for storage of variable data (how large a data 
> block do you need to exclude?). 
>
I'm afraid it's 368 bytes so too large for the info segment.

Thanks for the tricks, I'll see if they help me.

Ta

	Stephen



The 2024 Embedded Online Conference