Sun 24 Mar 2013 01:22:56 PM UTC, original submission:
The current head version of the svn trunk of avrdude contains a bug which ties all access to fuses on the XMega parts to fuse0, at least when using the jtag3 in PDI mode. However, I suspect that at least with the jtag2 ICE the same problem exists.
The point is that jtag3_read_byte() uses
However, any offset definition from /etc/avrdude.conf is ignored, so strncmp() very happily return 0 for fuse0 ... fuse5, but the address record stays at zero, though the base-address used with the programmer is that for fuse0.
The attached patch addresses this issue with two different approaches:
1 Insert a "fuses" memory section into the part definition in avrdude.conf. Fuses can then be programmed and read back as a usual memory region. This may not be too clever, as normally there is no fuse3 for the xmega. But of course, one could insert a fusesA and a fusesB region which leave out any holes in the fuses address range.
2 Change the individual programmer-driver to really check for the name fuse0 ... fuse5. To do so XXX_read_byte() and XXX_write_byte() have to be changed appropriately. The attached patch proposes one possible hack-around for the jtag3 programmer. If that patch is accepted, the source code for all other affected programmers could be changed accordingly.
Best,
Claus
|