avrdudes / avrdude

AVRDUDE is a utility to program AVR microcontrollers
GNU General Public License v2.0
728 stars 137 forks source link

jtagmkI.c and jtagmkII.c rely on OCDEN being bit 7 of hfuse #1537

Closed stefanrueger closed 10 months ago

stefanrueger commented 11 months ago

... but on the ATmega406 it's bit 1 Screenshot from 2023-10-26 23-10-49

And here an example where it is used: https://github.com/avrdudes/avrdude/blob/d6c61f5fab4d0d061fb85233acee6ecaa85dd9c0/src/jtagmkII.c#L98-L107

https://github.com/avrdudes/avrdude/blob/d6c61f5fab4d0d061fb85233acee6ecaa85dd9c0/src/jtagmkII.c#L1350-L1352

Not a biggie (false alerts) but should be fixed at some point.

mcuee commented 11 months ago

I believe JTAG ICE (jtag1) does not support ATmega406, at least not officially. But I do not have the chip to carry out the test now.

I just checked the help file of Atmel Studio 4.19.730 (last version to support JTAG ICE). https://www.microchip.com/en-us/tools-resources/archives/avr-sam-mcus ATmega16(L), ATmega162(L), ATmega169(L or V), ATmega32(L), ATmega323(L), ATmega64(L), ATmega128(L).

@dl8dtl Just wondering if you have ATmega406 to confirm. Thanks.

mcuee commented 11 months ago

BTW, JTAG ICE HW capability is there but the firmware is quite limited since Atmel dropped the support many years ago. I think there are quite some people who want to improve the FW to support more functionalities. However, I have not seen something concrete. The clones of JTAG ICE are really cheap (quality varies) and it is easy to DIY as well, unlike the clones for JTAG ICE mkII which are still quite expensive (that is why I have no interntions to get it).

Atmel also dropped the support of JTAGICE mkII later (not so sure when).

The latest Device supports only lists Atmel-ICE/Power Debugger and later. But the drop-down menu of latest MPLABX IDE for ATmega406 still shows JTAGICE3. https://packs.download.microchip.com/DeviceDoc/Device_Support.pdf (for PIC/AVR/SAM, some tools are PIC only)

ICD5: ICD 5 In-Circuit Debugger PICKit5: PICkit 5 In-Circuit Debugger ICE4: ICE 4 In-Circuit Emulator, Programmer and Debugger ICD4: ICD 4 In-Circuit Debugger PICKit4: PICkit 4 In-Circuit Debugger SNAP: SNAP In-Circuit Debugger EDBG: Atmel Embedded Debugger mEDBG: Mini Embedded Debugger nEDBG: Nano Embedded Debugger RealIce: MPLAB Real Ice In-Circuit Emulator AT-ICE: ATMEL-ICE AT-ICEPD: Power Debugger Sim: Simulator PICKit3: : PICkit 3 In-Circuit Debugger ICD3D: ICD 3 In-Circuit Debugger PM3: PM3 Universal Device Programmer