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

USERCLASS issue

Hi all

I'm hoping someone can help me locate my code the way I need to. I want to put a portion of my code in a specific address range, and exclude all other code from this region. Following http://www.keil.com/support/docs/2670.htm I included this in the .c source file:

#pragma userclass(code=ldr)

and when linking I specify

CLASSES(CODE_LDR(C:80h-C:1DFFh),CODE(C:1E00h-C:7FFFh))

I thought this would do the trick, but now I get

*** WARNING L47: NO SEGMENTS ASSIGNED TO USER CLASS CLASS: CODE_LDR

when linking. Looking at the map file confirms that no code was assigned to the address space C:80h-C:1DFFh.

I am using CX51 and LX51.

What am I overlooking? Any help would be sincerely appreciated.

Parents
  • Unless you are writing your code in assembler, I think you should consider using two targets. One to generate the loader and one for the application.

    If you write in C and just relocate different parts of the code, you get the problem that you either have to place all RTL functions with the loader, or your loader may require init functions or self call (possibly even indirect helper functions called by the compiler) code that isn't in the loader region.

Reply
  • Unless you are writing your code in assembler, I think you should consider using two targets. One to generate the loader and one for the application.

    If you write in C and just relocate different parts of the code, you get the problem that you either have to place all RTL functions with the loader, or your loader may require init functions or self call (possibly even indirect helper functions called by the compiler) code that isn't in the loader region.

Children