AnsweredAssumed Answered

Encapsulate the generated image into a header and trailer

Question asked by Simon Chamlian on Jun 14, 2011
Latest reply on Jun 15, 2011 by David E Seymour

Hi,

 

I am trying to encapsulate the generated image into a header and trailer signature in order for the Boot Loader to recognize a valid image.

 

Therefore, in the BSP library, in vectors.cw, I added:

 

; CFM Flash Configuration Field…..// HeaderHEAD_SIG: .long   0xABCDEF12  // 4 bytes 0x418HEAD_LG1: .long   0x99999999 // 4 bytes 0x41C
HEAD_LG2: .long   0xAAAAAAAA // 4 bytes 0x420HEAD_LG3: .long   0xBBBBBBBB // 4 bytes 0x424HEAD_LG4: .long   0xCCCCCCCC // 4 bytes 0x428HEAD_LG5: .long   0xDDDDAAAA // 4 bytes 0x42C// 256 x 4 = 1024 (0x400) + 24 + 24 = 1064 = 0x430// " __boot" is at offset 0x430

 

This works fine as I can see my header in the s19 file.

 

The problem is the trailer. In one of the examples, web_hvac_m52259evb.mcp, I added a trailer.asm file:

_DEF_TRAILER_SIG    .set 0x1234ABCF    .global _Trail_Sig    .global _Tspare1    .global _Tspare2    .data   _Trail_Sig: .long _DEF_TRAILER_SIG  ; 2 word trailer signature_Tspare1:   .long 0_Tspare2:   .long 0 .end

 

In the linker file I added:

FORCE_ACTIVE {_Trail_Sig, _Tspare1, _Tspare2}

  Now, where in the linker file (extmram_usb.lcf) I shoud add        trailer.ams (.data)  in order to have the trailer signature at the very end of the image (s19  file)?

 

Thanks,

S.

 

 

 

 

 

Outcomes