AnsweredAssumed Answered

M52259demomcu.  Program hangs when define 64k RAM.

Question asked by Rafa Jimenez on Sep 23, 2009
Latest reply on Sep 28, 2009 by Paolo Alcantara Cadillo

Dear all,

 

I'm working with 52259demomcu and I'm using codewarrior v7.1 SE. When I create the lcf file with the whole 64k RAM area the program doesn't work fine. I think my lcf is according with the address space for this micro, could anyone verify it. The most relevant part of lcf is here:


# Memory ranges

MEMORY {
   vectorsrom  (RX)  : ORIGIN = 0x00000000, LENGTH = 0x00000400
   cfmprotrom  (RX)  : ORIGIN = 0x00000400, LENGTH = 0x00000020 
   bootcode    (RX)  : ORIGIN = 0x00000420, LENGTH = 0x00003BE0
#End reserved 16Kb boot area code.
   flashcode   (RX)  : ORIGIN = 0x00004010, LENGTH = 0x0007BFF0
   vectorram   (RWX) : ORIGIN = 0x20000000, LENGTH = 0x00000400
#   userram     (RWX) : ORIGIN = 0x20000400, LENGTH = 0x00005A00
   userram     (RWX) : ORIGIN = 0x20000400, LENGTH = 0x0000FC00
   ipsbar    (RWX) : ORIGIN = 0x40000000, LENGTH = 0x0
}

....(here sections are defined).....

___VECTOR_RAM = 0x20000000;

___FLASH  = ADDR(.vectorsrom);
___FLASH_SIZE = 0x00080000;
___SRAM   = 0x20000400;
# ___SRAM_SIZE = 0x00005A00;
___SRAM_SIZE = 0x0000FC00;

___IPSBAR  = ADDR(.ipsbar);

    ___SP_SIZE      = 0x0800;
___HEAP_START = .;
___HEAP_END  = ___SRAM + ___SRAM_SIZE - ___SP_SIZE;
___SP_END  = ___HEAP_END;
___SP_INIT  = ___SP_END + ___SP_SIZE;

   ___heap_addr  = ___HEAP_START;
___heap_size  = ___HEAP_END - ___HEAP_START ;


    ___SP_AFTER_RESET = ___SRAM + ___SRAM_SIZE - 4;
__SP_INIT   = ___SP_INIT;

_romp_at = ___ROM_AT + SIZEOF(.data);
.romp : AT(_romp_at)
{
  __S_romp = _romp_at;
  WRITEW(___ROM_AT);
  WRITEW(ADDR(.data));
  WRITEW(SIZEOF(.data));
  WRITEW(0);
  WRITEW(0);
  WRITEW(0);
}

 

The debugger shows  variables getting a different value than  I set it for them...
When I define a little RAM space the code work fine.
I don't know what is going on, any idea would be grateful.

Thanks in advance.

Outcomes