Can't access ATmega165A via JTAGICE MKII / 3

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

I'm having trouble programming/debugging an ATmega165A. Programming via ISP works fine. But programming/debugging via JTAG always failes. I'm having a brand new JTAGICE3 and an JTAGICE MKII. Both operate with the same results:

- Whe trying to read device signature I get the message: "Unable to enter programming mode. The read id indicates that the connected device is an ATmega165A. Error details: Severity=INFO, ComponentId=20100, StatusCode=0" The device signature is displayed correctly 0x1E9410 but is marked red.

- When trying JTAG programming the process failes completely. Not even the signature bytes can be read. I get the message: "Execution of command cancelled because of previous command failure. Error Details: Severity=CANCEL, ComponentId=20000, StatusCode=0)"

- When trying JTAG debugging I get the error message: "Device signature seems to indicate a different part (ATmega169PA)...". However, when reading fuse bytes via ISP after trying JTAG debugging I see that the OCD fuse hase been programmed.

The ATmega165A setup is as follows:
- Power supply: 3.3V
- No other signals/components are connected to the JTAG pins (verified)
- ATmega165A runs with a 7.3728MHz crystal (verified)
- JTAG clock frequency = 250kHz
- I have monitored the JTAG lines with a scope. Signals seem to be OK. However, with my scope I'm not able to monitor the complete sequence. I may have to pick up a better scope.
- No lock bits are programmed
- Fuse bits:
BODLEVEL = 2V7
RSTDISBL = [ ]
OCDEN = [ ]
JTAGEN = [X]
SPIEN = [X]
WDTON = [ ]
EESAVE = [X]
BOOTSZ = 1024W_1C00
BOOTRST = [ ]
CKDIV8 = [ ]
CKOUT = [ ]
SUT_CKSEL = EXTXOSC_3MHZ_8MHZ_16KCK_65MS

EXTENDED = 0xFB (valid)
HIGH = 0x91 (valid)
LOW = 0xFD (valid)

I appreciate any help!!!

Regards
Sebastian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would check all the relevant XML files in AS6.x.

Atmel is not unknown to have typos or even totally erroneous fields.

Mind you, I would think that any obvious mistakes would have been reported by now.

I don't possess a mega165. I have used JTAGICE-II with a mega169P and AS6.0

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

David,

I'm not familiar with XML files.
However, I chanced a glimpse at the ATmega165A.xml and ATmega165A_JTAGICE3.xml files. I searched for JTAG but nothing catched my eye. Are there any other files I have to check. Can you give any hints to which items I shall pay attention especially?

Thank you!!!

Regards
Sebastian

Atmel Studio 6 (Version: 6.0.1938 - Service Pack 1)
© 2011 Atmel Corp.
All rights reserved.

OS Version: Microsoft Windows NT 5.1.2600 Service Pack 3
Platform: Win32NT

Installed Packages: ARMGCC - 3.3.1.115
ARM Toolchain
Version: 4.7.0.49 - GCC 4.7.0
Package GUID: b55b919b-ef5f-4608-97eb-ddf473177814
Company: Atmel
HelpUrl:

CMSIS
Version: ${cmsisFileVersion}
Package GUID: b55b919b-ef5f-4608-97eb-ddf473177814
Company: Atmel
HelpUrl:

Installed Packages: Atmel Software Framework - 3.1.3.114
ASF
Version: 3.1.3
Package GUID: 519cc26f-02f6-4ace-8bf7-30c1cdea1f02
Company: Atmel
HelpUrl: http://asf.atmel.com/3.1.3

ASF
Version: 3.0.1
Package GUID: 519cc26f-02f6-4ace-8bf7-30c1cdea1f02
Company: Atmel
HelpUrl: http://asf.atmel.com/3.0.1

ASF
Version: 2.11.1
Package GUID: 519cc26f-02f6-4ace-8bf7-30c1cdea1f02
Company: Atmel
HelpUrl: http://asf.atmel.com/2.11.1

ASF
Version: 2.10.0
Package GUID: 519cc26f-02f6-4ace-8bf7-30c1cdea1f02
Company: Atmel
HelpUrl: http://asf.atmel.com/2.10.0

ASF
Version: 2.9.0
Package GUID: 519cc26f-02f6-4ace-8bf7-30c1cdea1f02
Company: Atmel
HelpUrl: http://asf.atmel.com/2.9.0

Installed Packages: Atmel Studio Extension Manager - 1.1
Atmel Studio Extension Manager
Version: 1.1
Package GUID: AtmelStudioExtensionManager
Company: Atmel

Installed Packages: AVRAssembler - 2.1.51.46
AVR Assembler
Version: 2.1.39.227
Package GUID: 4ef81ed0-2355-4ec8-98b8-f72b79ee5d72
Company: Atmel
HelpUrl:

Installed Packages: AVRGCC - 3.4.0.65
AVR Toolchain 8 Bit
Version: 3.4.0.663 - GCC 4.6.2
Package GUID: a3796ad3-98fe-4e60-bd15-57100d343560
Company: Atmel
HelpUrl:

AVR Toolchain 32 Bit
Version: 3.4.0.332 - GCC 4.4.3
Package GUID: a3796ad3-98fe-4e60-bd15-57100d343560
Company: Atmel
HelpUrl:

Installed Packages: Visual Assist X for Atmel Studio - 10.7.1904.0
Visual Assist X for Atmel Studio
Version: 10.7.1904.0
Package GUID: 7997A33C-B154-4b75-B2AC658CD58C9510
Company: Whole Tomato Software

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I read that message as "you have selected the wrong chip"..

Quote:

- Whe trying to read device signature I get the message: "Unable to enter programming mode. The read id indicates that the connected device is an ATmega165A. Error details: Severity=INFO, ComponentId=20100, StatusCode=0" The device signature is displayed correctly 0x1E9410 but is marked red.

Studio reads 0x1E9410 which the XML maps to mega165A, but you have chosen something else..?

:: Morten

 

(yes, I work for Microchip, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I suggest that you update AS6.0.1996

I don't know about AS6.1.
I can't get the 6.1 beta to work on either of my PCs.
So I have never tried the current 6.1

You can view XML files with "XML Notepad" or similar.
My ATmega165A.xml and ATmega169PA.xml trees look ok to me.

But I have not got a mega165 to try in real life.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Morten,

The chip is an ATmega165A and the project properties are set to ATmega165A.

In ISP programming mode I read the signature of an ATmega165A and programming works fine.

In JTAG programming mode I read the signature of an ATmega165A when clicking the read device signature button but I get an error message (see my first post)

In JTAG debugging mode Atmel Studio always claims to have read an ATmega169PA signature an aborts the debugging session. However, the OCDEN fuse is always programmed after trying to start a debugging session.

Regards
Sebastian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

David,

I'll try to update AS. But I have to request admin rights and this can take several days at my company :( .

Thanks, for helping out with the XML files.

Regards
Sebastian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

- Updated AS => same result as reported before.
- Ported the code to an ATmega1284P (evaluation board) => code works fine, JTAG programming / debugging works fine
- Replaced ATmega165A by a new ATmega165A - JTAG still failes operating
- Bridged 3.3V voltage regulator to supply the ATmega165A directly via 5V power supply => JTAG still failes operating, so it's no regulator issue!?!

Next step is to replace ATmega165A by ATmega325A.

Any ideas???

Regards
Sebastian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Sebastian,
the problem was the xml file. there was a mistake from atmel (i think). the jtagid was wrong.
you see my solution following.

:arrow: seb

Attachment(s):