Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

RE: [AVR-Chat] Problem Debugging App+Bootloader Using JTAGICE

2005-10-03 by Larry Barello

Yes, what you describe is what is happening. I don’t think there is any way to keep Astudio from erasing the boot block. Fortunately 0xFFFF appears to be a NOP so even though the reset vector is in the BL, the processor will eventually wrap and start executing the application code. While debugging I would remove any dependencies on the BL including moving the BL interrupt vector table back to normal memory. I don’t know any way around this, except, perhaps, to use your boot loader, rather than JTAG to load your code. That is an option in the debugger properties sheet. That makes it clumsy: compile, download, then debug, but workable.

Cheers!

-----------

Larry Barello

www.barello.net

From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf Of Ivan Vernot
Sent: Monday, October 03, 2005 2:40 AM
To: AVR-Chat@yahoogroups.com
Subject: [AVR-Chat] Problem Debugging App+Bootloader Using JTAGICE

Hello All,

Has anyone successfully been able to debug (ie set through code etc) an application when it has been jumped to forma boot loader?

I have AVRstudio V4.11 SP3 using WInXP SP2 and ICCAVR V7 Compiler

I have a working Bootloader (BL) that I can debug the BL using AVRSTUDIO and JTAGICEII no problem.

I have a working App that I can debug the App using AVRSTUDIO and JTAGICEII no problem

I cannot debug the app when the BL is also programmed into the device.

I cannot debug the application WHILE the bootloader section is programmed at the same time.

It seems that AVR studio (or the JTAGICE) is erasing the device (and hence the Bootloader) as it downloads the app and sets it up for debug mode.

I have tried -

1. Using 'Tools/Program AVR') I have erased the device then (with 'Erase Device before programming' option off) I have programmed the BL and programmed the BOOTRST bit so that the BL starts (and it does)

2. Using AVRStudio and JtagICE II I load the working App to try to debug why it is hanging after it is 'jumped to' from the BL

When the APP is downloaded I cannot even step into the app (ie. I can't run the app at all!)

I think what is happening is that the JTAG resets the micro and the BOOTRST bit makes the micro start running code is

but when I disassemble the code at F000 (*word address) it is filled with FFFF s

So it looks to me like the BL has been erased by the JTAG when it downloaded the app.

So my question is

1. Generally, how does onr debug an application when there is a BL programmed?

2. Specifically, how can I tell the JTAGICE to not erase the flash before it downloads new code?

BTW: The REASON I need to have this setup is that the app does not run correctly when is lives with the BL and the reset vector is in the BLS.

Actually - the BL does jump to the app ok and I see the app print stuff to the UART but is locks-up soon after that

I suspect that it is something to do with where the Interrupt vectors are being located (I think I am moving them from the BLS to 0000 when I leave the BL correctly) but I cannot see what is happening to be certain.

Any advice would be greatly appreciated,

Kind Regards

Ivan Vernot

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.