Florin-Popescu / avarice-unofficial

AVaRICE with support for newer devices
GNU General Public License v2.0
13 stars 9 forks source link

UPDI fixes plus lovely undocumented things #14

Closed urjaman closed 1 year ago

urjaman commented 1 year ago

This work is based on running usb packet captures of debugging an ATtiny3217 w/ Microchip Studio.

Oh and one bonus issue that i found: reading registers (except PC) was totally broken; apparently it works like on xmega (not surprising, these are sorta-xmega-derived cores).

I think this is obviously not ready - we should capture extended descriptor for the other Tiny 1-series devices and try to figure out the bytes - it seems to contain the device ID, addresses of EEPROM and other internal bits, but i can't say much more than that with only one sample.

Also the code is .. architechturally not great, but i didn't want to go rewriting half the program just to show what is broken.

( I think "is_xmega" is not a good ... thing -- i think we should have a device family of some sort instead (in devdescr), and then derive some sort of target flags from that (in class jtag) -> it could be like if (targetflags & TGTFLG_XMEGALIKE_REGS) or whatever instead of is_xmega || UPDI. )

Florin-Popescu commented 1 year ago

Hi! This looks good and I tested on my attiny412 with MPLAB snap.

You are right, the way it's designed is not ideal, but I don't want to spend too much time on my tools, I would rather focus on the projects I'm building with those tools. Anyhow, I have this attiny412 and some atmega4808 (same family), I may have some 402s as well. If you can give me more details on how you did i, I could check the descriptors that mplab sends to get more data on this.

FYI there is now an official avarice repo here. I am trying to get my changes merged there but the developers haven't been very active in the last few months. Would you please submit the same patch there, so that hoepfully we could have everything in one place? Also there was a PR there regarding SW breakpoints which may be interesting for you: avrdudes/avarice#88

With that being said, if you have further changes to propose I would be happy to merge them here.