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

TROUBLE SPLITTING CODE FOR C251

I'm using the Keil IDE programming in C. I want to be able to split my code between micro internal and external memory.
Some functions on chip, some off. I tried using the #pragma (I get a choice of SMALL,COMPACT,LARGE)but when I link the code it says I have incompatible memory models.
What can I do?

Parents
  • Put external functions in a separate module and use new class for it:

    #pragma userclass (ucode = extf)

    now all functions from this module goes to the class "extf".

    All you have to do is to tell linker to put this class to external address starting at 0x8000 in external code memory (region 0xFF):

    ECODE_EXTF (0x8000-0xFFFF)[]

Reply
  • Put external functions in a separate module and use new class for it:

    #pragma userclass (ucode = extf)

    now all functions from this module goes to the class "extf".

    All you have to do is to tell linker to put this class to external address starting at 0x8000 in external code memory (region 0xFF):

    ECODE_EXTF (0x8000-0xFFFF)[]

Children
No data