Skip to content
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

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

Closed
stefanrueger opened this issue Oct 26, 2023 · 2 comments · Fixed by #1577
Closed

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

stefanrueger opened this issue Oct 26, 2023 · 2 comments · Fixed by #1577
Assignees
Labels
bug Something isn't working

Comments

@stefanrueger
Copy link
Collaborator

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

And here an example where it is used:

avrdude/src/jtagmkII.c

Lines 98 to 107 in d6c61f5

/*
* The OCDEN fuse is bit 7 of the high fuse (hfuse). In order to
* perform memory operations on MTYPE_SPM and MTYPE_EEPROM, OCDEN
* needs to be programmed.
*
* OCDEN should probably rather be defined via the configuration, but
* if this ever changes to a different fuse byte for one MCU, quite
* some code here needs to be generalized anyway.
*/
#define OCDEN (1 << 7)

avrdude/src/jtagmkII.c

Lines 1350 to 1352 in d6c61f5

if ((b & OCDEN) != 0)
pmsg_warning("OCDEN fuse not programmed, "
"single-byte EEPROM updates not possible\n");

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

@stefanrueger stefanrueger added the bug Something isn't working label Oct 26, 2023
@stefanrueger stefanrueger self-assigned this Oct 26, 2023
@mcuee
Copy link
Collaborator

mcuee commented Oct 26, 2023

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
Copy link
Collaborator

mcuee commented Oct 26, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants