I need to use a 9S08QE128 in production and write software for this device. We have the parts in stock. My application uses arrays that surpass the boundaries of a page segment. But the complete program ( code + data) takes less than 64K of FLASH. The upper half of the available 128 K FLASH is not needed.
I have read the LAP dictionary application note, compiled the application and ran it. I understand the method used but it does no fit my needs and it is complicated in my case. I have read the previous post, but as I am new to this paged memory processor, the linker pragmas and commands still confuse me.
In my case, I need to instruct the compiler and linker to see the memory map as just a plain 64K memory space and allow the tool to place code and data across this space, ignoring the paging mechanism. I don't know if this is really possible.
My guess is: if the paged memory PPAGE2 is set at the Paging Window out of reset, the complete memory address range between CPU memory 0x2080 and 0xFFFF could be addressed naturally.
So I changed the .PRM file to look like this:
/* unbanked FLASH ROM */
ROM = READ_ONLY 0x2080 TO 0xFFAD; /* almost full 64K map */
//ROM = READ_ONLY 0x2080 TO 0x7FFF;
//ROM1 = READ_ONLY 0xC000 TO 0xFFAD;
The following declaration compiles and links with no errors:
/* example of array declaration */
static const char myarray[50500] = { 10,20,30,40,50,60,70,80,90,100 };
I can see the array correctly allocated in FLASH as listed in the .MAP file
****************************************************************************
SECTION-ALLOCATION SECTION
Section Name Size Type From To Segment
----------------------------------------------------------------------------
.data 4 R/W 0x100 0x103 RAM
.init 138 R 0x2080 0x2109 ROM
.startData 18 R 0x210A 0x211B ROM
.rodata 50500 R 0x211C 0xE65F ROM
.text 499 R 0xE660 0xE852 ROM
.copy 10 R 0xE853 0xE85C ROM
.stack 896 N/I 0x1D00 0x207F MY_STK
----------------------------------------------------------------------------
Is this a good procedure ? Is there some other better way ?
I will very much appreciate your valuable opinions.
Kind regards