STK500V1 bootloader

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

Hey,
I have wrtten a bootloader which is stk500v1 compatible.

My problem is that even though it runs perfectly with avrdude in cmd prompt as well as winavr but the board is not even detected in AVRstudio.. so does anyone know how avrstudio stk500 works?

i havent included all the commands in my bootloader and am not planning to do so. so i just need those commands that avrstudio needs..

(P.S: Clawson, i broke my own record, this bootloader took just 2 days! Which, reminds me, forums can also be used for bragging! ) :P

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

Quote:

this bootloader took just 2 days!

Surely this thread suggests that it is not finished yet as you are still in the testing/debugging phase (often the longest part of a project) ;-)

BTW are you talking about the bootloader protocol that the STK500 uses to apply updates to it's own firmware (it has a separate small micro specifically for this job that comes into play when the "PROGRAM" button is held) or are you talking about the main programming protocol use between Studio and the the STK500?

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

I'm talking about the main programming protocol.
Well, actually, i solved the avrstudio-not-detecting problem(I just wasn't sending the "AVR STK" string right)
So now the STK500 gui opens. but it doesn't perform operation right. I'm pretty sure that since i haven't included all commands, one of them is not recognised.. (I could use your EEPROM idea But i just want to know which command exactly is it..)
Since lot of ppl here have developed STK500 bootloaders, i could use some help..

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

In version 2 of the STK500 communication protocol, it is possible to tell AVR Studio to dump a log of all of its communication with the STK500 to a file. The instructions to generate such a log file are detailed in section 7.3 of application note AVR068.

I don't know for certain if such logging can also be performed when AVR Studio is using version 1 of the STK500 communication protocol. But if it is possible, then such a log would probably give you insight into exactly which command is failing.

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

Hey thanks a lot. I found this log option in stk500v1 too.. this will make things easier..

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

OK, i have avrstudio 4.17
So when i say stk500, does it assume to be v2??
This i found out when i tried the stk command in the command prompt.. it give's an error message saying could not connect to stk500v2
does that mean i should have written the bootloader for v2?

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

Quote:

So when i say stk500, does it assume to be v2??

That was my suspicion and the reason I thought this wold not work for you using protocol V1 unless the dialog starts by saying "OK, which protocol are we talking today" and then it falls back to V1 support if that's all that is on offer.

But I think what actually happens is that Studio actually starts by saying "which version of firmware do you have?" to the STK500 and if it doesn't say "Vn.n" (i.e. the latest) then Studio goes into its "OK, lets get this STK500 upgraded routine". Once that is complete it knows the board has firmware that can do protocol V2 so doesn't need to consider V1.

It's certainly the case that with almost every release of Studio the first thing that has happened when it first connects to an STK500 is the upgrade firmware routine.

I had a look earlier but I don't see any configuration anywhere within Studio where you can actually tell it "use V1 not V2 protocol".

Cliff

PS Does that mean this whole exercise is going to have taken a little more than 2 days if you find youself having to implement V2 from AVR068? ;-) (not gloating, honest!)

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

yeah.. :( .. New day, new protocol.. thanks to you guys, i still feel confident..

but Cliff, that means, my stk500v1 bootloader was perfect coz it worked from avrdude.. So "2days" still stands.. ;)

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

But I thought you said that it worked (in 2 days), but just had verification errors.

David.

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

Ya, it does work. but with avrdude stk500v1. It doesn't even have verification errors..
The problem is avrstudio doesn't have stk500v1 support.. So now, i have to write a bl for V2..

(@david: the avr109 bl had verification errors with avrprog from avrstudio, and that's why i decided to try stk500. The thing is, my project doesn't have a deadline yet. So i want to try as many things as possible..)

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

Quote:

the avr109 bl had verification errors with avrprog from avrstudio, and that's why i decided to try stk500.

Would that be the 2 day version of the program? ;-)

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

Hey! I would have to repeat the same thing.. I have written bootloader for avr109 and "tried" to make it work for avrprog, which didn't work coz avrprog uses avr910. I stopped attempting to do that coz many threads said avrprog has been discontinued and it may not be there in future releases of avrstudio.

You see, the bootloaders(both avr109 and stk500) work fine with avrdude but in both cases i realized that avrstudio does not support it..
This is my final attempt to make an avrstudio compatible bl

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

I know I bang on at length about prior, tested work but at the very least have you taken a look at Dean's Buttload source which "talks" the protocol?

(Crikey, I just typed "Four Walled Cubicle" into Google to find Dean's site and Google tells me that phrase hits 1.97 million websites - with Dean's listed as number one!!)

Dean's web site leads back to the project: https://www.avrfreaks.net/index.p...

I imagine that v2protocol.c in the .zip is going to be the file of interest ;-)

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

adwaitsdeshpande wrote:
Hey! I would have to repeat the same thing.. I have written bootloader for avr109 and "tried" to make it work for avrprog, which didn't work coz avrprog uses avr910. I stopped attempting to do that coz many threads said avrprog has been discontinued and it may not be there in future releases of avrstudio.

You see, the bootloaders(both avr109 and stk500) work fine with avrdude but in both cases i realized that avrstudio does not support it..
This is my final attempt to make an avrstudio compatible bl

Studio makes no attempt to burn program that it has just assembled or compiled. (Unless you are using a suitable debug platform like JTAG-mkII or Dragon)

You can of course run AvrProg from the Tools menu. Or a Studio-compatible programmer from the Programmer menu.

AVR910 programmers will run from AvrProg.
AVR109 programmers will run from AvrProg.
STK500 compatible programmers will run from the Programmer menu. Avrdude not surprisingly can do everything.

So the Fleury stk500v2bootloader will work with either. And CodeVision for example will incorporate several of these painlessly.

No doubt there are many other flavours. Personally I would stick to those that do not need a special PC program.

So perhaps your day#3 could be used seeing where you have gone wrong.

David.

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

Yup, i have seen both the bootloaders. (I had seen blips long time ago).. So i will learn from them now..