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

accesses to a structure in code space causes error

I have a large structure I wish to locate in code space. The problem appears to be the linker intreprets the accesses to this structure as a subroutine call. I get the error "Too many recursive calls to segment...".
The structure works fine in XDATA. It also worked fine in code space until there were enough routines accessing the structure.

Anyone have a clue?

Parents Reply Children
  • "I really want this structure in code space ... I don't want take any chances that it may get corrupted."

    So the true requirement here is to have it read-only, yes?
    Placing it in code space is merely a means to that end?

    Is your memory architecture such that you can map (some of) a ROM into XDATA space?
    If so, you could look at XCONST as an alternative solution to your requirement.

  • You are correct. Read only is the goal.
    Can't do any re-mapping. I am using a Cygnal 8051 type processor. The flash and RAM are internal and fixed.

    By the way, I have looked high and low for a way to turn off the recursion errors. I have not found it yet.

    Thanks again.