This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ERROR L121: IMPROPER FIXUP SEGMENT: ABSOLUTE OFFSET: 0023H

I got this error when linking with uVision version 1.24 (using <2Kb memory model):
ERROR L121: IMPROPER FIXUP
MODULE: SIO.obj (SIO)
SEGMENT: ABSOLUTE
OFFSET: 0023H


And I fixed the error by disabling "Enable variable overlaying" option in "Linking" tab of "BL51 Code Banking Linker" (Options menu).

Could anybody tell me where is this option in the latest version (uVision2 2.30), to fix the same error I have found when upgrading to the new IDE version?

Thanks.

  • I don't think this option exists on its own any more. If you select optimisation level 2 or higher in the 'C51' tab of the 'Options for target' dialog then DATA space overlaying will be enabled.

    I don't know why this should fix your 'Improper fixup' error though.

    Stefan

  • The improper fixup error occurs because his code is using more than 256 bytes of data. Overlaying data space reduces data space usage and corrects the bug.

    I have seen this error pop up when a function is no longer called but is still in the code. The compiler creates a pointer in data space to the uncalled function, I think to support bank switching.

    If you are using all or most of your data (or idata) space, then don't allow any uncalled functions to remain in your code. This happens to me mostly while debugging code when I temporarily comment out the only place a function is being call from.

    Phil

  • You may actually want to fix the problem than simply rely on a side-effect of a compile switch.

    The error message you receive:

    ERROR L121: IMPROPER FIXUP
    MODULE: SIO.obj (SIO)
    SEGMENT: ABSOLUTE
    OFFSET: 0023H

    Tells me that this is either an assembler routine or that it is the vector for an interrupt service routine (because the segment is ABSOLUTE).

    The error improper fixup indicates that the target address (for an ajmp) or for a relative offset is too far away.

    The offset of 0023H tells me that the problem happens at the interrupt vector location. The only thing that would cause this problem there is an AJMP to an ISR that is too far away. C51 inserts AJMP instructions in the interrupt vector only in ROM(SMALL). C51 inserts LJMPs in ROM(COMPACT) and ROM(LARGE).

    So, if you wrote in assembly, I'd change the AJMP at addtess 23h to an LJMP.

    It you are using C, this problem should not occur.

    If none of my advice helps, you may actually want to contact technical support for assistance with this problem.

    Jon