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

How to confine code addresses

Hi all,
I'm currently working on a project which requires that part of the code is located below address 0x1000 and freezed, while other must be above 0x1000 and can be modified. Mixing up is not allowed. I used BL51 options below:

"BL51 X.obj code(?pr?*?upper_1k(1000h))"
. Most of the time it works but sometimes it just doesn't, especially when using lots of XBYTE[]. Codes just escape into the lower 1kByte memory and mess up everything.
Are there other options that I can use? I've been struggling on this for several days.

Parents
  • Having both "frozen" and changing code in the same uVision project will generally not work, especially not with the more aggressive optimization options like linker code packing and common entry/exit code optimization.

    IMHO you should compile the frozen parts as a separate project instead, and the changeable ones as another one. You'll want to extract those functions in the frozen part that the modifiable part is allowed to access, and tell the modifiable part's build about their addresses --- this can be done by parsing the map file and generating 'set' statements from it.

Reply
  • Having both "frozen" and changing code in the same uVision project will generally not work, especially not with the more aggressive optimization options like linker code packing and common entry/exit code optimization.

    IMHO you should compile the frozen parts as a separate project instead, and the changeable ones as another one. You'll want to extract those functions in the frozen part that the modifiable part is allowed to access, and tell the modifiable part's build about their addresses --- this can be done by parsing the map file and generating 'set' statements from it.

Children
No data