Note: STK500 FW 2.00 and avrdude Problem

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

After upgrading my STK500 firmware successfull in AVR-Studio v4.11 build 401, it's not possible to use the STK500 with avrdude.

Command line:
avrdude -p atmega8 -P com1 -c stk500 -U flash:w:main.hex

Error message:
avrdude: stk500_getsync(): not in sync: resp=0x00

STK500 Revision:
Hw: 0x02, Sw. major: 0x02, Sw. minor: 0x00

Using the STK500 through AVR-Studio is possible without problems.

After some debugging it seems at least the synch phase changes completely. Found the following using an COM port logger.

First AVR-Studio:

AVRStudio.exe	IOCTL_SERIAL_SET_BAUD_RATE	Serial0	SUCCESS	Rate: 115200	
AVRStudio.exe	IOCTL_SERIAL_CLR_RTS	Serial0	SUCCESS		
AVRStudio.exe	IOCTL_SERIAL_SET_DTR	Serial0	SUCCESS		
AVRStudio.exe	IOCTL_SERIAL_SET_LINE_CONTROL	Serial0	SUCCESS	StopBits: 1 Parity: NONE WordLength: 8	
AVRStudio.exe	IOCTL_SERIAL_SET_CHAR	Serial0	SUCCESS	EOF:0 ERR:0 BRK:0 EVT:0 XON:11 XOFF:13	
AVRStudio.exe	IOCTL_SERIAL_SET_HANDFLOW	Serial0	SUCCESS	Shake:1 Replace:0 XonLimit:2048 XoffLimit:512	
AVRStudio.exe	IOCTL_SERIAL_SET_TIMEOUTS	Serial0	SUCCESS	RI:0 RM:0 RC:1000 WM:0 WC:1000	
AVRStudio.exe	IRP_MJ_WRITE	Serial0	SUCCESS	Length 7: 1B 01 00 01 0E 01 14 	
AVRStudio.exe	IOCTL_SERIAL_SET_TIMEOUTS	Serial0	SUCCESS	RI:0 RM:0 RC:200 WM:0 WC:1000	
AVRStudio.exe	IRP_MJ_READ	Serial0	SUCCESS	Length 5: 1B 01 00 0B 0E 	
AVRStudio.exe	IRP_MJ_READ	Serial0	SUCCESS	Length 12: 01 00 08 53 54 4B 35 30 30 5F 32 02 	

Second avrdude:

avrdude.exe	IOCTL_SERIAL_SET_BAUD_RATE	Serial0	SUCCESS	Rate: 115200	
avrdude.exe	IOCTL_SERIAL_CLR_RTS	Serial0	SUCCESS		
avrdude.exe	IOCTL_SERIAL_CLR_DTR	Serial0	SUCCESS		
avrdude.exe	IOCTL_SERIAL_SET_LINE_CONTROL	Serial0	SUCCESS	StopBits: 1 Parity: NONE WordLength: 8	
avrdude.exe	IOCTL_SERIAL_SET_CHAR	Serial0	SUCCESS	EOF:0 ERR:0 BRK:0 EVT:0 XON:0 XOFF:0	
avrdude.exe	IOCTL_SERIAL_SET_HANDFLOW	Serial0	SUCCESS	Shake:0 Replace:0 XonLimit:0 XoffLimit:0	
avrdude.exe	IOCTL_SERIAL_SET_TIMEOUTS	Serial0	SUCCESS	RI:0 RM:0 RC:0 WM:0 WC:0	
avrdude.exe	IOCTL_SERIAL_SET_TIMEOUTS	Serial0	SUCCESS	RI:250 RM:250 RC:250 WM:0 WC:0	
avrdude.exe	IRP_MJ_READ	Serial0	TIMEOUT	Length 0: 	
avrdude.exe	IOCTL_SERIAL_SET_TIMEOUTS	Serial0	SUCCESS	RI:500 RM:500 RC:500 WM:0 WC:0	
avrdude.exe	IRP_MJ_WRITE	Serial0	SUCCESS	Length 2: 30 20 	
avrdude.exe	IOCTL_SERIAL_SET_TIMEOUTS	Serial0	SUCCESS	RI:5000 RM:5000 RC:5000 WM:0 WC:0	
avrdude.exe	IRP_MJ_READ	Serial0	TIMEOUT	Length 0: 	
avrdude.exe	IOCTL_SERIAL_SET_TIMEOUTS	Serial0	SUCCESS	RI:250 RM:250 RC:250 WM:0 WC:0	
avrdude.exe	IRP_MJ_READ	Serial0	TIMEOUT	Length 0: 	
avrdude.exe	IRP_MJ_CLEANUP	Serial0	SUCCESS		
93	0.00875726	avrdude.exe	IRP_MJ_CLOSE	Serial0	SUCCESS

Third in Brays terminal program:
Send:
$1B$01$00$01$0E$01$14 

Receive (hex):
1B 01 00 0B 0E 01 00 08 53 54 4B 35 30 30 5F 32 02 

What the change log says in STK500 help file:

December 6th, 2004 - v2.00

Added full device support for ATmega2560 (requires STK503)
Added full device support for ATmega2561 (requires STK503)

No note about protocol changes. :(

From what I saw in Colins JTAG mkII reverse engineering thread, it seems that Atmel uses now a standard protocol for all development hardware.

Last Edited: Sat. Jan 15, 2005 - 11:42 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dear Mr MIC

Which Com port logger did you use ?
This is really interesting.
Could you please send me a link where I can download this software ?

Cheers
Rubi

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

Hi,

This could be quite the pickle - I haven't updated my STK500 yet to try myself, but it looks to be like you are correct about the new common protocol for Atmel dev tools. Has anyone seen if the JTAG ICE follows suit by chance?

Regards,

-Colin

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

I downgraded my STK500 back to firmware v1.12 and voila, avrdude works fine.

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

It may not be only AVRdude who is experiencing problems. Since I upgraded AVRISP to firmware 2.0, I cannot program the target device anymore using CodeVision AVR. Works fine using AVRStusio 4.10 + AVRISP

I posted a question on the CodeVisionAVR Yahoo newsgroup and waiting to find out if other people are also experience this problem.

Gaetan.

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

I reloaded the firmware from AVRStudio 4.10 on the STK500 and Atmel AVRISP and now CodeVisionAVR can once again program the target devices.

It seem to confirm what Michael has observed earlier ... the FW 2.0 changes the communication protocol resulting in failure of the tools relying on the previous protocol.

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

Hmm..

Can one still use Studio 4.11 with 4.10 firmware in the STK500
I mean program from Studio 4.11

Well Atmel how about releasing the info on the new protocol.

You have a lot of users including me , that chose AVR for 2 reasons :

1: Its better than Pic

2: The "free" development environment.

If i had to pay IAR price for a CC , then i'd have chosen another platform with had free devel tools. (maybe the TI 430).

Hopefully you make your $$ on selling chips , not emulators etc....

/Bingo

Last Edited: Sun. Jan 16, 2005 - 11:49 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Can one still use Studio 4.11 with 4.10 firmware in the STK500
I mean program from Studio 4.11

Yes, I tried v4.11 with STK500 firmware v1.12. Programming works, also fuse setting and board parameter change.

But you have to live with this upgrade reminder pop-up when you open the STK500 dialog window.

Quote:

1: Its better than Pic

The most important reason... :D

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

Well i have 4.09 installed now , so i'd better install 4.10 first , and then 4.11
in order to get the V 1.12 installed

/Bingo

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

Mr MIC wrote:
Quote:

But you have to live with this upgrade reminder pop-up when you open the STK500 dialog window.

I hate this reminder, one time is okay, but everytime is driving me nuts,...
I built USBisp, a great programmer and there I allready get this upgrade message everytime,...

There should be a posibillity to switch this of, but I had not found it yet.

Cheers
Rubi

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

GOTCHA :D

Found it:
Open Registry with Regedit, browse to:
HKEY_LOCAL_MACHINE\SOFTWARE\Atmel\AVRTools\STK500

Change DWORD:
VersionMajor to 0x01
VersionMinor to 0x12

and the pop-up is history... :)

Works with the version you send me Rubi.

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

Oh, nice find!

Another option is to change the firmware reported in the STK500, if you have a dissasembler its pretty easy (see http://www.newae.com/old_site/fi...).

Regards,

-Colin

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

Mr Mic

THANKS !!!!!

Super cool.

THANKS!!!!

:D :D :D :D :D

Cheers
Rubi

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

Mr MIC wrote:
I downgraded my STK500 back to firmware v1.12 and voila, avrdude works fine.

I ran in the same trouble as Mr MIC after upgrading my STK500 to firmware V2.00.
How can I downgrade the STK500 back to firmware V1.12?

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

To downgrade to the previous firmware, you need to un-install Studio 4.11 and re-install 4.10.

Next are the procedures to perform a manual firmware upgrade (taken from the STK500 User's Guide)

Quote:
STK500 Manual Firmware Upgrade

The current version of AVR Studio will automatically detect any old STK500 firmware version and request the user to upgrade the firmware. If for some reason the upgrade fails (the serial cable is detached during upgrade, the power goes out, ...) the next time the AVR Studio tries to connect to the STK500, the board will not be detected and the automatic upgrade procedure will not start.

Following is a procedure on how to manually upgrade a STK500 board. This procedure should work in all cases:

1- Power off the STK500

2- Push the 'PROGRAM' button (located near the AT45D021 dataflash) while powering up the STK500

3- Start AVR Studio and make sure there is a serial connection between the PC and the STK500 DSUB9 marked 'RS232 CTRL'

4- Start the program 'Avr Prog' located in the AVR Studio 'Tools' menu

5- Locate the firmware upgrade hex-file 'stk500.ebn' by pushing the 'Browse'-button in the 'Avr Prog Hex File'-window. The path for the 'stk500.ebn' for a normal AVR Studio installation is "C:\Program Files\Atmel\AVR Tools\STK500".

6- Push the 'Program'-button in the 'Avr Prog Flash'-window. A progress bar will now appear while showing additional information messages. Wait until the verify operation is finished.

7- Close the 'Avr Prog' program

8- Power off and on the STK500 PCB. The STK500 is now ready to be used with the new firmware.

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

Quote:
To downgrade to the previous firmware, you need to un-install Studio 4.11 and re-install 4.10.

Reinstall is not needed. Just replace the stk500.ebn file (make a backup) with the one from the attachment and run the upgrade procedure.

stk500.ebn is located in your AVR-Studio folder.
ie: C:\Atmel\AVR Tools\STK500

Attachment(s): 

Last Edited: Mon. Jan 31, 2005 - 05:49 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If someone from Atmel "AVR-Tools" is reading this thread:
Are there plans to update Application-Note AVR061 ("STK500 Communication Protocol")?
Regards,
Martin Thomas

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

Thanks to MrMIC and gsimard:

Downgrading STK500 and patching registry to avoid reminders
work fine.

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

mjthomas wrote:
If someone from Atmel "AVR-Tools" is reading this thread:
Are there plans to update Application-Note AVR061 ("STK500 Communication Protocol")?

The new protocol is described in AVR068: STK500 Communication Protocol

https://www.avrfreaks.net/index.php?module=FreaksFiles&func=viewFile&id=1261&showinfo=1

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

Hallo Mr MIC

Your attached file is an empty Zip-File.

What to do with it?

Thanks in advance

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

Hmm, it seems there is one more forum bug. The ZIP on my PC decompresses fine. But the one from attached download says: Unexpected archive end, also the CRC is zero. It's the same for the RAR file :(
I can mail you the file if you want.

About the bug:
The original RAR file is 9332 byte. The one from download is only 9317 byte.
Original ZIP: 8252 byte Download: 8237 byte

Result: both times 15 bytes missing :?:

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

Hallo and thanks for you quick answer.

Please send it to Sebastian132 _ätt_ t-online.de

(replace '_ätt_' by @)

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

Mr MIC wrote:
Hmm, it seems there is one more forum bug. The ZIP on my PC decompresses fine. But the one from attached download says: Unexpected archive end, also the CRC is zero. It's the same for the RAR file :(
I can mail you the file if you want.

Hi Michael,

I'd be grateful if you could email me a copy of the file as well. If anyone else wants a copy, I can stick it on the web somewhere.

Dan

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

Erlendh has fixed the ZIP/RAR corruption bug. Both links above will work now.

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

I too began having problems after upgrading to AVRstudio 4.11 firmware.....So I tried the downgrade. I uninstalled 4.11 andinstalled 4.10. I tried to run "AVR Prog" but I am getting a error message "No supported board found! AVR Prog Version 1.37".

Any ideas? I've been working this problem all day and am getting really disgruntled. Did i toast my board some how?

HELP!!!

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

It works now! tried a fresh install on a third computer and it works!

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

Hi guyzz

Is the V1.12 version of STK-500 sw the 4.10 version ???

When i go into Studio it tells me that my STK-500 vers is 1.46 , im running Studio 4.09 (not 4.08 as i told elsewhere)

I was wondering if i should install 4.10 , to get that .ebn file , and then upgrade to 4.11 , saying no to STK-500 upgrade
Then doing a manual upgrade of the STK-500 with the 4.10 .ebn file , and correct the registry.

/Bingo

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

I did upgrade to 1.12 and corrected the HKEY... in Windows

STK is still alive & kicking :-)

Ohh Btw (It said it was V 1.0F , in the STK-500 upgrade box , not 1.46)

Thanx all for the hints

/Bingo

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

I recently downgraded my STK500 and AVRISPs to V1.12, so I can use them with AVR Studio 3 and AVRDUDE. I had to use AVR Studio 4 to program a AT90CAN128, and it failed verification anytime I programmed something >64k. This was the case with both the STK500 and AVRISP. Determined to figure this out and not upgrade my programmer I found that Atmel has switched from sending a word-address with the STK_LOAD_ADDRESS command to sending a byte-address. The programmer skips every other page while programming, because instead of sending 0x0080 to set the address the 256th byte, AVR Studio sends 0x0100 instead.

Has anyone else had problems programming flash with V1.12 in AVR Studio 4?

Thanks,
Louis Beaudoin

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

If you downgraded your STK500 for use with avrdude, then you may try the avrdude version made by Martin Thomas. This version includes support for STK500 protocol version v2.
Download: http://www.siwawi.arubi.uni-kl.de/avr_projects/index.html#avrdudew32

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

I have the same question - how do I downgrade! :)

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

It's well descripted on page 2 of this topic, including the file attachments you need to downgrade your STK.
Start here: https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=133583#133583

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

I have just bough what i thought was the STK, but the downgrade insructions don't work. I have an AVR ISP In-System Programmer (http://www.atmel.com/dyn/product...).

I have followed the manual firmware instuctuctions and the Tools>AVR prog says "No Supported board found, AVR prog version 1.40".

can anyone help me...
a) Not downgrade and use AVRdude (<---please, this one!)
b) Downgrade the AVR ISP so as I can use AVRDude.

This is my first programmer, which I haven't yet used, I hope I haven't screwed it up, I want to light my LED!

Thanks guys - You're always a help!

AVR Studio 4.11.406 Service Pack 2
GUI Version 4, 11, 0, 402
(damn this for coercing me into upgrading!)

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

Mr MIC wrote:
If you downgraded your STK500 for use with avrdude, then you may try the avrdude version made by Martin Thomas. This version includes support for STK500 protocol version v2.
Download: http://www.siwawi.arubi.uni-kl.de/avr_projects/index.html#avrdudew32

Hi all,

Martin's version of avrdude works fine for me. Test it before downgrading!

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

Just got bit by this - I normally use uisp and I was trying out AVR Studio and got asked to do the upgrade. I said yes, uisp stops working.

Here is an easier way to downgrade the stk500 firmware, even if you don't have avr studio 4.10 (it is impossible to get now):
- Install AVR studio 3.56 (comes on disk in stk500 kit)
- Connect stk500 to serial on PC
- Hold down program button, power on board
- (assuming default install location) Browse to C:\Program Files\Atmel\AVR Studio\Stk500
- Run upgrade.exe - you will see the upgrade dialog

This will install firmware version 1.14.

To the head avrfreaks: It is really nice to archive previous version of software. It is absolutely impossible to find AVR Studio 4.10 and other old versions, I'd expect to find it on a website like this.

Regards,
kwr

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

Warning, I'm totally new to this so you take my advice at your own risk.

I was having the problem with an upgraded firmware on my stk500 preventing AVRDude from working properly until I found some instructions here: http://www.engr.sjsu.edu/bjfurman/courses/ME106/ME106pdf/intro-atmel.pdf

Quote:

The important step to take if you get a message like:
avrdude: stk500_getsync(): not in sync: resp=0x00
when you try to use AVRdude to program the microcontroller is to change the line in the makefile that begins with AVRDUDE_PROGRAMMER =, so it reads:
AVRDUDE_PROGRAMMER = stk500v2

That worked great for me.

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

pdinnen: That worked great, thanks.

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

Does anybody have instructions on how to downgrade the firmware on AVR ISP? It doesn't communicate with AvrDude(i want to use avrdude) but it works fine with AVR Studio 4

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

This thread is more than two years old (January 2005), and the problems and solutions listed here have been obsolete for more than one year now.

The preferred solution today would be to upgrade to a halfway recent version of avrdude (all versions included with WinAVR since release 20060125 would suffice), and modify the command line parameters to use "-c avrispv2" instead of "-c avrisp".

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

lfmorrison wrote:
This thread are more than two years old (January 2005), and the problems and solutions listed here have been obsolete for more than one year now.

The preferred solution today would be to upgrade to a halfway recent version of avrdude (all versions included with WinAVR since release 20060125 would suffice), and modify the command line parameters to use "-c avrispv2" instead of "-c avrisp".

Will it work with avrdude gui.exe just by updating the avrdude ?

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

I don't think so. avrdude-gui doesn't have a maintainer right now, so it isn't synchronized with updates to avrdude.

As it stands right now, avrdude-gui is probably not structured as optimally as it could be -- ideally, it would parse the avrdude.conf file and fill in all the supported programmer and MCU types accordingly. If that were the case, then there wouldn't need to be any special attention paid to updating the GUI component as new support was added to the back-end. But that's not how the software was designed, and I don't think anybody's volunteered yet to bring it up to date.

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

I insert in the latest avrdude.conf into avrdue-gui, but it didn't work. It's sad to hear that nobody volunteer for such a good project to start out with.

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

As I said, avrdude-gui.exe ignores the .conf file and uses a hard-coded set of programmers and chips.

avrdude-gui.exe doesn't do any of the actual work of programming a chip -- all it does is formulate the command line options to pass to avrdude.exe. Then avrdude.exe does the hard work.

If you invoke avrdude.exe (at least version 5.0 if you need to use AVRSIP protocol version 2) from the command line directly with appropriate options (as specified in another thread you've opened in the avr-gcc forum) then things will go well. If you want to, there are even options available in a WinAVR makefile that cause the HEX and EEP files to be automatically programmed via AVRDUDE, by entering the command "make program" either on the command line or in the Programmer's Notepad IDE.

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

Thank You Very Much

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

Thanks a lot. :) I got my WinAVR setup working now using "-c STK500v2"