CW 6.1 evaluation linker code size limitation

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

CW 6.1 evaluation linker code size limitation

Jump to solution
2,515 Views
Kerem
Contributor II
Hi,
 
Is there a code size limitation on CW 6.1 evaluation version for RS08KA. I have developed a small C application in C and had it compiled successfully. But the linker issues a fixup error message for some functions. When commented, the code size reduces and linker completes with no errors.
 
Thanks,
 
Kerem
Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
747 Views
Kerem
Contributor II
Hi Daniel,
 
I found the reason. Like you said it was not about code size limitation. hidef.h needed to be included before peripheral definitions.
 
Thanks,
 
Kerem

View solution in original post

0 Kudos
Reply
6 Replies
747 Views
CompilerGuru
NXP Employee
NXP Employee
A fixup overflow has nothing to do with the C code size limitation.
If you get such an error you are probably doing something which just should not work....

The most common bug for the HC08 which causes a fixup overflow is to declare a variable to be in the zero page, but then not actually allocating it in the first 256 bytes of the memory.

Another one is to map .text into multiple segments, that can cause a fixup overflow but there is a compiler option
(I think the option is mentioned in the default prm, just done remember it for sure) to disable the short branch optimization (that's the one which may cause a fixup overflow if he code is distributed into multiple segments).

Daniel
0 Kudos
Reply
747 Views
CompilerGuru
NXP Employee
NXP Employee
Ups, the OP was for the RS08 and not for the HC08. Anyway, it still has nothing to do with the license. I think the code limits are smaller for the RS08, but non the less, fixup overflows are only caused by how the code/variables are allocated and not by how much code there is.
The RS08 also has some special memory areas, not sure if it has a short branch optimization, but for a RS08 I think it is less common to distribute the code into multiple segments anyway.
The simplest thing would be probably when you copy paste the linker error here, the message window does support CTRL-C.

Daniel
0 Kudos
Reply
747 Views
Kerem
Contributor II
It appears not related to variables. It is something about code. Here is the message
 
Link Error   : L1907: Fixup overflow in set2sqr, to _xxPSID17 type 1, at offset 0x1D

Link Error   : Link failed
 
Compile process is ok. I left the optimization setting as default. Linker file contains contiguous flash & ram memory. Below is the link file contents as well.
 
First time using this suite, so not quite familiar with the options. My parts is R08KA08 which has 8k flash and some 200 byte ram.
 
Kerem
 
NAMES END /* CodeWarrior will pass all the needed files to the linker by command line. But here you may add your own files too. */
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   0x0030 TO 0x00BF;
    RESERVED_RAM             =  NO_INIT      0x0000 TO 0x0004;
    ROM                      =  READ_ONLY    0x2000 TO 0x3FF7;
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, TINY_RAM;
    DEFAULT_ROM              INTO ROM;
END

STACKSIZE 0x00 /* no stack for RS08 */
VECTOR 0 _Startup /* Reset vector: this is the default entry point for an application. */
0 Kudos
Reply
747 Views
CompilerGuru
NXP Employee
NXP Employee
What is set2sqr? Is this a C or an assembly function (or even a constant?)
The simplest way is to open the source file it is defined in and use the disassemble contect menu.
That is at offset 0x1D?

Daniel
0 Kudos
Reply
748 Views
Kerem
Contributor II
Hi Daniel,
 
I found the reason. Like you said it was not about code size limitation. hidef.h needed to be included before peripheral definitions.
 
Thanks,
 
Kerem
0 Kudos
Reply
747 Views
Kerem
Contributor II
set2sqr is a C function like the rest of the code. I'm trying to find the source of the error. If I remove set2sqr then the linker issues same message for main. Then after gradually deleting the code lines of main, at some point (I presume my evaluation version has a limitation) linker completes with no error.
 
CW 6.1 does not mention RS08KA8 support (8K flash part). Instead, I can only see RS08KA2 in the device selection menus. And that part has 2K flash. Presumably the linker allows half of RS08KA2's flash capacity of 1024 bytes.
 
Right now I'm trying to generate a header file which includes peripheral definitions for KA8 part. I'll be able to investigate more in an hour.
 
Kerem
0 Kudos
Reply