purpose of multiple lcf files?

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

purpose of multiple lcf files?

2,446 Views
andersod2
Contributor I

Hi all,

Am using the IDE for Coldfire, which comes with sample code for the M5213EVB board.  I see multiple lcf files with it, including one for the flash and one for the SRAM.  Can you tell me what is the purpose of having two seperate configurations?  Is is just about debugging?

thanks!

Labels (1)
0 Kudos
9 Replies

711 Views
CrasyCat
Specialist III
Hello
 
the main difference is that the M5213EVB_RAM.lcf is allocating code and data into RAM, whereas the MCF5213_INTERNAL_FLASH.lcf is allocating code in flash and data in RAM and making sure everything is configured appropriately for the application to start from stand alone.
 
The RAM project and .lcf file does not initialize the CFM Configuration Field and will not allow the application to start standalone (outside of the debugger).
 
CrasyCat
0 Kudos

711 Views
andersod2
Contributor I

Thanks for your response crasy cat....

So does this mean that the RAM build is for debug only...i.e. it is meant to be downloaded via the Ezport?  Generally speaking I am a bit confused on how data can end up being put into ram without being copied over from the flash...


thanks again
0 Kudos

711 Views
andersod2
Contributor I

Excuse me, I miss-spoke about the Ezport...I am getting confused because I haven't downloaded code directly to ram before...only flash via in-system programmers (which I take it Ezport is sort of like).  So I understand that the flash build is for stand-alone running, and I can see in sample code how the vector table and data are loaded from the proper flash addresses.  I also understand that the lcf file for the RAM build only includes mem/sections for RAM, and not the flash addresses...where I am confused is how this build ends up being utilized.  You mentioned the CFM field, so I will have to look that up to see what I am missing there...but for the moment I am just kind of assuming that the ram build is intended to be loaded by some kind of debugging or bootloading code in flash via uart or another downloading facility....sorry for my ignorance.....I could really use a general explanation doc of how coldfire does the various programming things besides just a datasheet

0 Kudos

711 Views
CrasyCat
Specialist III
Hello
 
RAM build executable is loaded to the target RAM memory by CodeWarrior when you press the Debug button (the green icon with the bug on it).
Code and data are directly loaded to their final location.
 
FLASH build executable needs to be programmed into flash.
You have a Flash programmer integrated in CodeWarrior. This programmer can be started from the tool menu. If you prefer you can use an external flash programming tool as well.CodeWarrior generates a S record file that can be programmed using any flash programmer software.
 
CrasyCat
0 Kudos

711 Views
andersod2
Contributor I

Thanks crasy cat....it's making more sense now...so, along the lines of what I e-mailed arev about:  if the RAM build only contains your code to be debugged, I take it the debugger software is automatically loaded into flash (hence the lack of need to define a flash MEMORY item in the lcf)...is that correct?  In other words, is CodeWarrior just loading it's own debugger software into the flash and waiting to execute your code in the RAM? 



0 Kudos

711 Views
CrasyCat
Specialist III
Hello
 
No.
In the RAM build the code is loaded into RAM and executed from there.
CodeWarrior is loading code and data through the JTAG port.
 
When you are debugging the RAM version of the software there is nothing at all deluded to FLASH.
 
CrasyCat
0 Kudos

711 Views
andersod2
Contributor I

In that case, how does the micro know to execute from ram (i.e. how does codewarrior tell it to do that)?  Doesn't it automatically load instructions off the flash after a hardware reset?  There must be some register or other mechanism that tells the micro that instructions are being loaded into RAM externally, rather than it having to load them from flash....right?



0 Kudos

711 Views
CrasyCat
Specialist III
Hello
 
The debugger directly loads the PC with the address of the application entry point (function __start) and starts from there.
__start being allocated in RAM execution starts in RAM.
 
It does not read anything from flash.
 
CrasyCat
0 Kudos

711 Views
Arev
Contributor III
Hello,

RAM Project are used for debug, allowing the use of multiple Software BreakPoints in RAM.
 
I Hope this helps..

Bye

<< Freescale MCF5234/35 with CodeWarrior 6.2 >>
0 Kudos