How to Debug Bootloaded code--AVR Studio 6.2 & AVR Dragon

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The Atmel solution builds the bootloader.  It has access to the source files used to build the bootloader itself.

 

The bootloader code receives data to loade the application binary over a communication interface, in my case, wireless.  Can I somehow add files and/or configure Studio 6.2 so I can source level debug not only the bootloader code, but also the application?

 

Or, do I need to debug the application separately?

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In practice,   you treat the bootloader as an independent program.     Assuming that you only use it for uploading complete applications.

 

When you want to debug a regular application,   remove the bootloader and BOOTRST,  then let the Dragon do the uploading.

 

I really would not attempt to debug both operations at once.     For a start,   you tend to build them as independent programs.

Yes,   you can debug the bootloader if you need to.      Personally,    I would only use a proven bootloader in the first place.

 

After the debug and testing phase,    it is convenient to burn bootloader+app in one go especially for production.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the reply David.

 

That's what I've been doing.

 

In my case, it's a custom bootloader I wrote myself.  My requirements are very specialized...

 

Using the debugger to make sure the control transfer from the bootloader to the app is exactly as I intended was one step I was considering for getting "a proven bootloader in the first place".  Not really necessary, but experience has taught me that actually stepping through code with a debugger often gives insight otherwise missed.

 

I can blow that off (probably what I'll do), or create an executable that combines the bootloader and a "dummy" app for debugging purposes.  I thought maybe there was a way to do that conveniently in Studio.

 

Thanks,

 

Dave THomas

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I used to single-step through code. Twenty years ago.

Now, design before coding eliminates this.