Kirk Humphries

Debugging question

Discussion created by Kirk Humphries Employee on Jan 27, 2006

This message contains an entire topic ported from a separate forum. The original message and all replies are in this single message. We have seeded this new forum with selected information that we expect will be of value to you as you search for answers to your questions.

 

Posted: Sat Dec 10, 2005  1:22 am

 

G'day,

 

I've got two programs: a boot loader and an application.

 

If I build the application and flash it (directly from CW using my BDM) the app runs fine.

 

If I flash the boot loader, download the application (specifically its S19 records), then transfer control to the app. As the app doesn't run correctly, I've got some debugging to do.

 

How can I tell CW's debugger to use the app's debug info rather than the boot loader's debug info?

 

Alternatively, can I switch CW to the application and start the debugger _without_ having it flash the 68HC12?

 

Either of the above techniques would give me the boot loaded version of the application along with the application's source code for determining what's wrong.

 

Thanks.

 


 

Posted: Sat Dec 10, 2005  5:59 am

 

> How can I tell CW's debugger to use the app's debug info rather than

> the boot loader's debug info?

 

There is a column in CW when you build the app that you must check or it will not build the debug information. It looks like a green bug, just click until you get a dot in the column and you should be good to go. Note that you need to turn off as much optimization as possible if you want to be able to set breakpoints where you think they should be. There is a function if you right click that shows where the breakpoints can be set; it puts check marks in the code. Markpoints I think... also you need to define variables as static if you want to see them or they will get optimized to the stack. Afterwards you change it back.

 


 

Posted: Sat Dec 10, 2005  12:54 pm

 

Both the boot loader and user application are built with debug info. I've sufficient knowledge of 68xx assembly language that I can deal with the optimized code.

 

During testing I first use the debugger to flash the boot loader. Then I use a PC based program to download the user application (via a serial port). Finally I want to use the debugger on the _application_ code.

 

How do I tell the debugger to use the user application's debug info (rather than the boot loader's info)?

 

Regards,

 


 

Posted: Sat Dec 10, 2005  7:48 pm

 

> During testing I first use the debugger to flash the boot loader. Then

> I use a PC based program to download the user application (via a serial

> port). Finally I want to use the debugger on the _application_ code.

>

 

> How do I tell the debugger to use the user application's debug info

> (rather than the boot loader's info)?

 

I don't think you can debug using this method. The debugger/loader is loading files and tables before it flashes the code which have the debug and app information. It then syncs the source lines to the execution. So unless you are able to build the internal structures in the manner that the debugger expects and then call the entry point of the debugger with the right calling convention, I doubt this will work.

 

What I would suggest you do is build both the bootloader and app as a single module. You have debugged the boot loader and know it works, therefore bypass the serial download fcn and call your main app.

 

Code:

void main(void){  MyBootLoader(); // TestBootloader  // bypass's external  // load, (comment out)  }  return;     void TestBootLoader(void)  {  MyCodeToTest();  }



 

Now you can debug without a problem. The other way will lead you into all manner of tech issues.

 


 

Posted: Sat Dec 10, 2005  8:00 pm

 

In the hiwave debugger, use the File->"Load Application" menu and select "Load Symbols Only" and select your application *.abs fle.

 

And there is also a corresponding command line command:

 

LOAD "app.abs" SYMBOLSONLY

 

Outcomes