simulating and debugging AVR program

Go To Last Post
75 posts / 0 new

Pages

Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

I am using stk500 , atmega16 micro and avr-gcc toolchain. Now I have to debug the program. (Mine program is compiling/loading properly). Now I want to know how can I debug my program? Any new hardware required?

From my side, I installed simulavr and avr-gdb and started debugging my .elf file commands are..

#simulavr --L It results in list of supported micros
but atmega16 is absent in the list.

#avr-gdb

(gdb) file filename.elf Mine *.elf file opened
(gdb) target ...... What it should be I tried all the
combinations using insight also.
In user guide came with stk500
115200 baud RS232 port (COM port)
specified even I tried this one
with /dev/ttyS0

Thanks in advance!!

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

Quote:
I installed simulavr

Why not just use the AVR Studio simulator? There are some things that don't work properly (such as some of the timer functions), but for the most part it works well.

If you want to use on chip debugging you need a compatible JTAG device. For the mega16 this could be the JTAGICE mk1 or mk2, or you could use a dragon.

Regards,
Steve A.

The Board helps those that help themselves.

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

But AVR studio simulator is for windows according to my knowledge. I am using linux platform.

Regards,

Anmol Kumar

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

Quote:
I am using linux platform

Good reason not to use AVR Studio!

I don't know why the mega16 would not be supported, it has been around for quite some time. Are you using simulavr or simulavrxx? The latter looks more up to date.

Regards,
Steve A.

The Board helps those that help themselves.

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

wait until simulator 2.0 comes, then install windows and avr studio :) simulator 2 should simulate the parts exactly ( except for electrical charateristics ofcourse )

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

Hello,

I started my atmel microcontroller programming because of your's help/guidance through this forum. I started my developing C programs using STK500 and avr gcc toolchain on linux. I created, compiled and loaded my program to microcontroller using avr mega16 (supplied with stk500 kit).
Its successful.

Now mine issue is that I was doing my some C programming for UART (to interact with GSM module). But I want to see the output i.e whats there on serial port so for that I need some console to watch whats going on.

So please let me know how can I debug my C programs using these devices or may I need some extra tools for this one...

I already installed simulavr and avr-gdb (even insight) but in simulavr --L lists supported devices but atmega16 is not there. How can I add mega16 to this list of supported microcontrollers.

Moreover when I am using avr-insight what should be the target setting I am using stk500 and programming cable is connected to /dev/ttyS0. I tried all the combinations because I am unable to understand it completely after a lot of Research. Its diplaying gdb cannot connect to target board.

So, please let me know how can I be out of this loop.

Waiting for reply of yours!!

Thanks,

Anmol Kumar

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

You can't debug using gdb in circuit with just a STK500. For the mega16 you would need a JTAG, Koshchi has listed some examples above. Simulating might work but there is usually the problem that the HW aspects are not simulated (the GSM reponses in your case). I have not used simulavr so can't help with that.
How about you connect the AVR USART to a terminal program (using the spare RS232 on the STK500), i.e., skip the GSM module initially. You can then verify the AVR output and just type in (simulate) the GSM responses. Could be a start anyway.

Other debug approches for when tracing is enough to find problems (usually the case in my experience) and the USART is busy:
* Use a AVR with two USARTs and use one for trace.
* Implement a software USART and trace with that.
* Use SPI or TWI to send trace output to a another AVR that buffers and outputs with its USART.
/Lars

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

blader wrote:
wait until simulator 2.0 comes, then install windows and avr studio :) simulator 2 should simulate the parts exactly ( except for electrical charateristics ofcourse )

This doesn't help the user now, and it doesn't help to tell users to install Windows, when they are using Linux.

Eric Weddington

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

EW wrote:
blader wrote:
wait until simulator 2.0 comes, then install windows and avr studio :) simulator 2 should simulate the parts exactly (except for electrical characteristics of course)

This doesn't help the user now, and it doesn't help to tell users to install Windows, when they are using Linux.
True, Eric. Simulator 2.0 will not cure the worlds ills (although I expect it to be better than simulator 1.0), and personal experience tells me to avoid anything labelled *.0. :D However, some folks have had luck running AVRStudio on Linux using Wine, so converting to Windows may not be necessary. (I have tried this combination but have not succeeded, yet. I hope to post a sticky on it when I finally get it to run.)

I personally would go with the JTAG recommendation -- the mkI version of JTAGICE runs the mega16, doesn't it? If so, there are lots of relatively cheap versions of that interface floating around (check http://www.sparkfun.com/commerce... for one - there's a slightly more expensive one, but I'm not sure what the difference is).

Stu

Engineering seems to boil down to: Cheap. Fast. Good. Choose two. Sometimes choose only one.

Newbie? Be sure to read the thread Newbie? Start here!

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

Quote:
and it doesn't help to tell users to install Windows, when they are using Linux
Sure it does. Even free OS's have costs, one of the obvious being a shortage of quality, compatible software.

C: i = "told you so";

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

With reference to the posting above I decided to order for jtagice mkII from atmel, link is..

http://www.atmel.com/dyn/product...

Now let me know is it going to fulfil my requirement or I need something etc. I am using stk500, at mega16 and gcc toolchain.

and from where should I get some tutorials or study material to start my debugging (I mean some links..)

I really thank you guys for help and guidance as and when required.
Again waiting for quick reply of yours........

Thanks,

Anmol Kumar

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

anmol2701 wrote:
and from where should I get some tutorials or study material to start my debugging (I mean some links..)

There's nothing to it really if you've already used the simluator in AVR Studio (and if you haven't you should to get familiar). Once you have a JTAG/DebugWire interface the method of operation is identical to when debugging simulated code only you are looking at the REAL registers, SFRs and memory in the target AVR and not something simply being simulated in the RAM of your Win32 PC.

Cliff

EDIT: sorry, just twigged, you are using Linux - in that case it's back to using gdb I'm afraid (maybe with a GUI front end such as ddd or Eclipse perhaps?)

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

anmol2701 wrote:

> #simulavr --L It results in list of supported micros but
> atmega16 is absent in the list.

Sure? That would be really strange as the ATmega16 has been supported
by simulavr since 2003.

> (gdb) target ...... What it should be I tried all the
> combinations using insight also.

Obviously not *all*... but never try to try all. ;-)

The target is a TCP port, maybe preceded by a hostname. The simulator
by default (when run in GDB mode, option -g) starts at port 1212 (and
announces that port). If your simulator runs on the local machine,
you can omit the hostname:

target remote :1212

(can be shortened to "targ rem :1212" if you want)

If it's running on host foo, you say

target remote foo:1212

Then /don't/ try to "run" your program -- this would instruct GDB to
attempt running it on the native host, which it obviously cannot
(unless your operating system is running on an AVR :-). At that
point, you attached to a remote target, so you just "continue" (or
"c") in order to execute the code.

If you didn't specify the binary code file to the simulator, you first
have to issue a "load" command in order to feed the binary code into
the simulator (righer after attaching to it).

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

When I installed the latest version of simulavr with new toolchain I got it (ie. atmega16 was in the supported list of micros)

Now, When I give the command #simulavr -g -d atmega16
I am getting this-

Simulating a atmega16 device.

devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TWBR' at 0x0020
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TWSR' at 0x0021
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TWAR' at 0x0022
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TWDR' at 0x0023
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'ADCL' at 0x0024
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'ADCH' at 0x0025
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'ADCSRA' at 0x0026
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'ADMUX' at 0x0027
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'ACSR' at 0x0028
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'UBRRL' at 0x0029
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'UCSRB' at 0x002a
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'UCSRA' at 0x002b
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'UDR' at 0x002c
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'SPCR' at 0x002d
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'SPSR' at 0x002e
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'SPDR' at 0x002f
devsupp.c:342: MESSAGE: attach: IO Reg 'PIND' at 0x0030: created
devsupp.c:326: MESSAGE: attach: IO Reg 'DDRD' at 0x0031: ref = 0x0030
devsupp.c:326: MESSAGE: attach: IO Reg 'PORTD' at 0x0032: ref = 0x0030
devsupp.c:342: MESSAGE: attach: IO Reg 'PINC' at 0x0033: created
devsupp.c:326: MESSAGE: attach: IO Reg 'DDRC' at 0x0034: ref = 0x0033
devsupp.c:326: MESSAGE: attach: IO Reg 'PORTC' at 0x0035: ref = 0x0033
devsupp.c:342: MESSAGE: attach: IO Reg 'PINB' at 0x0036: created
devsupp.c:326: MESSAGE: attach: IO Reg 'DDRB' at 0x0037: ref = 0x0036
devsupp.c:326: MESSAGE: attach: IO Reg 'PORTB' at 0x0038: ref = 0x0036
devsupp.c:342: MESSAGE: attach: IO Reg 'PINA' at 0x0039: created
devsupp.c:326: MESSAGE: attach: IO Reg 'DDRA' at 0x003a: ref = 0x0039
devsupp.c:326: MESSAGE: attach: IO Reg 'PORTA' at 0x003b: ref = 0x0039
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'UBRRH' at 0x0040
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'WDTCR' at 0x0041
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'ASSR' at 0x0042
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'OCR2' at 0x0043
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TCNT2' at 0x0044
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TCCR2' at 0x0045
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'ICR1L' at 0x0046
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'ICR1H' at 0x0047
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'OCR1BL' at 0x0048
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'OCR1BH' at 0x0049
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'OCR1AL' at 0x004a
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'OCR1AH' at 0x004b
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TCNT1L' at 0x004c
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TCNT1H' at 0x004d
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TCCR1B' at 0x004e
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TCCR1A' at 0x004f
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'SFIOR' at 0x0050
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'OCDR' at 0x0051
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TCNT0' at 0x0052
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TCCR0' at 0x0053
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'MCUCSR' at 0x0054
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'MCUCR' at 0x0055
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TWCR' at 0x0056
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'SPMCR' at 0x0057
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TIFR' at 0x0058
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TIMSK' at 0x0059
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'GIFR' at 0x005a
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'GICR' at 0x005b
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'OCR0' at 0x005c
devsupp.c:342: MESSAGE: attach: IO Reg 'SPL' at 0x005d: created
devsupp.c:326: MESSAGE: attach: IO Reg 'SPH' at 0x005e: ref = 0x005d
devsupp.c:342: MESSAGE: attach: IO Reg 'SREG' at 0x005f: created
avrcore.c:485: MESSAGE: attach: Internal SRAM from 0x0060 to 0x045f
decoder.c:3875: MESSAGE: generating opcode lookup_table
main.c:415: MESSAGE: Simulating clock frequency of 8000000 Hz
Waiting on port 1212 for gdb client to connect...

So, I left it there and tried to debug the program without simulavr (as I know I am missing some setting to be done)

After that I gave command #avr-gdb programname.elf
and It was OK as shown below

GNU gdb 6.4.0.20051202-cvs
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=avr"...
(gdb)

after that I tried target remote :1212 and output was :1212: Connection refused.

Now, I have a query I am using Serial cable for programming then why this TCP Connection?

So, I tried for serial Port /dev/ttyS0 with command

(gdb) target remote /dev/ttyS0
Remote debugging using /dev/ttyS0
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Malformed response to offset query, timeout
(gdb)

Now If you guide me where am I wrong. So, that I start my debugging. One more thing right now I am not using JTAGICE MkII I am waiting for this device to come as I ordered for the same.

Thanks,

Anmol Kumar

Last Edited: Fri. Jan 18, 2008 - 02:08 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But you seem to saying that you are now trying to use gdb on your PC to debug a physical AVR target on your development board but without a physical JTAG interface (JTAGICEmkII) connecting the two. That's never going to work - you can't debug via a simple programmer circuit - you must have a JTAG interface.

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

So, I have to wait for this device to come and proceed further ..

Thanks for quick reply of Yours!!

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

But you /could/ debug against the simulator (as long as it's about
debugging algorithms, rather than IO behaviour -- the old simulavr
doesn't implement many IO features).

The question is why there's a contradiction:

Waiting on port 1212 for gdb client to connect...

vs.

:1212: Connection refused

Are both, avr-gdb and simulavr indeed run on the same machine?
Did simulavr still run when you tried connecting to it from
within GDB?

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

Quote:
So, I left it there and tried to debug the program without simulavr

Doesn't sound like it. ;)

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

Btw., don't mind that many diagnostic message of simulavr! This
tool never really got finished but eventually abandoned by its
author. Nevertheless, the above instance /is/ running fine!

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

I am not abandoning this tool I am going to use this tool for that particular time as I already muggled up a lot (with no results to watch for me). So, to keep interest live I switched to avr-gdb

Today I am going to use the same one again!!
Surely I'll be successful.

Again thanks for your reply But till now not a relevant solution I found from this forum Try to give solutions not views about which one is best to use!!

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

Hello Jörg,

What do you mean by these questions? How can I check these from my system...

Are both, avr-gdb and simulavr indeed run on the same machine?
Did simulavr still run when you tried connecting to it from
within GDB?

One more thing when I tried some setting for serial port /dev/ttyS0 such as baud rate, remote device etc. I am getting this

(gdb) remote target /dev/ttyS0
Remote device not open

Now if you let me know how to open the remote device /dev/ttyS0.

Thanks,

Anmol Kumar

Last Edited: Tue. Jan 22, 2008 - 07:57 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

cpluscon wrote:
Quote:
and it doesn't help to tell users to install Windows, when they are using Linux
Sure it does. Even free OS's have costs, one of the obvious being a shortage of quality, compatible software.

But don't forget the WMWare solution?

Run windows in a virtual box on you Linux workstation, that way you can use them at the same time.

I had to resort to this (but the other way around) when my boss gave me a Windoze only PC.
Now I'm running Ubuntu under WMWare on that PC...

It is a little bit slower but it works quite nice.

And Windows under WMWare/Linux would probably works as well :lol:

BR
Johan

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

jsiei97 wrote:
Run windows in a virtual box on you Linux workstation
Why would you use Linux on a workstation, other than to atone for a life of evil sinfullness?

C: i = "told you so";

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

cpluscon wrote:
jsiei97 wrote:
Run windows in a virtual box on you Linux workstation
Why would you use Linux on a workstation, other than to atone for a life of evil sinfullness?

Perhaps because in a lot of countries the cost of a copy of Windows XP or Vista represents about 2-3 month's salary? Or because folks are sick and tired of the insecurities and vulnerabilities of M$ software which is what the criminals/malicious tend to target the worms/trojans/virii to ? Or simply because Linux is a far more configurable operating system?

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

cpluscon wrote:
jsiei97 wrote:
Run windows in a virtual box on you Linux workstation
Why would you use Linux on a workstation, other than to atone for a life of evil sinfullness?

Is someone hitting the big drums that tells us that a old flame war has stated again.... :twisted:

And the usual response would be something like
-"Real programmers use real operation systems, like Linux"

etc etc etc

Then we can all do long list over programs that only work under Windows and only under Linux... and top it all with some ugly personal insults 8)

Then we can leave the topic, and just insult people who are different....

/Johan

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

Hello, Try to give the solution of these questions...

How can I check these from my system...

Are both, avr-gdb and simulavr indeed run on the same machine?
Did simulavr still run when you tried connecting to it from
within GDB?

One more thing when I tried some setting for serial port /dev/ttyS0 such as baud rate, remote device etc. I am getting this

(gdb) remote target /dev/ttyS0
Remote device not open

Now if you let me know how to open the remote device /dev/ttyS0. or better I say what should be the setting or values for comfortable running

Thanks
Anmol Kumar

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

Start simulavr, then tell GDB to connect to it via its TCP port
(usually 1212). Your simulavr has been running well, despite of the
messages you've posted.

There is *no* serial device involved, so no need to try anything on
/dev/ttyS0. As others have told you, the STK500 is just a flash
download tool, there's no way to debug across it.

(Running the GDB remote protocol over a serial line is meant to debug
a remote computer that has a GDB server running on its end of the
serial line. The only application I've had so far for this was to
debug a FreeBSD kernel on a second machine that way.)

p.s.: Please try to somehow indicate in your posting which part of the
posting is a quote and which is your text. Your messages are very
close to unreadable, which is not exactly going to improve your
chances of receiving useful followups.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

Ok after a lot of search I came to know that JTAG is emulator and for OCD I require this tool. But I can do debugging using Simulator (ie. Software side) for this I need some simulator (I am using simulavr for the same). Now when I start the simulavr by giving the command I am getting this as output

[root@uthupmanoj ~]# simulavr -g -d atmega16

Simulating a atmega16 device.

devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TWBR' at 0x0020
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TWSR' at 0x0021
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TWAR' at 0x0022
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TWDR' at 0x0023
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'ADCL' at 0x0024
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'ADCH' at 0x0025
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'ADCSRA' at 0x0026
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'ADMUX' at 0x0027
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'ACSR' at 0x0028
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'UBRRL' at 0x0029
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'UCSRB' at 0x002a
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'UCSRA' at 0x002b
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'UDR' at 0x002c
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'SPCR' at 0x002d
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'SPSR' at 0x002e
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'SPDR' at 0x002f
devsupp.c:342: MESSAGE: attach: IO Reg 'PIND' at 0x0030: created
devsupp.c:326: MESSAGE: attach: IO Reg 'DDRD' at 0x0031: ref = 0x0030
devsupp.c:326: MESSAGE: attach: IO Reg 'PORTD' at 0x0032: ref = 0x0030
devsupp.c:342: MESSAGE: attach: IO Reg 'PINC' at 0x0033: created
devsupp.c:326: MESSAGE: attach: IO Reg 'DDRC' at 0x0034: ref = 0x0033
devsupp.c:326: MESSAGE: attach: IO Reg 'PORTC' at 0x0035: ref = 0x0033
devsupp.c:342: MESSAGE: attach: IO Reg 'PINB' at 0x0036: created
devsupp.c:326: MESSAGE: attach: IO Reg 'DDRB' at 0x0037: ref = 0x0036
devsupp.c:326: MESSAGE: attach: IO Reg 'PORTB' at 0x0038: ref = 0x0036
devsupp.c:342: MESSAGE: attach: IO Reg 'PINA' at 0x0039: created
devsupp.c:326: MESSAGE: attach: IO Reg 'DDRA' at 0x003a: ref = 0x0039
devsupp.c:326: MESSAGE: attach: IO Reg 'PORTA' at 0x003b: ref = 0x0039
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'UBRRH' at 0x0040
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'WDTCR' at 0x0041
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'ASSR' at 0x0042
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'OCR2' at 0x0043
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TCNT2' at 0x0044
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TCCR2' at 0x0045
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'ICR1L' at 0x0046
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'ICR1H' at 0x0047
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'OCR1BL' at 0x0048
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'OCR1BH' at 0x0049
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'OCR1AL' at 0x004a
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'OCR1AH' at 0x004b
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TCNT1L' at 0x004c
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TCNT1H' at 0x004d
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TCCR1B' at 0x004e
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TCCR1A' at 0x004f
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'SFIOR' at 0x0050
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'OCDR' at 0x0051
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TCNT0' at 0x0052
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TCCR0' at 0x0053
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'MCUCSR' at 0x0054
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'MCUCR' at 0x0055
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TWCR' at 0x0056
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'SPMCR' at 0x0057
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TIFR' at 0x0058
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'TIMSK' at 0x0059
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'GIFR' at 0x005a
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'GICR' at 0x005b
devsupp.c:348: MESSAGE: TODO: attach IO Reg 'OCR0' at 0x005c
devsupp.c:342: MESSAGE: attach: IO Reg 'SPL' at 0x005d: created
devsupp.c:326: MESSAGE: attach: IO Reg 'SPH' at 0x005e: ref = 0x005d
devsupp.c:342: MESSAGE: attach: IO Reg 'SREG' at 0x005f: created
avrcore.c:485: MESSAGE: attach: Internal SRAM from 0x0060 to 0x045f
decoder.c:3875: MESSAGE: generating opcode lookup_table
main.c:415: MESSAGE: Simulating clock frequency of 8000000 Hz
Waiting on port 1212 for gdb client to connect...

It keeps waiting on port 1212 and nothing else is taking place.
Is there any frequency mismatch or something else?

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

No, now for the 3rd time: everything is fine so far!

Now, you gotta go ahead, start GDB, and have it actually *talk* to
the simulator, using the (GDB) command

target remote :1212

Sorry, but isn't the message:

> Waiting on port 1212 for gdb client to connect...

basically already telling this?

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

But Sir,

where is the root prompt (#) where I have to type the command avr-gdb filename.elf

ater that

(gdb) target remote :1212
(gdb) load

etc.

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

Either use & on the end of the simulavr which will start it as a separate thread or start a SECOND shell and launch gdb in that after launching simulavr in the first

(this is pretty standard Linux/Unix stuff when you come to want to run more than one program at the same time - any beginners manual on the use of Linux will tell you about this stuff)

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

Actually I did the same before reading Yours reply But I am not going for the credit myself. But its showing irrelevant behaviour such as keep waiting and no repy... (I know I need JTAG for it to be 100% working) Just Let me know is it the proper way to go ahead or something else.

[root@uthupmanoj cprograms]# avr-gdb simleflash.elf
GNU gdb 6.4.0.20051202-cvs
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=avr"...
(gdb) target remote :1212
Remote debugging using :1212
0x00000000 in __vectors ()
(gdb) load
Loading section .text, size 0x114 lma 0x0
Start address 0x0, load size 276
Transfer rate: 2208 bits in <1 sec, 138 bytes/write.
(gdb) b main
Breakpoint 1 at 0xe4: file simleflash.c, line 14.
(gdb) continue
Continuing.

Breakpoint 1, main () at simleflash.c:14
14              DDRA = 0xFF;
(gdb) continue
Continuing.

Thanks a lot again to all my seniors!!

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

Glad you finally got it running!

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

Yes Sir,

I acheived something finally. Thanks to you, to clawson and to this forum. Now I have to proceed further for my project.

But sir if you gone through my messages on Jan 18 and on Jan 22 there is a relation. I was stuck (thats why my hands are dirty now).

Don't take it on heart but I am more glad than you or anybody else. :lol:

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

Koshchi wrote:
I don't know why the mega16 would not be supported, it has been around for quite some time. Are you using simulavr or simulavrxx? The latter looks more up to date.
simulavrxx is more recent, but so far supports only three chips: 4433, 8515 and 128. The 168 is coming, but not yet.

Moderation in all things. -- ancient proverb

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

Hello,

After receiving JTAG ICE mkII , when I unpacked the kit I found that the quick guide users manual was missing. But a CD was there so, I was going through some pdf. Now, my question is to how to power the JTAG i.e I need some extra source or is there some method to provide the power through stk500. I connected the squid cable (6 pin outs) to SPROG3 (as I am using AT Mega16 micro).

Is there any tutorial for starting with JTAG ICE and stk500 on linux.

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

The more up to date manual for the JTAGICEmkII (and all the Atmel tools in fact) is inside the AVR studio help file in fact

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

...which is unusable if you only have Linux. Alas, the licensing
terms do not allow anyone to even redistribute the file outside of
the AVR Studio bundle. :-(

There are two possible power sources for the JTAG ICE mkII: the external
power supply jack on the ICE itself, or trough USB. The target power
can *not* be used to supply the ICE, but it must be routed to the appropriate
pin on the JTAG header since the internal level shifters use that voltage as
a reference.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

I supplied power through USB. and my connections with stk500 are like this one (using stk500 JTAG adapter) :-
as I am using AT Mega16 micro so, I put that adapter into 40 pin header towards SCKT3100A3. After that I inserted the JTAG of JTAGICE mkII into the SCKT3100A3. And supplied power to STK500 normally as I was already doing before, but this time I removed the serial programming cable and inserted it into the serial port of JTAGICE mkII.
Now to load the program I gave this command with the following output and program was loaded successfully (as I can see the blinking of leds)

[root@uthupmanoj cprograms]# avrdude -P /dev/ttyS0 -p m16 -c jtagmkII -U flash:w:simleflash.srec

avrdude: jtagmkII_set_devdescr(): timeout/error communicating with programmer (status -1)
avrdude: jtagmkII_initialize(): warning: OCDEN fuse not programmed, single-byte EEPROM updates not possible
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.06s

avrdude: Device signature = 0x1e9403
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: jtagmkII_initialize(): warning: OCDEN fuse not programmed, single-byte EEPROM updates not possible
avrdude: reading input file "simleflash.srec"
avrdude: input file simleflash.srec auto detected as Motorola S-Record
avrdude: writing flash (276 bytes):

Writing | ################################################## | 100% 0.28s

avrdude: 276 bytes of flash written
avrdude: verifying flash memory against simleflash.srec:
avrdude: load data flash data from input file simleflash.srec:
avrdude: input file simleflash.srec auto detected as Motorola S-Record
avrdude: input file simleflash.srec contains 276 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.33s

avrdude: verifying ...
avrdude: 276 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

Now, from above scenario I have some queries

1) Can I use USB cable for programming instead of serial cable. If possible, How?
2) Why this "avrdude: jtagmkII_set_devdescr(): timeout/error communicating with programmer (status -1)" coming ?
3) How can I do my fuse setting for OCDEN , JTAGEN and DWEN ?
4) As I have to debug my program , for the same any jumper settings required.

If I am doing anything right/wrong please let me know.
Waiting for quick, relevant response of yours.

Thanks,

Anmol Kumar

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

anmol2701 wrote:

> 1) Can I use USB cable for programming instead of serial
> cable. If possible, How?

You need to configure avrdude (and avarice) against libusb. Then you
can use "-P usb". See Bingo600's Linux build script on top of the
forum.

> 2) Why this "avrdude: jtagmkII_set_devdescr(): timeout/error
> communicating with programmer (status -1)" coming ?

No idea without seeing any debugging information. Does this happen
every time?

> 3) How can I do my fuse setting for OCDEN , JTAGEN and DWEN ?

If you've got JTAG, then the device does not have debugWire, and vice
versa.

JTAGEN is obviously set, otherwise your JTAG ICE wouldn't talk with
the target at all. Just don't touch that fuse.

OCDEN is bit 7 of the high fuse byte, see the datasheet. If you want
to set OCDEN, you can do this either in avrdude's terminal mode
(option -t) by

write hfuse 0 0x19

or through a -U option from the command-line

-U hfuse:w:0x19:m

Alternatively, if you don't need single-byte EEPROM write operations
(which is what terminal mode would use to write to the EEPROM), then
you can simply ignore that warning. AVaRICE will always try to enable
the OCDEN fuse at startup anyway.

> 4) As I have to debug my program , for the same any jumper
> settings required.

No further jumper settings. You need AVaRICE which acts as a proxy
between the JTAG ICE and GDB. Then, start AVR-GDB, and use the
"remote" command to connect to the running AVaRICE process.

Just search this forum, this has been discussed before.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

Hello Sir,

Quote:
You need to configure avrdude (and avarice) against libusb. Then you
can use "-P usb". See Bingo600's Linux build script on top of the forum.

I was unable to find out anything relevant related to usb from their. If I am trying to understand your words It sounds me that install avrdude again with some configure setting. If So, what is this/that.

Right now when I am giving the command for usb (like this one) its printing this message again and again..

[root@uthupmanoj cprograms]# avrdude -P usb -p m16 -c jtagmkII -U flash:w:simleflash.srec
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: jtagmkII_getsync(): sign-on command: status -1

Thanks,

Anmol Kumar

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

Since there's no complaint about the -P usb, it is successfully
using libusb. Something must be wrong later on. You could add
-vvvv (four "v"s) to get more debugging information.

Is this JTAG ICE running the most recent firmware? If not, please
upgrade (which alas, again, is only possible from AVR Studio).

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

Quote:
Is this JTAG ICE running the most recent firmware?

How can I know , which firmware is there? and which one is latest?

Moreover, it's working good with serial cable So, I did my some of pending works first ie.


1)
avrdude: jtagmkII_set_devdescr(): timeout/error communicating with programmer (status -1)

Its coming again and again for the same how can I provide debugging information to you?

2) I programmed OCDEN fuse using command #avrdude -P /dev/ttyS0 -p m16 -c jtagmkII -U hfuse:w:0x19:m Its successful.
:)

3) For debugging using avarice I am trying surely let you know the details after some time.

Thanks & Regards,
Anmol Kumar

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

My ICE is running firmware versions 4.38. This is probably not the
most recent one but it's working fine here. You can see the firmware
versions by adding one -v option.

As for debugging information, see above.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

Just check it out sir I think mine is 4.32 , If I need to upgrade how can I do it.

avrdude project: 
[root@uthupmanoj cprograms]# avrdude -v -P /dev/ttyS0 -p m16 -c jtagmkII -e 
avrdude: Version 5.5, compiled on Dec 18 2007 at 18:02:54
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         System wide configuration file is "/usr/local/etc/avrdude.conf"
         User configuration file is "/root/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port            : /dev/ttyS0
         Using Programmer      : jtagmkII
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              4.32
  hardware version:              0
S_MCU:
  boot-loader FW version:        255
  firmware version:              4.32
  hardware version:              1
Serial number:                   00:b0:00:00:2d:bd
Device ID:                       JTAGICEmkII
         AVR Part              : ATMEGA16
         Chip Erase delay      : 9000 us
         PAGEL                 : PD7
         BS2                   : PA0
         RESET disposition     : dedicated
         RETRY pulse           : SCK
         serial program mode   : yes
         parallel program mode : yes
         Timeout               : 200
         StabDelay             : 100
         CmdexeDelay           : 25
         SyncLoops             : 32
         ByteDelay             : 0
         PollIndex             : 3
         PollValue             : 0x53
         Memory Detail         :

                                  Block Poll               Page       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom         4    10   128    0 no        512    4      0  9000  9000 0xff 0xff
           flash         33     6   128    0 yes     16384  128    128  4500  4500 0xff 0xff
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0  0 0x00 0x00
           calibration    0     0     0    0 no          4    0      0     0  0 0x00 0x00

         Programmer Type : JTAGMKII
         Description     : Atmel JTAG ICE mkII
         M_MCU hardware version: 0
         M_MCU firmware version: 4.32
         S_MCU hardware version: 1
         S_MCU firmware version: 4.32
         Serial number:          00:b0:00:00:2d:bd
         Vtarget         : 5.0 V
         JTAG clock      : 891.7 kHz (1.1 us)

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.06s

avrdude: Device signature = 0x1e9403
avrdude: safemode: lfuse reads as E1
avrdude: safemode: hfuse reads as 19
avrdude: erasing chip

avrdude: safemode: lfuse reads as E1
avrdude: safemode: hfuse reads as 19
avrdude: safemode: Fuses OK

avrdude done.  Thank you.

Please let me know what is the funda of this 4 v's Please provide me some links (if possibel)

Thanks,
Anmol Kumar

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

Hello,

I upgraded it to 4.07 (Just check out below)

[root@uthupmanoj cprograms]# avrdude -v -P /dev/ttyS0 -p m16 -c jtagmkII -e

avrdude: Version 5.5, compiled on Dec 18 2007 at 18:02:54
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         System wide configuration file is "/usr/local/etc/avrdude.conf"
         User configuration file is "/root/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port            : /dev/ttyS0
         Using Programmer      : jtagmkII
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              4.07
  hardware version:              0
S_MCU:
  boot-loader FW version:        255
  firmware version:              4.20
  hardware version:              1
Serial number:                   00:b0:00:00:2d:bd
Device ID:                       JTAGICEmkII
         AVR Part              : ATMEGA16
         Chip Erase delay      : 9000 us
         PAGEL                 : PD7
         BS2                   : PA0
         RESET disposition     : dedicated
         RETRY pulse           : SCK
         serial program mode   : yes
         parallel program mode : yes
         Timeout               : 200
         StabDelay             : 100
         CmdexeDelay           : 25
         SyncLoops             : 32
         ByteDelay             : 0
         PollIndex             : 3
         PollValue             : 0x53
         Memory Detail         :

                                  Block Poll               Page       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom         4    10   128    0 no        512    4      0  9000  9000 0xff 0xff
           flash         33     6   128    0 yes     16384  128    128  4500  4500 0xff 0xff
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0  0 0x00 0x00
           calibration    0     0     0    0 no          4    0      0     0  0 0x00 0x00

         Programmer Type : JTAGMKII
         Description     : Atmel JTAG ICE mkII
         M_MCU hardware version: 0
         M_MCU firmware version: 4.07
         S_MCU hardware version: 1
         S_MCU firmware version: 4.20
         Serial number:          00:b0:00:00:2d:bd
         Vtarget         : 5.0 V
         JTAG clock      : 891.7 kHz (1.1 us)

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.06s

avrdude: Device signature = 0x1e9403
avrdude: safemode: lfuse reads as E1
avrdude: safemode: hfuse reads as 19
avrdude: erasing chip

avrdude: safemode: lfuse reads as E1
avrdude: safemode: hfuse reads as 19
avrdude: safemode: Fuses OK

avrdude done.  Thank you.

But when I give the same command using usb its responding like this ..

[root@uthupmanoj cprograms]# avrdude -v -P usb -p m16 -c jtagmkII -e

avrdude: Version 5.5, compiled on Dec 18 2007 at 18:02:54
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         System wide configuration file is "/usr/local/etc/avrdude.conf"
         User configuration file is "/root/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port            : usb
         Using Programmer      : jtagmkII
avrdude: usbdev_open(): Found JTAGICE mkII, serno: 00B000002DBD
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: jtagmkII_getsync(): sign-on command: status -1

But when I again erase the device using /dev/ttyS0 see some timeout/error is coming whats this?

[root@uthupmanoj cprograms]# avrdude -P /dev/ttyS0 -p m16 -c jtagmkII -e

avrdude: jtagmkII_set_devdescr(): timeout/error communicating with programmer (status -1)
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.06s

avrdude: Device signature = 0x1e9403
avrdude: erasing chip

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

Thanks,

Anmol Kumar

Last Edited: Thu. Feb 7, 2008 - 08:00 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is a long shot, but when I was first trying to get avrdude working with a JTAG ICE MKII I was have *extremely* similar symptoms. Same kind of time-outs, the exact same error messages.

After trying everything and verifying that everything was set up exactly as documented, my intuition told me that there was a subtle timing issue, either in libusb, in my host system's built-in USB hub, or in the JTAG ICE, in the way one (or two, or all) of them implement USB. So, I tried inserting a USB hub (a good quality one) just to see if it would tolerate and/or clean up and/or change any timing issues going on between my host the the MK II. It was an instant success and has been rock solid ever since. Why that is, I'm not exactly sure. I chased all the transactions all the way through the libusb source code, and couldn't see anything wrong.

Good luck,
-dave

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

Quote:
It was an instant success and has been rock solid ever since

So, you also expect me the same :idea: For the time being from where should I hit to get the same instant success ?

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

Quote:
So, you also expect me the same

I can heartily wish you the same success -- but unfortunately since I never understood why my system wasn't working, I can't say for sure that this will help you. But for me those same symptoms were inexplicable for any other reason except for something in the chain not doing USB 100% correctly -- and the hub cleaned it up. So... I suggest that borrowing a good USB hub from somebody is a cheap experiment. After you have satisfied yourself that everything else is OK, of course. In my case, I could dual boot to Windows (forgive me, I was desperate...) and verify that AVR Studio could talk to the MK II.

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

> I upgraded it to 4.07

*up*graded? You downgraded it from 4.32/4.32 to 4.07/4.20.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

Sorry for such a silly mistake. But I changed it to 4.38. (Check it below)

[root@uthupmanoj ~]# avrdude -v -P /dev/ttyS0 -p m16 -c jtagmkII -e

avrdude: Version 5.5, compiled on Dec 18 2007 at 18:02:54
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         System wide configuration file is "/usr/local/etc/avrdude.conf"
         User configuration file is "/root/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port            : /dev/ttyS0
         Using Programmer      : jtagmkII
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              4.38
  hardware version:              0
S_MCU:
  boot-loader FW version:        255
  firmware version:              4.38
  hardware version:              1
Serial number:                   00:b0:00:00:2d:bd
Device ID:                       JTAGICEmkII
         AVR Part              : ATMEGA16
         Chip Erase delay      : 9000 us
         PAGEL                 : PD7
         BS2                   : PA0
         RESET disposition     : dedicated
         RETRY pulse           : SCK
         serial program mode   : yes
         parallel program mode : yes
         Timeout               : 200
         StabDelay             : 100
         CmdexeDelay           : 25
         SyncLoops             : 32
         ByteDelay             : 0
         PollIndex             : 3
         PollValue             : 0x53
         Memory Detail         :

                                  Block Poll               Page       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom         4    10   128    0 no        512    4      0  9000  9000 0xff 0xff
           flash         33     6   128    0 yes     16384  128    128  4500  4500 0xff 0xff
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0  0 0x00 0x00
           calibration    0     0     0    0 no          4    0      0     0  0 0x00 0x00

         Programmer Type : JTAGMKII
         Description     : Atmel JTAG ICE mkII
         M_MCU hardware version: 0
         M_MCU firmware version: 4.38
         S_MCU hardware version: 1
         S_MCU firmware version: 4.38
         Serial number:          00:b0:00:00:2d:bd
         Vtarget         : 5.0 V
         JTAG clock      : 891.7 kHz (1.1 us)

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.06s

avrdude: Device signature = 0x1e9403
avrdude: safemode: lfuse reads as E1
avrdude: safemode: hfuse reads as 19
avrdude: erasing chip

avrdude: safemode: lfuse reads as E1
avrdude: safemode: hfuse reads as 19
avrdude: safemode: Fuses OK

avrdude done.  Thank you.

Even now USB is not working

[root@uthupmanoj cprograms]# avrdude -P usb -p m16 -c jtagmkII -U flash:w:simleflash.srec
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: jtagmkII_getsync(): sign-on command: status -1

Pages