HCS12 ROM Checksum, CW 3.1, Banked ROM PRM File HOW?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

HCS12 ROM Checksum, CW 3.1, Banked ROM PRM File HOW?

ソリューションへジャンプ
2,365件の閲覧回数
YeOldeBDM
Contributor III
I would like to add checksum protection to my HCS12 application. It runs in a 128K (A128). I am using CW3.1.
 
There are  supplied examples on how to use the linker's .PRM file to have the linker calculate and insert a checksum. Unfortunately, none of the PRM have a banked rom placement scheme.
 
Can some kind person 1)post a PRM file using the checksum facility to show usage with banked rom?
2) post an example checksum calculation to compute the actual checksum when there is banked rom?
 
I see that ADAM had some problems, and did not get an answer.
 
My prm file is:
 
NAMES
END
SEGMENTS   
   // remapped memory
   EEPROM_AREA = READ_WRITE   0x0800 TO 0x0FFF;       
   RAM = READ_WRITE 0x2000 TO 0x3FFF;
   /* unbanked FLASH ROM */
   ROM_4000 = READ_ONLY  0x4000 TO 0x7FFF;
   ROM_C000 = READ_ONLY  0xC000 TO 0xFEFF;
   /* banked FLASH ROM */
   PAGE_38 = READ_ONLY  0x388000 TO 0x38BFFF;
   PAGE_39 = READ_ONLY  0x398000 TO 0x39BFFF;
   PAGE_3A = READ_ONLY  0x3A8000 TO 0x3ABFFF;
   PAGE_3B = READ_ONLY  0x3B8000 TO 0x3BBFFF;
   PAGE_3C = READ_ONLY  0x3C8000 TO 0x3CBFFF;
   PAGE_3D = READ_ONLY  0x3D8000 TO 0x3DBFFF;
/*    PAGE_3E = READ_ONLY  0x3E8000 TO 0x3EBFFF; not used: equivalent to ROM_4000 */
/*    PAGE_3F = READ_ONLY  0x3F8000 TO 0x3FBFFF; not used: equivalent to ROM_C000 */
END
PLACEMENT
   _PRESTART,                   /* Used in HIWARE format: jump to _Startup at the code start */
   STARTUP,                     /* startup data structures */
   ROM_VAR,                     /* constant variables */
   STRINGS,                     /* string literals */
   VIRTUAL_TABLE_SEGMENT,       /* C++ virtual table segment */
   NON_BANKED,                  /* runtime routines which must not be banked */
   COPY                         /* copy down information: how to initialize variables */
                                /* in case you want to use ROM_4000 here as well, make sure
                                   that all files (incl. library files) are compiled with the
                                   option: -OnB=b */
                                INTO  ROM_C000/*, ROM_4000*/;
   DEFAULT_ROM                  INTO  PAGE_38,PAGE_39,PAGE_3A,PAGE_3B,PAGE_3C,PAGE_3D;
   DEFAULT_RAM                  INTO  RAM;
   EEPROM                 INTO  EEPROM_AREA;
END
STACKSIZE 0x200
VECTOR 0 _Startup /* reset vector: this is the default entry point for a C/C++ application. */
VECTOR 1 _Startup /* CMR reset vector */
VECTOR 2 _Startup /* COP reset vector */
 
 
ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
742件の閲覧回数
CompilerGuru
NXP Employee
NXP Employee
The prm file syntax is just the same for checksums of banked and non banked areas,
well for banked areas you just use banked addresses.
What's a bit more dificult is to compute the checksum at runtime, as to access the banked code you either have to use far pointer to accesse the banked code (which really is slow), or you have set PPAGE manually and place all the code and constant in a non banked are.
The second solution is much faster, that's how I would do it.

Daniel

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
743件の閲覧回数
CompilerGuru
NXP Employee
NXP Employee
The prm file syntax is just the same for checksums of banked and non banked areas,
well for banked areas you just use banked addresses.
What's a bit more dificult is to compute the checksum at runtime, as to access the banked code you either have to use far pointer to accesse the banked code (which really is slow), or you have set PPAGE manually and place all the code and constant in a non banked are.
The second solution is much faster, that's how I would do it.

Daniel
0 件の賞賛
返信