Linker Command File for MCF52277 - M52277EVB

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

Linker Command File for MCF52277 - M52277EVB

2,691 Views
cchilds
Contributor I

Hi,

 

I am using the M52277EVB with CodeWarrior for ColdFire V7.0.  I have successfully created projects that run from the external SDRAM and external Flash, but not both together.

 

I need to create a .lcf that puts code into external Flash, and use SDRAM for Ram.  When creating a project through the CodeWarrior New Project Wizard, the only targets I get are EXTERNAL_FLASH, EXTERNAL_RAM and CONSOLE_EXTERNAL_RAM.  I need a target like "EXTERNAL_FLASH_AND_RAM".

 

I have tried to use a .lcf from a third-party project but I cannot easily use this as the initialisation code is very different.  For reference (and if it helps anyone else) the sample project is available here: http://www.segger.com/downloads_eval.html

 

I have eliminated any problems with the compiler environment, hardware and CF Flasher, as I can successfully build and flash the Segger example project.

 

I have attached the .lcf files that I would like to combine.  Has anyone done this already?

 

Any help would be greatly appreciated :smileyhappy:

 

Chris.

Labels (1)
0 Kudos
Reply
5 Replies

1,253 Views
cchilds
Contributor I

Hi,


Many thanks for replying.  I will try to clarify my problem.

 

My project works fine using the External Ram LCF, where everything (code and data) goes into the external SDRAM at 0x40000000.

 

Now that I have finished debugging, I want to place the code into External Flash, and use External SDRAM for runtime variables.  My Ram requirement is greater than the 128Kb on-chip.

 

I want the memory map to be as follows:

 

MEMORY {
   vectorrom   (RX)  : ORIGIN = 0x00000000, LENGTH = 0x00000400
   cfmprotrom  (RX)  : ORIGIN = 0x00000400, LENGTH = 0x00000020
   code        (RX)  : ORIGIN = 0x00000500, LENGTH = 0x0001FB00
   vectorram   (RWX) : ORIGIN = 0x80000000, LENGTH = 0x00000400
   userram     (RWX) : ORIGIN = 0x40000000, LENGTH = 0x04000000
}
 

 

This is identical to the CodeWarrior example stationery, except I have moved the 'userram' segment into External SDRAM at 0x4000000 (previously it was at 0x80000400 length 0x00007C00).

 

My project links with no errors, but after flashing with CF Flasher it doesn't run.  CF Flasher works with another example, so I am confident I am using it properly.

 

Thanks,


Chris.

0 Kudos
Reply

1,253 Views
cchilds
Contributor I

Hi,

 

I have resolved my problem with the linker file.  In case it helps anyone else, I have attached the .lcf that works for me.

 

The sample .lcf files supplied with the M52277EVB seem to be copied from a previous evaluation board, so were not exactly correct for the Flash and Ram on this particular board.

 

Cheers,


Chris.

0 Kudos
Reply

1,253 Views
J2MEJediMaster
Specialist I

If the .lcf file that came with the CodeWarrior project was in error, that needs to be reported. Click here to file a service request to do that. Include the corrected .lcf file that you posted here.

 

---Tom

 

0 Kudos
Reply

1,253 Views
cchilds
Contributor I

Service request submitted.

 

Thanks,


Chris.

0 Kudos
Reply

1,253 Views
CrasyCat
Specialist III

Hello

 

I am a little bit confuse here.

 

What do you want to do exactly?

What do you want to get in Flash? What do you want to get in SDRAM?

 

How should the final memory map look like?

 

CrasyCat

0 Kudos
Reply