how write firmware for avr jtag programmer

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

hi

i read several post ( like this post : http://emmd.ro/jtag-ice-usb )

all of them just present hex code for main micro of programmer ( They say to this hex file: firmware )

but i love to know how this code written - i want see source code ( .c or .cpp ) of this hex file

Therefore, I understand better the process And this Simplify the possibility of change or even i can write a new firmware laugh

mahdi damirchilu, my blog : dmf313

Last Edited: Wed. Jun 26, 2019 - 08:15 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Going from a hex file back to C code WOULD take several steps:

 

1) Hex to binary ... this is relatively straight forward 

 

2) Binary to assembler ... this is a little harder. It depends on the original program and may require some guessing.

 

3) Assembler to C/CPP ... this is WAY harder and in the general case, may not be possible. There is no 1:1 unique relationship between assembler and high level language. One can guess and maybe come close, but you cannot know for sure if you have it correct. Then again, you cannot even know how it was written. It might have been written directly in assembler without the use of C. You will never know, for sure!

 

Sorry, that is the way it is...

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Last Edited: Wed. Jun 26, 2019 - 01:52 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thank you for help me 

 

assembler? me?  guess? oh my gooooooooooooooooooooooood - its so hard And impossible for me surprisecrying - i just can understand c/c++ crying

 

1 question: Is this firmware ( for avr jtag programmer ) confidential and nobody knows how to write it?

mahdi damirchilu, my blog : dmf313

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

No, not confidential. Most users would never want to "write" it. They want to USE it to load their own programs into their microcontroller. 

 

By the way, JTAG is a very specific protocol. You do NOT want to mess with something that works. Me, personally, I'd spend my time learning, not trying to rewrite a programmer.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Last Edited: Wed. Jun 26, 2019 - 02:11 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

very good, then i can find it with more searchlaugh, yes you say right, they just want use it, but i want learn how to write it, i don't love just use it

heartyes

mahdi damirchilu, my blog : dmf313

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

What answer did the guy that made the site give you?

he has a "contact"  link, so why not ask him for the source code?

 

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

sorry but my english is weak - you say that, i contact with admin website "emmd.ro" ( http://emmd.ro/jtag-ice-usb  ) that i put 1 link from this site in my first post ( https://www.avrfreaks.net/forum/... )?

I sent an email to the admin of this site ( http://emmd.ro ) before ask question in this site ( avrfreaks )

mahdi damirchilu, my blog : dmf313

Last Edited: Wed. Jun 26, 2019 - 06:40 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just to check but you do know, don't you, that these old "JTAG ICE" clones can only do JTAG with the 10 very oldest JTAG AVR? It won't work with "modern" AVRs.

 

The only AVR they support are:

 

ATMEGA16L;         ATMEGA16;           ATMEGA16A;

ATMEGA162;         ATMEGA162V;      ATMEGA165   

ATMEGA165V;      ATMEGA169,         ATMEGA169V  

ATMEGA32L,          ATMEGA32,         ATMEGA32A;

ATMEGA323L;       ATMEGA323;       ATMEGA64L;

ATMEGA64;           ATMEGA64A;       ATMEGA128L;

ATMEGA128;         ATMEGA128A;

 

And that list actually contains many duplicates ATMEGA16, ATMEGA16L and ATMEGA16A are all effectively the same thing. So it's really just 16, 162, 165, 169, 32, 323, 64 and 128. So 8 different chips all of which are close to 20 years old.

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

yes - i see some clone programmer that say just support old micro and not new micro ( avr ), like this : AVR-JTAG-USB-A

List of all supported targets: ATmega128, ATmega128L, AT90CAN128, ATmega16, ATmega16L, ATmega162, ATmega162L, ATmega162V, ATmega165, ATmega165V, ATmega169, ATmega169L, ATmega169V, ATmega32, ATmega32L, ATmega323, ATmega323L, ATmega64, ATmega64L

 

This design does NOT support newer devices like ATmega644, ATmega640, ATmega1280/1281/2560/2561, ATmega645/6450/649/6490 and so on

 

This is a good reason ( for me ) to find and update/edit the jtag firmware source code.

mahdi damirchilu, my blog : dmf313

Last Edited: Wed. Jun 26, 2019 - 08:21 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

md3848 wrote:
This is a good reason ( for me ) to find and update/edit the jtag firmware source code.
That's not going to work (if it were possible others would have done it in the last 10..15 years). The fact is that the debug protocol to the later AVRs is proprietary. The only reason this clone design is even possible is because the frimware image of Atmel's original JTAG ICE was "open".

 

Given that a Microchip Snap costs $15 these days it doesn't make a lot of sense to try and make your own.

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

The old JTAGICE-1 firmware was only ever a HEX file.   There was never source code.

 

Yes,  there are Chinese dongles with JTAGICE-1 firmware for $5 - $10.   They work just fine with the limited range of OLD chips.   (note that AT90PWM128 and AT90CAN128 work too).

 

JTAGICE-1 is supported by AS4, IAR, Rowley, ...

JTAGICE-1 will never be supported by AS5, AS6, AS7.

 

Writing firmware for JTAG programmer is fairly straightforward.   The "programmer protocol" is public.

Writing firmware for JTAG debugger is difficult.   The debugger protocol is NOT public.

 

The STK600 has always been able to "program JTAG" but never as "debugger".

It always seemed crazy.   I am sure that there was sufficient Flash memory on the STK600 MCU to include debug capability.

It would have made STK600 an attractive product with zero manufacturing cost to Atmel.

 

Be realistic.   You can buy a Microchip SNAP for about $15.    It can do ISP, TPI, PDI, UPDI, JTAG, SWD, ...

Ok,  AS7.0 does not support SNAP yet.   MPLABX IDE has room for improvement.

But I would be confident that the SNAP firmware will be updated in the near future.

 

Or you can buy PicKit4, ATMEL-ICE, Dragon which are all currently supported by AS7.0

 

David.

Last Edited: Wed. Jun 26, 2019 - 08:54 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
It always seemed crazy. 
+1

 

I think I was the first one outside Atmel to get an STK600 (they sent me an early one because I hit some post count milestone) and I remember thinking "great, an STK500 that also has a JTAG debugger" (simply because the box mentions "JTAG"). Only later was I hugely disappointed to find it only had JTAG prog not JTAG debug. In the end I gave it away to MicroCarl.

david.prentice wrote:
But I would be confident that the SNAP firmware will be updated in the near future.
+1

 

There's not going to be much market for $5..$10 very limited JTAG clones when you can buy the "real deal" with extensive protocol support from Microchip for $15 !

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

That's not going to work (if it were possible others would have done it in the last 10..15 years). The fact is that the debug protocol to the later AVRs is proprietary. The only reason this clone design is even possible is because the frimware image of Atmel's original JTAG ICE was "open".

then i must forgot edit jtag firmware and I should go and buy a ATMEL JTAG ICE ( wow - about 170$ - It's very cheap indecision - I really say - I do not like to work with the avr microcontroller family angry )

 

Writing firmware for JTAG debugger is difficult.   The debugger protocol is NOT public.

cryingindecisionangry

 

The STK600 has always been able to "program JTAG" but never as "debugger".

So why not use an ISP? When these programmers do not want to use jtag debugger mode enlightened

 

Be realistic.   You can buy a Microchip SNAP for about $15.    It can do ISP, TPI, PDI, UPDI, JTAG, SWD, ...

Ok,  AS7.0 does not support SNAP yet.   MPLABX IDE has room for improvement.

But I would be confident that the SNAP firmware will be updated in the near future.

 

Or you can buy PicKit4, ATMEL-ICE, Dragon which are all currently supported by AS7.

What is "Microchip SNAP"? its a programmer/debugger? This is the first time I hear itlaugh 15$? surprise realy?devil , can you give me a link to buy this product? Does it support all of the avr programming methods? O_O ( ISP, TPI, PDI, UPDI, JTAG, SWD,... ), Supports new micro?

not support in AS7?indecision wow - so good, then i must buy "ATMEL-ICE" crying

mahdi damirchilu, my blog : dmf313

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

The SNAP should be available from regular Microchip Distributors e.g. Farnell UK

 

SNAP only works with MPLABX v5.20 at the moment.

You need to make your own JTAG ribbon adapter from a small piece of Protoboard and header strip.

 

In my opinion the most important feature of a debugger is a reliable ribbon connector.

 

David.

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

md3848 wrote:
What is "Microchip SNAP"?
Don't know about you but when I type that into Google I get to:

 

https://www.microchip.com/developmenttools/ProductDetails/PartNO/PG164100

 

For a long time the "go to" programmer/debugger for AVR (and some ARM) has been "Atmel ICE" but as you have discovered it is fairly pricey (though there's a cheaper "PCBA" version). But in the last year or so Microchip has announced and launched the "Snap" which shows a lot of promise for only $15. The only thing is that just now the IDE support (for AVR) is a bit "sketchy". The hope is that ultimately it will support (for debugging) all debuggable AVRs in either AS7 or MPLABX but so far it does not have complete support everywhere. 

 

So you can either pick Snap then pick and IDE and AVR it is known to work with. Or if you want something that is more guaranteed while Snap is still being developed then get the cheaper version of Atmel-ICE (and AS7).

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

I strongly advise that you do not buy the PCBA version of ATMEL-ICE.    The 1.27mm pitch header is very difficult for a hobbyist.   The official cable and Adaptors are very expensive.

Something like this 1.27mm to 2.54mm Adapter  is safer.   Note that ATMEL-ICE headers are mounted backwards i.e. the key is in the wrong place.

 

David.

Last Edited: Wed. Jun 26, 2019 - 09:57 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Access Denied

You don't have permission to access ....

 

microchip don't allow my people country see this website no i must use VPN frownno

 

 

Google

oh - yeah - i'm sorry - I had forgotten it blush

 

 

With this situation, I have to wait and see if the microchip company is updating this product (for AS7 support), So I bought it, do you think when this update will be released? 1 month? 5 months? 1 year ...? How many? ( i go ask from this email : Snap_Update@microchip.com laugh )

 

 

ATMEL-ICE 170$

ATMEL-ICE pcba about 50$ ( + buy connector converter like this that u say : https://www.ebay.co.uk/itm/Downl... )

mahdi damirchilu, my blog : dmf313

Last Edited: Wed. Jun 26, 2019 - 10:29 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

md3848 wrote:
and I should go and buy a ATMEL JTAG ICE ( wow - about 170$ - It's very cheap indecision...
https://www.avrfreaks.net/forum/how-make-atmel-ice-cable#comment-2663511

Atmel ICE C Kit Powerful development tool for debugging and programming Atmel SAM and AVR microcontrollers ATMEL ICE PCBA inside-in Demo Board from Computer & Office on Aliexpress.com | Alibaba Group

md3848 wrote:
... - I really say - I do not like to work with the avr microcontroller family angry )
There's competition in 8-bit MCU.

A third party effort to reduce the price of entry (though not JTAG)

debugWIRE via USB UART | AVR Freaks

Microchip's reduced price of entry :

Development Tools - Curiosity Nano Boards

 

"Dare to be naïve." - Buckminster Fuller

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

Can you buy components from European distributors?  e.g. Farnell or RS-online ?

Can you buy stuff from Chinese Ebay sellers ?

 

Surely there are local distributors.   (even if they charge a lot of money)

 

Which chips do you actually want to use?

e.g. ATmega1284P,  ATmega4809, SAMD, ...

 

David.

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

md3848 wrote:
microchip don't allow my people country see this website no i must use VPN frownno
Same with Texas Instruments.

Is the Wayback Machine visible to you?

 

"Dare to be naïve." - Buckminster Fuller

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

debugWIRE via USB UART | AVR Freaks

debugwire :  Supported By: Most low pin count MEGA and most TINY devices

JTAG : Supported By: AVR32 and most large pin count MEGA and XMEGA devices

( AVR Programming Methods / Dean Camera / March 15, 2015 )

 

Can you buy components from European distributors?  e.g. Farnell or RS-online ?

Can you buy stuff from Chinese Ebay sellers 

what you think !?

Not directly, but...wink

 

Which chips do you actually want to use?

e.g. ATmega1284P,  ATmega4809, SAMD, ..

None of them! / all of them! laugh , Selecting a micro type is dependent on the project blushcool

 

Is the Wayback Machine visible to you?  

ty - this is good site but it's better i use VPN frown

mahdi damirchilu, my blog : dmf313

Last Edited: Wed. Jun 26, 2019 - 05:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

md3848 wrote:
- I really say - I do not like to work with the avr microcontroller family angry

 

Then why waste your time, and ours?

 

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

Is this firmware ( for avr jtag programmer ) confidential and nobody knows how to write it?

Pretty much.  JTAG itself is well defined and published, but it's essentially just a communications channel.  The exact JTAG commands used, their contents, and the expected reply values, are all proprietary to Atmel, AFAIK.  There have been assorted reverse-engineering efforts directed at debugWire (a different comm channel), but I don't know if they're applicable at all to JTAG devices (or if there have been separate efforts for the JTAG debugging.)

 

You probably have "cloned" hardware, and an official Atmel .hex file for the firmware.

 

 

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

jgmdesign wrote:

md3848 wrote:
- I really say - I do not like to work with the avr microcontroller family angry

 

Then why waste your time, and ours?

 

Jim

What a beautiful response and ... !indecision

Please do not send this spam postno

I said that words, when I saw the price of "ATMEL JTAG ICE" (about $ 170)

Are you happy to see this price? And you say I love avr! I'm dying for avr! .... heart laugh

I do not know why you are upset about my words - are not you the head of the microchip company?laughwink

 

===========

 

I sent an email to "Microchip SNAP" support
With what time "Microchip SNAP" will support the AS7
Whenever they respond to me - I'll share the answer here with you friends

Thank all of you for helping me.

mahdi damirchilu, my blog : dmf313

Last Edited: Wed. Jun 26, 2019 - 08:14 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

westfw wrote:
(or if there have been separate efforts for the JTAG debugging.)

>>> LURA <<<

HappyJTAG2 - JTAG AND SPI AVR8 interface 

 

"Dare to be naïve." - Buckminster Fuller

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

when I saw the price of "ATMEL JTAG ICE" (about $ 170)

"Current" AVR hardware is "Atmel-ICE" at $50 to $130 (depending on whether you want a case and cables.) (There are occasional sales!) (It does the Atmel ARM chips, too.)

Other possibilities include the Microchip PICKit4 (about $50), Microchip SNAP ($15), or one of the Xplained Mini or Curiosity Nano boards with built-in debug interface (~$10)

I don't know whether SNAP and PICKit4 work with Atmel Studio (they do with MPLAB)...

 

 

 

Last Edited: Thu. Jun 27, 2019 - 05:03 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Pickit4 works with AS7.0

Sometimes it requires a kick before it recognises some protocols but it works ok once it is recognised.

 

Both Pickit4 and SNAP work seamlessly in MPLABX v5.20

 

I would hope that the next Release of AS7 will resolve the Pickit4 identification.

And recognise the SNAP.    (I presume that SNAP has a cut-down version of the Pickit4 firmware)

 

David.

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

md3848 wrote:
I do not know why you are upset about my words -

I'm not upset at all....You're the one that wrote:

md3848 wrote:
I really say - I do not like to work with the avr microcontroller family angry )

 

Which I took as you don't like AVR's.  No biggie.

 

md3848 wrote:
are not you the head of the microchip company?laughwink

Hell NO, and If I was I sure as hell would not have sold out to the Evil Empire!

Nice try. smiley

 

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user