Coming from V1 - Questions on Debugging with V2, CW7.2

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

Coming from V1 - Questions on Debugging with V2, CW7.2

Jump to solution
2,150 Views
Kopone
Contributor IV

Hi,

 

I recently upgraded the development platform from the MC51CN Tower module to the MC5225x. I installed CW 7.2 and I can compile and flash and run the demos. Great!

Now what really confuses me is the quite different way in the debugging process as opposed the the CW for V1 which I am used to. I assume I am getting something completely wrong here: The way I got it, each and every time I change anything in my code, I have to manually go through the complete process of opening the flash tool, erasing the flash memory, flashing the new program code and then start the debugger and launch the program? Which is like a dozen mouse clicks, is that right?

When I simply click the debug icon in CW 7 (as I am used to from CW 6 for V1) CW 7 will compile and link my changed code, but it will NOT launch the flash tool. Instead it will just run the debugger afterwards which to me makes absolutely no sense since there is still the old code sitting in the target MCU? Well, I am pretty confused here and cant seem to find enlightenment in the docs...so yeah, I'd just like to know if this is really the suggested way to go?

 

Kind regards, Sven

Labels (1)
0 Kudos
1 Solution
669 Views
CrasyCat
Specialist III

Hello

 

That is right. When working with coldfire V2, V3 or V4, flash will not be programmed automatically when you start a debug session.

So you need to first program the flash and then start debugger.

 

Only think I can suggest  here is using a tcl script to program the flash and then start debugging.

If you open the Command Window and enter help you will see a set of commands with prefix fl::, which are all flash programming related commands.

 

 

CrasyCat

View solution in original post

0 Kudos
8 Replies
669 Views
Kopone
Contributor IV

Ok, I filed a request for V10.

 

Besides that, I would just like to add - for other V2 newbies like me - there actually IS a reason behind the debug-button just starting the debugger...with V2 you can load to and run your programs from RAM. I totally did not know this (is this possible with V1 derivatives?) and it happens when your target is set to ram and you hit the debug button.

With the nice 64k of a 5225x this is a great option and much much quicker than any erase/flash/run cycle. You can even have your main project stored in flash and just for a quick testing run a totally different project from RAM. That's great.

 

And I also noticed, when I use the flash tool, it's best to close it after every erase/program cycle, then reopen it for the next cycle. If I just keep it open all the time, I get all kinds of weird problems, like not being able to erase/program or the blank check failing etc.

 

Regards,

 Sven

0 Kudos
669 Views
CrasyCat
Specialist III

Hello

 

Main limitation in loading application code into RAM for debugging purpose is the amount of RAM memory available.

If you only have 8K of RAM available on your device it will be almost impossible to load application code in RAM for debugging.

 

CrasyCat

0 Kudos
669 Views
Kopone
Contributor IV

Right, that's why the 5225x with 64k comes in handy.

 

But I was wondering, is it possible to make use of external ram (via the mini flex bus), like e.g. the MRAM module on the Tower memory board? So that the debugger will download to and execute the code from there? That would be great to decrease turnaround times during development, even if the final application wouldnt need the external ram at all.

 

Regards,

 Sven

0 Kudos
669 Views
CrasyCat
Specialist III

Hello

 

I do not know the details for this particular piece of hardware, but generally speaking you should be able to load application in external RAM while debugging.

 

In order to achieve that you need to:

  1- Update your linker file (.lcf) with definition of a memory block covering the external RAM memory area

  2- Place some section sin there

  3- Update your register configuration file (.cfg) to enable the external RAM.

 

The .cfg file is executed before loading of the application starts. So if the external RAM is correctly enabled there, you should be able to download code there.

 

CrasyCat

0 Kudos
669 Views
Kopone
Contributor IV

That's great news. Thanks for the information! I'll add external ram and incredibly boost my turnaround times, ha :manvery-happy:

 

Regards,

 Sven

0 Kudos
670 Views
CrasyCat
Specialist III

Hello

 

That is right. When working with coldfire V2, V3 or V4, flash will not be programmed automatically when you start a debug session.

So you need to first program the flash and then start debugger.

 

Only think I can suggest  here is using a tcl script to program the flash and then start debugging.

If you open the Command Window and enter help you will see a set of commands with prefix fl::, which are all flash programming related commands.

 

 

CrasyCat

0 Kudos
669 Views
Kopone
Contributor IV

Hey CrasyCat,

 

thanks for making that clear! I'll check out  what the script thing can do for me or maybe I will just get used to manually flash each time. Just wanted to make sure I am not doing anything the complete wrong way here.

 

Or maybe I file a service request with a proposal for product improvement. But would that make any sense now that CW 10 is on the verge of being release?

 

Regards,

 Sven

0 Kudos
669 Views
CrasyCat
Specialist III

Hello

 

   I am not sure whether this has been taken into consideration for V10.x.

 

   We will not do any extension in V7.x release of CodeWarrior any more, but using a Service Request you can report that  

   you would appreciate to see that feature in V10.x. 

 

CrasyCat

0 Kudos