avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] port access with avr-gdb


From: Theodore A. Roth
Subject: Re: [avr-gcc-list] port access with avr-gdb
Date: Thu, 17 Jun 2004 10:25:02 -0700 (PDT)

On Thu, 17 Jun 2004, David Willmore wrote:

> > - If you were to use this structure to print out the values of all the
> >   io registers using a gdb command like this:
> >
> >     (gdb) print *((struct _avr_regio *)0)
> >
> >   you could get some nasty side effects. Reading some registers changes
> >   the state of the MCU (e.g. reading UDR). There's also no guarantee
> >   about what happens when you read/write a reserved register. (I vaguely
> >   remember hearing that some reserved registers have secret functionality
> >   used by Atmel during testing - I could be quite wrong about this
> >   though).
>
> Even if you read the register with JTAG?  I guess if the JTAG method of
> reading is like the PIC debug method where you clock an instruction into
> the core to fetch a register and then watch to see the data that comes
> onto the bus, then, to the chip, it can't really tell the difference.
> Rats.

OK, the side effects might be under control by the config array that
avarice sends down to the jtagice box at init time. Have a look the
jtag_device_desc_type structure here:

  
http://cvs.sourceforge.net/viewcvs.py/avarice/avarice/src/jtag.h?rev=1.15&view=auto

It looks like the structure explicitly tells the jtagice box which io
address in io reg space are readable and writeable.

Although, I had a discussion a while back with David Gay about him
seeing strange behaviour when reading reserved registers. I think he
said that he was reading non-zero values from reserved registers...

>
> I sure wish people would quit designing 'clever' hardware like that.  What's
> wrong with just setting a flag bit to say you read it?  *sigh*  People try
> to be too clever.

Loks like the jtagice developers were clever with the config array, but
since we can't examine the firmware, we don't know if their
implementation does the right thing. I hope that the firmware will
intercept reads/writes to addresses that it's not supposed to pass on to
the jtag tap controller...

---
Ted Roth
PGP Key ID: 0x18F846E9
Jabber ID: address@hidden


reply via email to

[Prev in Thread] Current Thread [Next in Thread]