RS08LE4 Fixup Error CW 6.2with LE4 Patch

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

RS08LE4 Fixup Error CW 6.2with LE4 Patch

Jump to solution
4,786 Views
UtopiaTim
Contributor III
Hi Folks,
 
Been writing code for the RS08 LE4, and testing as I go.
 
All of a sudden, I get the following error:
 
Link Error   : L1907: Fixup overflow in main, to state type 1, at offset 0xA2

Link Error   : L1907: Fixup overflow in main, to state type 1, at offset 0xE0

If I start removing code, the error goes away.
 
It's as if I'm out of code space, but looking at the map, I've still got a couple
of K to go.  Also in Ram, I've only used about 30 bytes.
 
Figured I'd ask the experts!

Thanks,
Tim
 


Message Edited by UtopiaTim on 2008-12-19 03:25 PM
Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
2,093 Views
UtopiaTim
Contributor III
Hi Daniel,
 
Thanks,  I found the problem, looks like some other code I had incorporated for
the LCD routines was eating up too much of the RAM space!  They had some
pretty large arrays.
 
Thanks again,
 
Tim
 
 

View solution in original post

0 Kudos
Reply
7 Replies
2,093 Views
CompilerGuru
NXP Employee
NXP Employee
How does the prm look like?
Do you distribute the content of a single code section into multiple segments?
If so, compile with -OnBRA as this optimization expects to order functions are compiled to be maintained, which is not the case when using multiple destination segments.
If this is not the case I would recommend to provide more information like the prm file, the definition of state and a disassembly listing of main.
What is at the offset mentioned in the error?

Daniel


0 Kudos
Reply
2,094 Views
UtopiaTim
Contributor III
Hi Daniel,
 
Thanks,  I found the problem, looks like some other code I had incorporated for
the LCD routines was eating up too much of the RAM space!  They had some
pretty large arrays.
 
Thanks again,
 
Tim
 
 
0 Kudos
Reply
2,093 Views
UtopiaTim
Contributor III
Daniel,
 
It appears that whenever RAM1 is selected by the compiler, I get the following message:
 
Link Error   : L1907: Fixup overflow in main, to test2 type 1, at offset 0x19
Link Error   : L1907: Fixup overflow in main, to test2 type 1, at offset 0x1C
Link Error   : L1907: Fixup overflow in main, to test3 type 1, at offset 0x1E
Link Error   : L1907: Fixup overflow in main, to test3 type 1, at offset 0x21
Link Error   : L1907: Fixup overflow in main, to test4 type 1, at offset 0x23
Link Error   : L1907: Fixup overflow in main, to test4 type 1, at offset 0x26
Link Error   : Link failed
 
Here's what I see in the .MAP file:
 
     test                 BB       2       2       2   .common    
     test1                BD       2       2       2   .common    
     test2                100      2       2       0   RAM1_104   
     test3                102      2       2       0   RAM1_104   
     test4                104      2       2       0   RAM1_104   
MODULE:                 -- RTSRS08.C.o (ansii.lib) --
 
test - test4 are unsigned ints.  Looks like when it tries to use RAM1, something gets
messed up.
 
Below is the .PRM file.

Thanks,
 
Tim
 
SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */
    TINY_RAM                 =  READ_WRITE   0x0005 TO 0x000D;
    RAM                      =  READ_WRITE   0x0050 TO 0x00BF;
    RAM1                     =  READ_WRITE   0x0100 TO 0x017F;
    RESERVED_RAM             =  NO_INIT      0x0000 TO 0x0004;
    ROM                      =  READ_ONLY    0x3000 TO 0x3FF9;
END
PLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */
    RESERVED                 INTO RESERVED_RAM;
    TINY_RAM_VARS            INTO TINY_RAM;
    DIRECT_RAM_VARS          INTO RAM, TINY_RAM;
    DEFAULT_RAM              INTO RAM, RAM1, TINY_RAM;
    DEFAULT_ROM              INTO ROM;
END

 

 

 


0 Kudos
Reply
2,093 Views
CompilerGuru
NXP Employee
NXP Employee
Hmm.
Well I did not look recently into the RS08s, I was not aware that there is a RS08 with more than 256 bytes of RAM.
The compiler has to make a different access for a variable allocated >= 0x100 (he has to set PAGE_SEL and access in 0xC0..0xFF instead) so it makes sense that RAM1 cannot be "just" used once the RAM segment is full.
As I'm currently away from the office (and away from any PC with CW 6.X installed) I cannot really help.
I would suggest to create a separate placement for the RAM1 segment and only explicitly place variables in that section which are accessed through the page window at 0xC0..0xFF (while the PAGE_SEL is set accordingly).

Daniel
0 Kudos
Reply
2,093 Views
UtopiaTim
Contributor III
Hi Daniel,
 
The total is 238 bytes, but obviously not all on the direct page.
 
I would have thought that the compiler would automatically do the
page selection process, depending if it was using the upper RAM1.
 
I've worked through code in the RS08 compiled by CW, and they
routinely flip through pages when accessing registers, so I figured
they would have done so for the other Ram segment as well.
 
Right now, I am not doing any work with the LCD, so I have all of
that LCDs RAM array to use.  Just working on the main chunk of code.
 
I can't say that I have been frugal with the existing RAM, so will probably
go back and allocate bits for flags instead of entire bytes!

But it would be nice to know how to use the RAM1 segment.
 
Thanks,

Tim
0 Kudos
Reply
2,093 Views
ProcessorExpert
Senior Contributor III
Regarding to the problem with access to the "RAM1" memory area in Processor Expert. Here are steps to workaround the problem:

Small memory model:

1. Enable the memory area  "RAM1" in the Build options tab in the CPU bean and start the code generation through the menu command "Generate Code '*.mcp'" from Processor Expert menu.
2. Set the "Generate PRM file" property in Build options tab to "no".
3. Open the *.prm file through the menu command "View Linker File" from the pop-up menu of the CPU bean.
4. Delete "RAM1" from "DEFAULT_RAM" placement.
5. Create new placement for RAM1. For example add the following row into PLACEMENT in *.prm file: mySeG            INTO RAM1;
6. Save the *.prm file
7. If you want to access data in RAM1 (outside of 0x00-0xFF) you need to have FAR definition as follows:
 
 #pragma DATA_SEG __FAR_SEG mySeg
 byte test;
 #pragma DATA_SEG DEFAUL

Banked memory model:

1. Click on the "Standart Setting" button in the "Project panel" window.
2. Change the command line argument "-Ms" to "-Mb" in "Compiler for RS08" option.
3. Change the "ansii.lib" to the "ansibi.lib" on the File tab on the Project panel window.
4. Click on the "Click to set default >" in the "Set memory areas as default" property.
5. Start the code generation through the menu command "Generate Code '*.mcp'" from Processor Expert menu.

best regards
Vojtech Filip
Processor Expert Support Team
UNIS




Message Edited by ProcessorExpert on 2009-01-09 01:32 PM
0 Kudos
Reply
2,093 Views
llrrn
Contributor I
This is a example code that show how to use LE4 with Processor Expert.
 
I´m using a 3 1/2 digits LCD.
 
Freescale didn´t have any example using LE4 and Processor Expert.
 
This code is working very well.
 
0 Kudos
Reply