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

C Code relocated at 3ffdh ???

Hi All !!!

I'm using the evaluation version of Keil with uVision 2. I tried a simple program in C, it initializes the IO port P0 with a fixed value and then keeps rotating it indefinitel on the port. The program works perfectly fine in simulator, but the moment I fuse it into the target, just nothing seems to happen, no LEDs blink on, no signal whatsoever on the P0 pins of IC. There's no problem with the hardware, I know it for sure. My guess is that there's something wrong with the symbol relocation stuff in perhaps the linker phase. Following is an excerpt from the map file generated, which clearly shows a GAP at the address 0003h and 3ffch. The code seems to have been located at 3ffdh. Should the target execute the code ??? Is it a good behaviour on part of whoever relocates the symbols and code ??? And is this indeed the problem with nothing happening with my target ??? If this is the case, lastly, then has anybody got the clue of getting around with this all ???

Thx in Anticipation ...

FAISAL ...

****************************************
** Link Map ***
****************************************

LINK MAP OF MODULE: shift (SHIFT)


TYPE BASE LENGTH RELOCATION SEGMENT NAME
-----------------------------------------------------

* * * * * * * D A T A M E M O R Y * * * * * * *
REG 0000H 0008H ABSOLUTE "REG BANK 0"
IDATA 0008H 0001H UNIT ?STACK

* * * * * * * C O D E M E M O R Y * * * * * * *
CODE 0000H 0003H ABSOLUTE
0003H 3FFDH *** GAP ***
CODE 4000H 0019H UNIT ?PR?MAIN?SHIFT
CODE 4019H 000CH UNIT ?C_C51STARTUP

****************************************
** Link Map ***
****************************************

  • Hi,

    there is no error but you are using the evaluation version and there are some restrictions.
    One of the restrictions are: "You may not place relocatable segments below address 0x4000".
    I think you must use the full version.

    I hope that helps

    Andreas Haack

  • In the code generated by the Evaluation Tools...

    * * * * * * * C O D E M E M O R Y * * * * * * *
    CODE 0000H 0003H ABSOLUTE 
    0003H 3FFDH *** GAP ***
    CODE 4000H 0019H UNIT ?PR?MAIN?SHIFT
    CODE 4019H 000CH UNIT ?C_C51STARTUP
    

    0000h is the RESET vector. The code here is an LJMP to the beginning of the startup code.

    4000h is where your program starts. This is one of the limitations of the evaluation tools.


    Answers to a few questions may help us diagnose this problem:

    1. How are you trying to run the program on your target hardware?

    2. Are you programming an EPROM or are you downloading to RAM?

    3. Does your target have RAM at that address?

    4. P0 is also used as A0-A7 and D0-D7. Could it be a problem that you are toggling those port pins AND that they are used to access external memory at the same time?

    Keil Support