Need Help reviewing the LCF file

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Need Help reviewing the LCF file

Jump to solution
1,459 Views
tkvenki
Contributor III

 Hi All,

 

I'm using CW-6.4 Build 6.

My controller is MCF5485.

Recently I was successful with making a small LED blink program work standalone on my target board.

(Bootloading was OK!!) ...

 

Now I have a problem when I have to burn my custom code.

I'm able to burn the S-rec file into Flash using the Flash programmer.

I also verified with the "Hardware DIag" , that the address 0xFE000000(The location of my code!)

has the S-record file....

 

But when I try to download the code, After downloading I get the error->

"COULD NOT SET PC TO ENTRY POINT"

 

I suspect my linker file, as other things seem to be OK.....

Please help me out with my linker file....

 

LCF FILE::

#/********************************************************************/
#/**************************FPRO3000-Linker***************************/
#/********************************************************************/


#/********************************************************************/
#/**************************MEMORY sections***************************/
#/********************************************************************/

MEMORY
{
 sdram    (RWX) : ORIGIN = 0x00000500, LENGTH = 0x02000000 
 mbar    (RWX) : ORIGIN = 0x10000000, LENGTH = 0x00040000
 boot_flash (RWX) : ORIGIN = 0xFE000000, LENGTH = 0x02000000
}

SECTIONS
{

#/********************************************************************/
#/****************************Definitions*****************************/
#/********************************************************************/


 .bootCode :
 {
  vectors.s (.text)
  *(.text)
  *(.rodata)
  .= ALIGN(0x8);
 } > boot_flash

  __end_of_text = .;

 ___DATA_ROM  = __end_of_text;
 ___CODE_ROM  = __end_of_text;
 ___CODE_RAM = ADDR(sdram);
 
 ___DATA_RAM  = ADDR(sdram);

 .sdram : AT(ADDR(.bootCode) + SIZEOF(.bootCode))
   
 {
  *(.exception)
  .= ALIGN(0x8);
  __exception_table_start__ = .;
  EXCEPTION
  __exception_table_end__ = .;
 
  ___sinit__ = .;
     STATICINIT

  __START_DATA = .;
  *(.data)


  __START_SDATA = .;
  *(.sdata)
  __END_DATA = .;
  ___DATA_END  = .; 

  __END_SDATA = .;

  . = ALIGN(0x8);

 
  __SDA_BASE = .;   
 
 } > sdram

 .bss:
 {
  ___BSS_START = .;
  
  __START_SBSS = .;

  *(.sbss)
  *(SCOMMON)
  __END_SBSS = .;

  __START_BSS = .;
  *(.bss)
  *(COMMON)
  __END_BSS = .;
  ___BSS_END   = .;
 
  
  ___HEAP_START = .;
  ___heap_addr  = ___HEAP_START;
  ___heap_size = 0x02000000;

  ___HEAP_END  = ___HEAP_START + ___heap_size;
  ___SP_END  = ___HEAP_END;
  ___SP_INIT  = ___SP_END + (10*1024);
  __SP_INIT  = ___SP_INIT;
 
  . = ALIGN(0x8); 
 
 } >>sdram




 ___MBAR    = ADDR(.mbar);
 __MBAR    = ___MBAR;

 ___SDRAM   = ADDR(.sdram);
 ___SDRAM_SIZE  = 0x08000000;

 ___BOOT_FLASH  = ADDR(.bootCode);
 ___BOOT_FLASH_SIZE = 0x00200000;

 ___FLASH   = ___BOOT_FLASH;
 

   _romp_at = ___DATA_ROM + SIZEOF(.sdram);
   .romp : AT(_romp_at)
   {
       __S_romp = _romp_at;
       WRITEW(___CODE_ROM);      # FLASH CODE Address
       WRITEW(___CODE_RAM);      # SDRAM CODE Address
       WRITEW(SIZEOF(.bootCode));# CODE  Size
       WRITEW(___DATA_ROM);      # FLASH Initialized DATA Address
       WRITEW(___DATA_RAM);      # SDRAM Initialized DATA Address
       WRITEW(SIZEOF(.sdram));   # DATA  Size
       WRITEW(0);                # NULL  Last Entry
       WRITEW(0);                # NULL  Last Entry
       WRITEW(0);                # NULL  Last Entry
   }
    ___free_mem  = ___heap_addr + ___heap_size;  # for threadx

}

 

 

 

 Please post your comments on the file....

Labels (1)
0 Kudos
1 Solution
434 Views
Arev
Contributor III

Hello,

In your LCF file, the S_romp structure initialization looks strange, the source and  destination address are the same for both CODE and DATA:

___DATA_ROM = ___CODE_ROM = __end_of_text;

___DATA_RAM = ___CODE_RAM = ADDR(sdram);

S_romp is used by the ROMtoRAM copy routine at startup

 

Check if your code uses the ROMtoRAM copy routine at startup.

 

I Hope this helps..

Bye

<< Freescale MCF5234/35 with CodeWarrior 6.4>>

View solution in original post

0 Kudos
2 Replies
435 Views
Arev
Contributor III

Hello,

In your LCF file, the S_romp structure initialization looks strange, the source and  destination address are the same for both CODE and DATA:

___DATA_ROM = ___CODE_ROM = __end_of_text;

___DATA_RAM = ___CODE_RAM = ADDR(sdram);

S_romp is used by the ROMtoRAM copy routine at startup

 

Check if your code uses the ROMtoRAM copy routine at startup.

 

I Hope this helps..

Bye

<< Freescale MCF5234/35 with CodeWarrior 6.4>>

0 Kudos
434 Views
CrasyCat
Specialist III

Hello

 

Did you define some breakpoints or watchppoints in your application? How many?

 

Here your application is loaded into ROM. So the debugger cannot use software breakpoint. It needs to use hardware breakpoints.

According to the message I assume there are not enough hardware breakpoints available on board to set a BP on main function (as specified in the "Debugger Settings" panel).

 

CrasyCat

0 Kudos