Author Topic: Managing LCF files after a CW 10.2 import  (Read 7380 times)

Offline jong56

  • Newbie
  • *
  • Posts: 9
    • View Profile
Managing LCF files after a CW 10.2 import
« on: March 06, 2014, 12:15:31 AM »
So I am attempting to move my MCF53325 project from CW 7.2 to 10.2.  After performing the import as described in another
forum (http://www.utasker.com/forum/index.php?topic=1310.0) and documents on the uTasker site and making a few (OK,
many) adjustments to paths, etc. I have gotten everything to compile/link and load, but I then realized had made a mistake
in which .LCF file I was using in the project. 

The project I had compiled for the ColfFire main uTasker was intended (memory-wise) to be part of a 'full' system that includes
both of the uTasker boot loaders.  Thus I used the M52235_BOOT_APP_FLASH_SPI.LCF file where the start location of the
main application code is well past 0x00000000 (0x00004000).  When I realized this I changed the .LCF to the correct one
(M52235_FLASH.LCF) which starts at 0x00000000.

After this change, I spent the last 3 hours attempting to get the project to actually use this new starting address when it
actually flashes the ColdFire.  I have changed all .LCF file references to the correct one and the flash tool still erases starting at 0x000040000
and then proceeds to flash the MCU starting there.

So what am I missing.  I have looked through all the various settings and they all seem correct...at least the ones I looked at.

Does anyone (Mark?) know where I might find this and change it.  I believe this should be easy, but as of yet, this is NOT
the case.

Thanks much.

                                                     - jon

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Managing LCF files after a CW 10.2 import
« Reply #1 on: March 06, 2014, 12:37:15 AM »
Jon

When you load to the board check the *.elf file that is actually being loaded. It may be that you have built the project with the correct linker script (verify this by generating an SREC output and checking that its first address is really 0 and not 0x4000) but the debugger is loading something else.

Also do a clean and rebuild after making project setting changes to be absolutely sure that they have been used.

When using the debugger there is a path to the *.elf that it will be loading - ensure that it is not loading a file from a different directory from the one with the (successful) SREC in.

CW10.x (and Eclipse generally) is not always so clear as to what it is actually doing. Recently I have spend quite some time cleaning up the Kinetis Codewarrior project to ensure that all paths are relative and that it has a small number of clearly set up targets. This is more critical than the Coldfire due to the fact that Freescale has moved to GCC as compiler (the original one couldn't compile for devices with m0+ core - used in their KL series) and there are a huge amount of Kinetis devices. After lots of experimenting I believe that I have a nice solution but it requires two setup changes when moving between parts (just setting the processor core and linker script) and I hope to shortly make a video showing it in use .

I have in fact reworked the Coldfire project for CW10.5 so that it is all a bit clearer but somehow I have broken it in the process, so will be doing some more investigations of my own - it is not my favourite IDE considering the amount of time one needs to spend messing with it rather than actually doing development work...;-(

Regards

Mark

Offline jong56

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Managing LCF files after a CW 10.2 import
« Reply #2 on: March 07, 2014, 06:01:19 PM »
Mark,

Thank you.  I finally got everything to work.  I tried to follow your example, but you were using version 10.3 and I was using 10.2.
I attempted to get a version of 10.3, but could only get the trial version which disables the classic import tool.  I then attempted to
move to 10.5 and import.  Sadly, the 10.5 version no longer supports the CW7.2.2 tool set so that did not work either.

Next, I once again created the 10.2 version and made sure and made sure everything was pointing correctly as you describe.  At this
point I was able to get the flash device (Multilink Universal) to load correctly but it would not debug.

Finally, I took the 10.2 version I had created and imported it into the 10.5 version.  After a few more path corrections, etc. (I am also
having an issue with not being able to use linked file paths so all are full paths...), it now loads correctly and debugs fine.  All seems good
at this point.

On more minor question: I get warnings on the .lcf file I use where you include startup.s and flash_config.s and it can't find these files (though
the project does find and use it correctly) and assumes I should have placed the .obj versions there instead.  Thoughts?  Does not really seem
to be an issue.

In any case thanks for all your help while I had the 1 year support as well as now.

                                                                                      - jon

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Managing LCF files after a CW 10.2 import
« Reply #3 on: March 07, 2014, 11:12:36 PM »
Jon

startup.s and flash_config.s are in Hardware/M5223X/

To remove the warnings (or correct them ?) you need to modify the linker script file to contain regions with
Startup.obj and flash_config.obj

instead of
 
Startup.s and flash_config.s

I added some extra *.lcfs called things like M52235EVB_FLASH_CW10.lcf for CW10.x instead of M52235EVB_FLASH.lcf for CW7.x.

Regards

Mark