-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JTAG is not able to write 1s to EEPROM #1072
Comments
We should perhaps confirm this by testing the JTAG1's EEPROM write capabilities in AVR studio 4 before stating that writing 1's to the EEPROM isn't possible. If it is correct, it's a major bug! |
@dl8dtl mentioned this as a generic AVR JTAG programmer limitation, not limited to JTAG ICE 1. My test results show that JTAG1 and AVR Dragon (JTAG2) have the issue under avrdude. We should test JTAG ICE 1 under AVR Studio 4 (not supported by Microchip Studio), and other JTAG programmers under Microchip Studio (eg: JTAGICE mkii, AVR Dragon, JTAGICE 3, Atmel-ICE, Power Debugger, etc), I see that you have access to AVR Dragon and Atmel-ICE, please help to test this out under Microchip Studio when you got some time. It will be great that you can check out the two test cases mentioned here.
|
I just tried to use AVR JTAGICE 1 under Atmel Studio 4.18 and indeed it has the issue of unable to write 1s to EEPRM.
Initial programming (empty EEPROM to entest.eep) is okay.
Second program failed.
hex files used for the test:
Writing Result:
|
BTW, JTAG1 has also a separated issue with the terminal mode as mentioned in #1054.
|
Hmm, I need to read the documentation in more detail. It has already mentioned the above limitation. https://avrdudes.github.io/avrdude/7.0/avrdude_39.html#Troubleshooting
|
@MCUdude |
I just borrowed the Atmel ICE, and I've just returned it. I may ask to do some more testing with it though. I doubt it will be able to write 1s to EEPROM in terminal mode. It can't co it when writing a file without performing a chip and EEPROM erase first. I contacted a Microchip developer, and got the following answer: Q: Is it correct that JTAG2-compatible programmers (i.e the AVR Dragon) and JTAG3/Atmel ICE only can write 0's to EEPROM and not 1's? It's like this when using Avrdude, but the EDBG documentation I've read doesn't explicitly specifies this behaviour. A: Sounds like a bug to me – this rule applies of course to FLASH, not EEPROM. But EDBG is not “JTAG2-compatible”… and feature-set is usually a function of the silicon, not the debugger anyway… Q: I know the JTAG3/Atmel ICE can write 1's to Xmega's and AVRs with UPDI, but only when utilizing an "Atomic write" (See issue #1009 and PR #1013). However, I can't find a similar feature on AVRs with JTAG. A: Correct – atomic (erase-and-write) was added for XMEGA. Not sure why this split was made… Q: Does this means that it's impossible to write 1's to the EEPROM using a JTAG interface without running a chip erase first? A: Not convinced, but not sure. SomeoneTM would probably have to find the RTL to know for sure – there are many subtle differences between the different entry modes (ISP/HVSP/JTAG) on those old parts – only from XMEGA onwards was there proper separation between physical and logical interfaces… |
@MCUdude |
BTW, I was trying to find the ATmega128A datasheet on the JTAG side. https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-8151-8-bit-AVR-ATmega128A_Datasheet.pdf For high voltage parallel programming (ST500/STK600), it is rather clear. Edit to add: EEPROM is also clear.
|
@MCUdude |
In the end, I think avrdude documentation already mentions the limitation (classic AVR chip limitation in JTAG mode). Still we may need to improve the documentation to mention the chips and JTAG programmers affected. |
@mcuee I don't want to bother the Microchip developers more than necessary. I think we have the answers we need, and we can test using AVR studio 4 just to be sure when it comes to JTAG + EEPROM. |
I agree. In terms of JTAG and EEPROM, I think it is rather clear. And the current AVR documentation is not wrong. The only thing is that we may want to improvement the documentation a bit further to mention the JTAG programmers and Chips (Classic AVRs with JTAG). |
This may get fixed by #1106. |
closed with PR #1106 |
#1071 (comment)
From @dl8dtl
I think avrdude documentation needs to reflect this one.
The text was updated successfully, but these errors were encountered: