Symbolic debug of Application with boot loader

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

I have searched the forum but I don't find anything that fits my situation.  I apologize in advance if I missed it ...

 

I have a boot loader which has been debugged and transfers control to an application but there are some exception condition issues that require that I be able to debug the application with the boot loader also loaded. 

 

I know that I can concatenate *.hex files and load the resulting file but two issues come up with this:

 

1) I loose all symbol information

2) So far I have been unable to successfully 'attach' to a device for debugging unless I allow AVR Studio to also program the device.  i.e.: I cannot debug the device when I specify "Skip programming" (and load the boot loader and application hex files via Tools/Device Programming).  The device resets and starts when I hit 'play' but, when I hit 'pause' it keeps running but Studio thinks it's stopped at 0xFFFF.

 

BTW: AVR Studio 7.0.1188, processor ATMega1284P

 

In an ideal world I would like to be able to debug both the boot loader and application with symbols at once but the ability to have both in memory and symbols for one of them would be ok at the moment.

 

Is this possible? (BL & Appl in memory w/symbols for the appl)

 

I think that if I could tell AVR Studio that I am debugging the application (i.e.: Studio loads the symbols for the application) and successfully 'attach' to an already loaded device this would work for me.

 

Regards,

 

Chuck Hackett

This topic has a solution.
Last Edited: Tue. Apr 30, 2019 - 09:36 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Its been a while since I used the "attach" on a mega device - but if I remember correctly you should probably set the OCDEN fuse manually from the programming dialog before attempting it.  Studio automatically sets this when programming on launch, and clears it automatically again afterwards.  It may also be the reason "skip programming" is not working well during debug...?

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mraardvark wrote:

Its been a while since I used the "attach" on a mega device - but if I remember correctly you should probably set the OCDEN fuse manually from the programming dialog before attempting it.  Studio automatically sets this when programming on launch, and clears it automatically again afterwards.  It may also be the reason "skip programming" is not working well during debug...?

 

Setting OCDEN appears to have done the trick!  Thanks!

 

In my testing, it appears that, if I put in a new copy of the application (via Tools/Device Programming) the application area no longer verifies.  I assume this is because the programmer assumes that memory was erased and does not erase each page as it loads it.

 

I have to erase the chip, 'program' the application, 'program' the Boot Loader, and then I can either (symbolically) debug the Boot Loader or the application (not both in the same reset).

 

Is there a way to set it up so that the chip erase is not needed ... or ... I notice that in the "Tool" section of Project Properties under "Programming Settings" where I currently have "Skip Programming" selected there are other options such as "managed by script" and "program with custom tool".  Can someone point me to a script example that I can have program the boot loader and application upon launch?

 

Chuck