Arduino Forum

Forum 2005-2010 (read only) => Hardware => Development => Topic started by: kimio on Jul 27, 2008, 01:03 am

Title: Burning the Bootloader without  AVR-Writer
Post by: kimio on Jul 27, 2008, 01:03 am
I found the method to write in bootloader at by Diecimila oneself without external AVR-writer.

Plese visit this page

http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html

This page was generated  by Japanese - English automatic translator.
Title: one use for X3 connector
Post by: adilson on Jul 27, 2008, 01:05 am
Uh, very interesting!

(I was trying to reply your previous post, but it disapeared! But I've found it here again.)

If it works as described, people that asked about X3 connector functionality (in many posts) will achieve an answer.

[edit]I was thinking if it would be possible to use this method to upload a sketch without the bootloader, instead of to burn the bootloader, the same way we do using an external programmer.[/edit]
Title: Re:  Burning the Bootloader without  AVR-Writ
Post by: madworm on Jul 27, 2008, 02:18 am
cool :-)

now that I've just ordered an avr writer, I'll have two.
Title: Re:  Burning the Bootloader without  AVR-Writ
Post by: melka on Jul 27, 2008, 02:26 am
I'll give it a try as soon as possible ! This is really interesting stuff !!
Title: Re:  Burning the Bootloader without  AVR-Writ
Post by: melka on Jul 30, 2008, 02:10 pm
kimio, this sems to work with an Arduino NG. The pinout is exactly the same so no changes needed.
I don't have any blank ATm168 (only a spare one with the bootloader already burned) so I haven't yet tried to upload the bootloader, but the first tests are ok, avrdude-serjtag returns 0x1e9406.
Thanks a lot man, now I can finally write any ATm168 with the Arduino only ^^
Title: Correction
Post by: kimio on Aug 01, 2008, 04:09 am
There was a mistake about writing the lock-bit in my Web page. I corrected it.
When you test please see the new page.
Regards.
Title: Re:  Burning the Bootloader without  AVR
Post by: torontogeek on Aug 03, 2008, 02:44 am
Hi,

I have to do a rev B of the LEDuino ( http://siliconrailway.com ) board.

I have had this type of programming mechanism working on other things, particularly an ATmega128 based board. Would anyone care to comment on the desirability of including this as a feature on a new spin?

John
Title: Re:  Burning the Bootloader without  AVR
Post by: graey on Aug 05, 2008, 07:26 pm
I saw this earlier on but didn't have any headers, so I bought some and was ready to go, to see that the page went down. Google has it in cache, but without the pictures and I really could use those, anyone got a different guide / mirror? (couldn't find them on google myself, but I did try)
Title: Re:  Burning the Bootloader without  AVR
Post by: dcb on Aug 06, 2008, 11:00 pm
That is pretty sweet :)  It would be cool if there was a "burn bootloader with avrdude-serjtag" arduino option.
Title: Re:  Burning the Bootloader without  AVR
Post by: follower on Aug 07, 2008, 09:28 am
Quote
the page went down. Google has it in cache, but without the pictures and I really could use those, anyone got a different guide / mirror? (couldn't find them on google myself, but I did try)

Ummm, FWIW the page is still there for me...

--Phil.
Title: Re:  Burning the Bootloader without  AVR-Writ
Post by: melka on Aug 10, 2008, 12:03 am
Well, I did not receive my blanck mega168, so I erased the only one with the bootloader that I had. Trying to upload from the Arduino IDE returned an error. Normal. I burned the bootloader with the avrdude-serjtag, it worked perfectly ^^

I think I'll soon try to burn a .hex file written with AVRstudio or other, to see if this works (don't see why it shouldn't), and I'll try to order some tiny13 and/or other avr chips, to try to use this programmer to burn programs on ohter chips ...

So, the only thing I can say : thanks again kimio ^^
Title: Re:  Burning the Bootloader without  AVR-Writ
Post by: melka on Sep 12, 2008, 04:04 am
Kimio : you might want to add your technique to the playground, on this page
http://www.arduino.cc/en/Hacking/Bootloader

There are still a lot of people asking about burning the bootloader, and a lot still answers with "you need to buy an external programmer"

Cheers
Title: Re:  Burning the Bootloader without  AVR-Writ
Post by: sfreak on Sep 13, 2008, 02:49 am
I tried your instructions yesterday since my Diecimila went dead (rapidly flashing LED L, bootloader not responding). Worked like charm! Thank you very much! I tried for hours to find a working solution for the FT232R bit-bang mode without success before coming across your page. Should definitely be mentioned on all the important Wiki pages.

I did it a bit differently that you suggest though: I soldered a female header into X3 so I can use the same cables I have anyway for working with Breaboards. The cables I connected to the 11-13 and RESET pins (reset pin is probably not really necessary since it's possible to use the auto-reset traces).

I had to call avrdude by hand though. Is there any documentation on the programmers.txt file? I couldn't figure out how to integrate the new programmer.

Thanks for the good work! Saved my day :-)
Greetings,
Sebastian

PS: I added a fourth wire to RESET after taking the picture:
(http://www.thebackend.de/~sb/bitbang.jpg)
Title: Re:  Burning the Bootloader without  AVR-Writ
Post by: madworm on Sep 13, 2008, 04:05 am
Quote
Kimio : you might want to add your technique to the playground, on this page
http://www.arduino.cc/en/Hacking/Bootloader

There are still a lot of people asking about burning the bootloader, and a lot still answers with "you need to buy an external programmer"

Cheers


I wouldn't consider this as "hacking", but regular usage :-)

There's already a link to his site in the playground: http://www.arduino.cc/playground/Hacking/AvrdudeFTDIBitbang

If he likes to add in depth explanations, I suggest to bundle it there and not split it to several different locations.
Or at least add crosslinks to each article.
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: raphihell on Oct 15, 2008, 05:34 am
Looks great- anyway this could work with a mac and a terminal?
If so Id love to hear it! Lots of folks who use arduino use it because its one of the few mac friendly micorcontroller systems out there....
Thanks!
Raphael
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: sfreak on Oct 15, 2008, 05:43 am
I used a Mac to flash my Arduino! Instructions work with very few changes. Can't remember exactly, but most likely you only have to adjust the device file used.
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: raphihell on Oct 15, 2008, 07:16 am
could you be a little clearer- for example are you using the terminal ?
R
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: sfreak on Oct 15, 2008, 07:50 am
Aaaah, that was rubbish, sorry. Now I remembered: I actually used Windows in a Parallels VM. Sorry for the confusion :-)
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: raphihell on Oct 15, 2008, 03:40 pm
! ah you got my hopes up!
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: kg4wsv on Oct 15, 2008, 05:51 pm
I use avrdude and the AVRispmkII (USB model) on Mac OS to burn bootloader to hand-built Arduino clones, as well as program Arduino derived circuits.

-j

Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: raphihell on Oct 15, 2008, 06:03 pm
I see, another piece of hardware- thats okay if necessary.
Im sort of new to all this,but can deal with the arduino interface- If I get that box, is it pretty straight forward to plug it into the arduino and burn the bootloader with it- I havent used the terminal before if thats necessary, but can follow instructions.

Question:
I just basically want to take the code I have written for the arduino and multiply it out to about 10 naked chips. and then embed them in a circuit. I wont need to talk to them later, or plug them into usb .
DO I still need to burn the bootloader?


Question2, Either  if I have that box (the AVRispmkII) why dont I use it to program the whole sketch while Im at it-?- and skip the plugging it into the arduino at all (assuming it has a power supply and the crystal resonator and the caps required for the bare bones chip...)

Thanks!
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: kg4wsv on Oct 15, 2008, 08:10 pm
You've got to get the program onto the ATmega somehow.  It doesn't really matter if you burn the bootloader (with a programmer) or just burn the program, you've got to have a programmer to do so (unless you buy your  ATmegas with the bootloader pre-burned).

For flight hardware, I like to burn the program directly without using the bootloader, so there isn't the remotest possibility that the bootloader could cause my device to hang.  It also leaves a bit of program space free, which did matter for one system I built.

-j

Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: tripmaster on Nov 06, 2008, 05:36 pm
Hello everyone

I really liked this bootloader burnig approach and I instantly had to try it. I used to burn my ATmegas with a STK500 which was always some kind of a hassle.

It all works great, even with the old ATmega8 chips.
I just fixed 5 broken Arduinos here at my university!

It would be great if this could be included in the Arduino Software.
thanks.

so long, broenni
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: seratechi on Nov 07, 2008, 04:29 pm
How is the difficulty packing the scripts and command line into an universal graphic program? A lot of people got to be frustrating with the command line operations.

We made one with Bitbang and ICSP ping out, inspired by this very thread.

;)

http://www.seeedstudio.com/blog/?p=194
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: raphihell on Nov 07, 2008, 06:16 pm
I think I have come apon a universal solution- maybe we should start a new thread- but why not write a sketch that would automatically let the arduino burn the bootloader itself on a naked chip?

1. Upload the sketch to a - pre bootloaded chip, the only one youll ever need to buy

2. put the naked chip on a Bare bones board. Its relatively easy to make  a bare bones breadboard- only a two caps and a resistor needed as you can steal the clean power off the arduino board itself.

3.connect the two chips together, then power them both up

4. You now have two chips that are bootloaded.!

This would be way cheaper than buying another programmer or cable or in the case of macs going through all that terminal stuff which many (including myself) don't understand.

or people could sell the chip and 3 parts for a chip- again way cheaper and simpler than anything else out there - especially for those of us comfortable with components and breadboards but fell iffy around the programing side of things...

now all we need is someone who can figure out the sktech....
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: madworm on Nov 07, 2008, 07:03 pm
I think this already exists. If memory is right it is called 'boot-cloner' or something like that.

http://www.arduino.cc/playground/Code/Programmer2
http://www.arduino.cc/playground/BootCloner/BootCloner
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: raphihell on Nov 08, 2008, 03:38 am
well in classic style the one that seems to work better for the atmega 168
http://www.arduino.cc/playground/Code/Programmer2
reads as coding gibberish to me- It may work but I think Id need a "step by step" like in the other link:
http://www.arduino.cc/playground/BootCloner/BootCloner

This one seems really promising and easy to follow what to actually do- however its unclear to me what needs to be done to adapt it to the larger chip...

?
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: pracas on Dec 19, 2008, 06:25 pm
well i'm trying to use this method to burn a bootloader into an Atmega8 with my deumilanove.. but i keep getting an error message asking to check my conenctions when i try the slow clock mode or the normal mode....  i use the following command after inserting the new Atmega 8 chip and connecting the arduino to my usb..
Command: avrdude -c diecimila -P ft0 -p m8 -t -B 4800

Error:
avrdude: BitBang OK
avrdude: pin assign miso 3 sck 5 mosi 6 reset 7
avrdude: drain OK
ft245r: bitclk 230400 -> ft baud 115200
avrdude: ft245r_program_enable: failed
avrdude: initialization failed, rc=-1

double check connections and try again...

Now i've double checked my connections and tried another ATMEGA8 as well. I get the same error. However if i insert the original Atmega168 i'm able to execute the command with -m168 parameter.... is there some modification here to be done for ATmega 8 for clock speed?

Is there another way to burn bootloader into a Atmega8 from a Atmega168 Deumilanove without using a programmer?  :-/
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: KenH on Feb 03, 2009, 10:21 pm
pracas, I'm not at all sure about the Atmega8 vs ATmega168, but have you checked to be sure the pins are the same?

I just did this method for a ATtiny45 this morning and it seems to have worked, tonight I will be testing the chip to see if it actually works in the circuit with the program I loaded.

Good luck, Ken H>
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: Cynar on Feb 18, 2009, 05:50 pm
Hi all. I've been fighting with this all day. I followed the instructions sequentially, the first time I used
avrdude -c diecimila -P ft0 -p m168 -t -B 4800
it worked. However every time after that it's produced an error. Have I somehow fried the chip? I can I recover it? My knowledge of Avrdude is minimal right now :-S

Thanks

Cynar
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: Cross on Mar 04, 2009, 10:07 pm
I literally had to check the wiring 10 times before I got it to work properly. But after that it worked well with a blank atmega168 and a stand-alone FT232.

@Cynar: what's your setup ?
Title: Burning the Bootloader without  AVR-Writer
Post by: kimio on Mar 07, 2009, 06:45 pm
I renewed web page of "burning the bootloader...".
The CUI-operation on command-prompt of Windows changed to the easy GUI-operation.

New: GUI-Operation.
http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html

Old: CUI-Operation.
http://www.geocities.jp/arduino_diecimila/bootloader/index_old_en.html

Regards.
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: chempi on Mar 08, 2009, 10:57 pm
Hi

Does anybody know if is possible to use this procedure to burn the sketches in the microntroller? Because in this way we can avoid the delay of the bootloader in the final application.

Tks
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: AlphaBeta on Mar 09, 2009, 12:52 am
This is indeed possible.

Just burn the correct .hex :)
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: retrolefty on Mar 09, 2009, 02:52 am
Kimio:

Thank you and and "Mr.Yuki who developed GUI-wrapper of avrdude.exe." for this GUI wrapper. I have a USBtinyISB programmer and was able to get this wrapper program to work fine with it.

Finally a GUI AVRDUDE interface for us command line challenged types  ;) Highly recommended.

Lefty
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: wouternet on Mar 12, 2009, 02:10 pm
is it possible to burn ATtiny's? with this? i need an AVR-programmer to do so, but with this, i won't need one i think, can someone confirm this?

Thanks, Wouternet.
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: kimio on Mar 15, 2009, 08:48 am
These projects made a way to Bitbang AVR writer on Linux and Mac.
On Linux: http://suz-avr.sblo.jp/article/27131001.html (written in Japanese) Suz is author of avrdude-serjtag.
On Mac: http://www15.atwiki.jp/arduino/pages/23.html (written in Japanese)
Please read those pages by web translator (google etc.).
--------
Reply for #35
This method can do it. I confirmed it at ATtiny2313.
--------
kimio
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: kimio on May 05, 2009, 11:11 am
"FTDI Bitbang method" (Burn the bootloader without extarnal AVR writer) could run with the Arduino-IDE on Windows-XP.
Please try to this and check.

http://www.geocities.jp/arduino_diecimila/bootloader/bitbang_w_ide_en.html

(http://farm4.static.flickr.com/3315/3500255930_9044f9cefd.jpg)

(http://farm4.static.flickr.com/3557/3504071720_aea3a05f40.jpg)

Thank you kimio.
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: bohne on May 05, 2009, 01:16 pm
I did the same for Windows and Mac OS X some weeks ago. Look in the LumiNet thread to see some reactions on this idea if you wish.
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: kg4wsv on May 05, 2009, 02:03 pm
Can't you just create an appropriate avrdude programmer description, and skip the wrapper business?  Once it's verified to work, submit it back to the avrdude developers, get it integrated into the next release, and the whole world benefits.  Plus, no arduino IDE hacking is needed.

-j

Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: kimio on May 05, 2009, 02:46 pm
Hi bohne.
You already made this !
I want to try your method. But, I can't find it in http://www.luminet.cc.
Would you tell me detailed url?

Hi kg4wsv.
I think so too. I hope this Bitbang integrate into the arduino IDE.
But, I don't have skills of programming to make a Bitbang avrdude-writer for arduino IDE.
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: bohne on May 05, 2009, 02:55 pm
I will release the IDE soon, please be patient for a few days.
I did the same as you did I guess. I compiled a special version of avrdude and modified the Java files of the IDE and recompiled it.
I did this for Windows and Mac OS X, but because the Mac FTDI drivers are bad there are some limitations.
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: kimio on May 05, 2009, 03:04 pm
Oh great !!!!
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: kg4wsv on May 05, 2009, 03:53 pm
Quote
I think so too. I hope this Bitbang integrate into the arduino IDE.
But, I don't have skills of programming to make a Bitbang avrdude-writer for arduino IDE.

I don't think I was very clear.  Let me try again.

First off, a disclaimer: I could be wrong.

avrdude uses a configuration file that describes the programmer.  Included are some programmers that use bit-bang serial connections (e.g. the ponyprog serial).

I think that an appropriate description of the bit-banged connections placed in avrdude.conf could allow avrdude to work directly, without the need for a wrapper program.  This has added benefits, such as the ability to work with non-windows OSes, and a silution that could be submitted for inclusion in the avrdude distribution, or failing that the arduino distribution.

-j

Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: bohne on May 05, 2009, 04:49 pm
There is a feature request in the bugzilla system of avrdude that asks for FTDI Bit Bang support. And some patches for it exist. But I guess two avrdude releases were published and there is still not FTDI BitBang support yet. So at the moment we must supply our own avrdude version along with the official one. Of course it would be great if the official avrdude release would support this Bit Bang programming mode.
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: kg4wsv on May 05, 2009, 05:34 pm
Won't generic serial bitbang work with the FTDI hardware?

-j

Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: bohne on May 05, 2009, 07:01 pm
never tried this, maybe you can investigate it? I think the VCP driver has a bad timing behavior but maybe the idea is just too simple and no one tried it before...
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: kg4wsv on May 05, 2009, 09:10 pm
Quote
I think the VCP driver has a bad timing behavior

That would certainly be a show-stopper.

I don't have a lot of incentive to work on it, as I've got an AVRispmkII.  :)

-j
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: Matheus on May 25, 2009, 02:49 am
Hi,

I want to know if it's possible to burn bootloader in a diecimila with an atmega8 using the parallel programmer. I've already tried but it says that the avr does not respond, that was expected the signature of the atmega8.

Thanks
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: bohne on May 25, 2009, 12:31 pm
Quote

I want to know if it's possible to burn bootloader in a diecimila with an atmega8 using the parallel programmer. I've already tried but it says that the avr does not respond, that was expected the signature of the atmega8.

It is possible, but this thread discusses the FTDI BitBang hack. You can use the modified Arduino board to burn the bootloader to your ATMega8 chip.

Parallel Programmers often have timing problems, I don't use them anymore.
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: Dan IRL on Nov 23, 2009, 01:29 am
I followed the instructions in the photo shown below but THEY DID NOT WORK:

(http://www.southdublinradioclub.ie/wrong.jpg)

I checked the board schematic and I got it to work.

This should work for the Duemilanove or the Diecimila (I used the Duemilanove) but I checked the schematic for both.

The way I wired it was

1 - 12
2 - 13
3 - 11
4 - reset.

I am sorry for using the same colour for all and the bad photo but it is the best I can do!

(http://www.southdublinradioclub.ie/correct.jpg)

I also had a problem with the GUI yuki-lab.jp Version 1.0.5

If the file name is too long it gives error. I had the GUI in my documents and I moved it to program files. I think the long file names caused problems.

I got it working now so I am happy.

Also if the "display window" option is ticked it will not program
--
Screenshot when display window is ticked and verify is enabled.
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp>
---------

I will try contact author.

Thanks all
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: lars.engel on May 04, 2010, 09:12 pm
@bohne: Did you find time to summarize your experiences burning the bootloader from macos?
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: bohne on May 05, 2010, 02:27 am
sorry, no :(
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: lars.engel on May 05, 2010, 07:22 am
But you got it working? Any hints?
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: lestofante on Jul 22, 2010, 04:46 pm
i can't upload bootloader for atmega328P
first of all i've to add "-F" option or i get the following error:
Code: [Select]
avrdude.exe: BitBang OK
avrdude.exe: pin assign miso 3 sck 5 mosi 6 reset 7
avrdude.exe: drain OK

ft245r:  bitclk 4800 -> ft baud 2400
avrdude.exe: ft245r_program_enable: failed
avrdude.exe: initialization failed, rc=-1
            Double check connections and try again, or use -F to override
            this check.


avrdude.exe done.  Thank you.


then the Fuse code i get are:
FF FF 07
bitlock 3F ( finally something right  ;D )

if i try to writre the suggested DA FF 05 i get:
Code: [Select]
avrdude.exe: BitBang OK
avrdude.exe: pin assign miso 3 sck 5 mosi 6 reset 7
avrdude.exe: drain OK

ft245r:  bitclk 4800 -> ft baud 2400
avrdude.exe: ft245r_program_enable: failed
avrdude.exe: initialization failed, rc=-1
avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0xffffff
avrdude.exe: Yikes!  Invalid device signature.
avrdude.exe: Expected signature for ATMEGA328P is 1E 95 0F
avrdude.exe: reading input file "0xDA"
avrdude.exe: writing hfuse (1 bytes):

Writing |  ***failed;  
################################################## | 100% 0.18s

avrdude.exe: 1 bytes of hfuse written
avrdude.exe: verifying hfuse memory against 0xDA:
avrdude.exe: load data hfuse data from input file 0xDA:
avrdude.exe: input file 0xDA contains 1 bytes
avrdude.exe: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.02s

avrdude.exe: verifying ...
avrdude.exe: verification error, first mismatch at byte 0x0000
            0xda != 0xff
avrdude.exe: verification error; content mismatch

avrdude.exe done.  Thank you.



so lets carry on with old values...
choosing the right bootloade, "Erase - Write - Verify"... after some sec i get "the program isn't responding....", and still like this after over 5 minutes... the bottom bar is completely empty.. tested on Win7 with administrator privilegies to user and to programs... ARGH!
maybe because the file are in "D:\" ????

maybe after i'll test into linux... last (big) hope  ;)
Title: Re:  Burning the Bootloader without  AVR-Writer
Post by: omonoid on Jan 11, 2011, 07:42 am
ugh i have the exact same problem as you same error and everything. Did linux fix it? I really need to get the working before the semester ends