New optiboot; beta testers welcome...

@montymintypie: If you install the latest version of Optiboot provided by @westfw you should not need to do anything special (like cutting the RESET trace) for the Arduino ISP Sketch to work.

retrolefty:
However you would have to re=enable the trace path for when you want to do future uploads of other sketches onto the board, or learn how to time manual resets at the proper time to allow uploads to work.

@Coding Badly, I have no way to update my Uno as of yet, so I plan to purchase an additional 328 for the purpose (also for a standalone project I have), which is why I need to run ArduinoISP on my current Optiboot.

@retrolefty, as the trace is designed to be cut (it's one of those bare pads) I can easily re-solder the joint to enable the functionality again. :slight_smile:

You don't need to disable auto-reset in order to upload a new bootloader. Look for WestfW's Optifix sketch. You'll need to update the binary data at the end of the sketch, but it's very easy to do.

Look for WestfW's Optifix sketch

Does Optifix update the processor on which it is running or does it update other processors?

AFAIK it's not possible to rewrite the bootloader memory internally. But if anybody wants to try out the new Optiboot v4.4 and they have two Arduino boards, the Optifix sketch avoids the need to disable auto-reset on the board acting as programmer. Once one of the boards has Optiboot v4.4 installed it will run ArduinoISP properly (again without fiddling about disabling the reset signals). Although for this purpose IMHO Optifix is easier to use than ArduinoISP + AVRdude.

I hope WestfW doesn't mind me beating this particular drum. It's all his work.

I'm traveling at the moment, but I'll try to post an updated (with optiboot 4.4) optifix soon...

How do I read the Optiboot version?

How do I read the Optiboot version?

It's in the last two bytes of flash memory. You can see it in the .HEX file and read it with an ISP programmer (including ArduinoISP.) To read it from a sketch, you'd need to update the protection fuses as per the source repository...

(The existing optiboot doesn't have a version number. Not even in the source code. There was only the version attached to the .ZIP file in the optiboot repository, and/or the version of the Arduino distribution. Adding the extra version number was one of the enhancements in this new version.)

I have uploaded an optiLoader4_4.zip sketch to Google Docs.
OptiLoader is a superset of the earlier optifix sketch. Like optifix, it provides zero or one-button reprogramming of an Uno bootloader with the latest optiboot (4.4 in this case) while bypassing any auto-reset issues. In addition, it automatically detects chip type and will program an appropriate optiboot into ATmega168 and ATmega8 as well.

Documentation is a bit slim at the moment, but there isn't much too it. Wire as described in the ArduinoISP documentation, and run the sketch. It's designed to re-run via the reset button, to easily program multiple Arduino clones. Run a serial monitor at 19200 if you want to see what it's doing. If you put optiboot on mega8 or mega168 chips, you'll also need to have an updated boards.txt...

I've also uploaded fusebytes.zip, which pretty-prints assorted "deep" information about your Arduino. Including the optiboot version number if present and readable.

westfw:
I've also uploaded fusebytes.zip, which pretty-prints assorted "deep" information about your Arduino. Including the optiboot version number if present and readable.

Sweet! Couple things, (a) Had to comment out the line #define USEFLASHLIB 1 to get it to compile, and (2) It reports

Bootloader at 0x7E00 is not readable

even though I've burned the bootloader from earlier in this thread. Should it find a version number?

Bootloader at 0x7E00 is not readable

If you burned the bootloader using the existing boards.txt settings for Uno, it read-protects the bootloader from sketches, making the bootloader version number unreadable. The code changes to fix this are submitted via source, but are not part of the bootloader itself. (you COULD change the xxxx.bootloader.lock_bits from 0x0F to 0x2F in boards.txt and reburn the bootloader, but I'm not sure it's worth it.)

Aha, thanks. I may play with it a bit. Again, nice work!

Hello. I've found the news right now and then I've tried to use these sketchs but I am having some issues trying toi compile them.

FuseBytes:
I got:
"pgm_read_byte" was not declared in this scope
at line 83

OptiLoader:
I got:
variable or field "read_image" declared void

I use:
Arduino IDE 0022 + Arduino Tiny Cores
OS: Xubuntu 11.04

EDIT:
I didn't download all of your mod-IDE software... only the sketches, so maybe this could be the explanation of the errors... maybe...

FuseBytes: I got:
"pgm_read_byte" was not declared in this scope at line 83

You probably need to download the Flash library from the playground, or remove the #define of USEFLASHLIB

OptiLoader:
I got: variable or field "read_image" declared void

That one I can't explain. yeah, read_image is declared void, and it is consistently used that way too.

I'll try to take a look at the compiles on a "virgin" system and see if I can duplicate the problems...

Thanks. I'll wait for news from you :wink:

I've confirmed that fusebytes works without the USEFLASHLIB (and I've uploaded a new version that makes this the default.)

I couldn't duplicate the problem with optiLoader on either virgin WXP or Unbuntu10 arduino installs (ok, the Unbuntu version was the v18 installed by the package manager with the arduino parts overwritten by the v22 download.)

westfw,

I burned the optiboot_atmega328.hex file (attached at the beginning of this thread) onto a 328P DIP chip and on an Arduino Duemilanove. I did this twice, following the instructions listed here:
http://arduino.cc/forum/index.php/topic,65099.0.html
and
http://www.sparkfun.com/tutorials/247

I used avrdude 5.10 on Windows Vista and on my Linux machine (Fedora 15).

No errors whatsoever during the burning of the bootloader, but I then couldn't communicate with either of the chips. I got this error when trying to upload the "fade" sketch from the "examples":

Binary sketch size: 1252 bytes (of a 30720 byte maximum)
avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

I then burned the standard bootloader using the Arduino 0022 IDE, choosing the Arduino Duemilanove board and finally selecting "Burn Bootloader -> w/ Arduino as ISP". Again, no errors during the burn AND was able to communicate with the board and load a sample program.

Am I doing anything wrong here? I must be the only one that hasn't been able to make this work!

Did you change the board type (Tools/Board) to Uno after putting optiboot on the chip? Once a 328 has optiboot, it acts more like an Uno than an Duemilanove (the upload speed is different.) (hmm. I don't think I mentioned that, did I?) (similarly, if you put optiboot on an Atmega8 or Atmega168, you need to create NEW board entries to reflect the change in upload speed (and memory available.)

Oh... No I didn't select UNO from the board list. Thanks, I'll try that tonight when I get home from work and I'll let you know.

Thanks again.

can i run this bootloader on an atmega8 with its internal oscillator ?