CodeWarrior 8- & 16-bit tools: BootLoader in Last Page of flash - HCS08GB60

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

CodeWarrior 8- & 16-bit tools: BootLoader in Last Page of flash - HCS08GB60

1,861 Views
marc_paquette
Contributor V
To help you find solutions to problems that have already been solved, we have posted this message. It contains an entire topic ported from a separate forum. The original message and all replies are in this single message.
 
Posted: Nov 08, 2005 - 03:54 PM   
 
I am having trouble putting code into the last page of flash (0xFE00 to 0xFFFF). I am working on a boot loader that would have the page write protected. I tried:
 
#pragma CODE_SEG BOOT_LOADER
void BootStuff()
{
TPM1SC_TOF = 0;
 
}
#pragma CODE_SEG DEFAULT
 
and then in the linker.prm file:
 
SEGMENTS
Z_RAM = READ_WRITE 0x0080 TO 0x00FF;
RAM = READ_WRITE 0x0100 TO 0x103F;
STK_AREA = READ_WRITE 0x1040 TO 0x107F;
ROM1 = READ_ONLY 0x1080 TO 0x17FF;
ROM2 = READ_ONLY 0x182C TO 0xFDFF;
BOOT_LOADER = READ_ONLY 0xFE00 TO 0xFEFF;
BOARD_PARAMS = READ_ONLY 0xFFB0 TO 0xFFB7;
END
PLACEMENT
DEFAULT_ROM INTO ROM1,ROM2,BOARD_PARAMS, BOOT_LOADER;
DEFAULT_RAM INTO RAM;
SSTACK INTO STK_AREA;
_DATA_ZEROPAGE, MY_ZEROPAGE INTO Z_RAM;
END
 
But it does not seem to put it into the proper flash location. Any suggestions. I am also trying to put the Securtiy key into flash (0xFFB0 to 0xFFB7) using somewhat the same technique. Any help on Segments and Placements would be appreciated.
thanks,
jon
 
 
Posted: Nov 09, 2005 - 04:00 PM   
 
OK, I figured this out with the help of AN2295 and AN2295SW. These were a great help and cover a lot of the details I was curious about.

 
Labels (1)
Tags (1)
0 Kudos
0 Replies