I still cannot get the optiboot to work FOR UPLOADING VIA SERIAL on a Mega8A.

I have uploaded the optiboot bootloader using the AVR ISP MK2 and tried uploading a sketch but it doesn't upload either BUT it does upload and run using "Upload with programmer" (this is the basic blink sketch)

I have the 6 pin FTDI header connected just like I would for a 328 ie 1-GND, 3-VCC,4-TX,5-RX,6-100nF cap with other side going to reset pin. It works on 328, 664 and 1284 so lead etc is known good. Am I missing something?

Optiboot needs adding to version 1.1 of the IDE as a standard feature. 1.5K saved on the 328 with no disadvantages as far as I can see is too good to miss. Hence my trying to get it to work on the Mega8.

power it up.. it will auto detect the board/chip you have connected (if there is support for it).. and write the Optiloader 'bootloader' to the blank chip. (it will output a message on the serial monitor through the IDE if you want to read/check)

After optiloader 'bootloader' has been flashed to your blank chip/board...it is now ready to handle sketches being uploaded to it..

To do this.. you connect your newly flashed board to your computer..

open the IDE....

*make sure correct COM port was selected.. *make sure I had board setting set to "UNO"..

power it up.. it will auto detect the board/chip you have connected (if there is support for it).. and write the Optiloader 'bootloader' to the blank chip. (it will output a message on the serial monitor through the IDE if you want to read/check)

I'm assuming that you still select the Tools -> Burn Bootloader (the bootloader doesn't get burned automatically, upon powering up Arduino Due 2009, right? More importantly, are you saying that I'll be able to confirm that the proper optiboot_atmega328.hex bootloader file was loaded... by seeing the serial monitor, not the bottom section of the Arduino IDE window?

OptiLoader is separate from the bootloader itself, mostly. You can find it here: https://github.com/WestfW/OptiLoader

OptiLoader runs on the Arduino where you might have run ArduinoISP, and it DOES eliminate the need for the "burn bootloader" step. Assuming a target chip or board is properly wired to the Arduino running optiLoader, it does in fact burn the bootloader into the target automatically on powerup or reset.

Now I understand... OptiLoader is what I'm missing. Thanks for the clarification, westfW... and thanks for writing the OptiLoader sketch!

Hopefully the final question:

The OptiLoader readme file states:

Quote

It stores multiple copies of the optiboot bootloader in program flash memory.

as well as:

Quote

The internal copies of the bootloader are prepare manually from the .hex files compiled in the bootloader directories. (There's an easy editor macro process, but it is manual.)

I'm guessing that the "internal copies" of the bootloaders are chosen from somewhere, when compiling the OptiLoader sketch and uploading it onto the Arduino programmer. If I perform the following instruction (from http://code.google.com/p/optiboot/), will I be OK? I just want to be sure that the latest Optiboot v4.4 will be used.

Quote

To install into the Arduino software1.Download the latest Optiboot zip file and extract it. 2.You will need to be using a recent version of the Arduino environment, version 18 or later. 3.Create a 'hardware' directory inside your sketches folder. 4.Copy the optiboot directory into the hardware directory. 5.Restart the Arduino software. New boards will appear in the Tools > Board menu.

I'm guessing that the "internal copies" of the bootloaders are chosen from somewhere, when compiling the OptiLoader sketch and uploading it onto the Arduino programmer.

The internal copies are chosen at the time the SOURCE is prepared (manually, by me (in the case of the official version.)) You don't need to have bootloader hex files anywhere else on your computer to use optiLoader.And yes, the included hex files are 4.4 and should be the same as the "new" Unos have.

You can actually look at this in the optiLoader sketch, though it's a bit obscure. At the end are a bunch of data structures containing the hex files, that look like:

Interesting... tried to compile optiLoader with both Arduino v0022 and Arduino 1.0, but get the following compilation error:

Quote

In file included from optiLoader.cpp:85:0:optiLoader.h:25:24: error: variable 'image_328' must be const in order to be put into read-only section by means of '__attribute__((progmem))'optiLoader.h:25:35: error: variable 'image_328p' must be const in order to be put into read-only section by means of '__attribute__((progmem))'optiLoader.h:25:47: error: variable 'image_168' must be const in order to be put into read-only section by means of '__attribute__((progmem))'optiLoader.h:25:58: error: variable 'image_8' must be const in order to be put into read-only section by means of '__attribute__((progmem))'optiLoader.cpp:688:17: error: variable 'image_328' must be const in order to be put into read-only section by means of '__attribute__((progmem))'optiLoader.cpp:742:17: error: variable 'image_328p' must be const in order to be put into read-only section by means of '__attribute__((progmem))'optiLoader.cpp:796:17: error: variable 'image_168' must be const in order to be put into read-only section by means of '__attribute__((progmem))'optiLoader.cpp:850:17: error: variable 'image_8' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

Yes. In newer compilers, PROGMEM handling is changed significantly. And linux installs the compiler separately from the Arduino IDE, so which version you have is pretty random.

I'll take a look and see if I can come up with changes that work for multiple compiler versions...

Yup, 4.6 changed the handling of progmem significantly, and all for the better. It's easy to make the changes, and they still work with older toolset versions. Basically, we have to stop using prog_types and make all progmem variables const (which they should have been already).

I still even have trouble for my IDE (both 22 and 1.0) to recognize the optiboot board. According to the instructions i do this:To install into the Arduino software1.Download the latest Optiboot zip file and extract it.2.You will need to be using a recent version of the Arduino environment, version 18 or later.3.Create a 'hardware' directory inside your sketches folder.4.Copy the optiboot directory into the hardware directory.5.Restart the Arduino software. New boards will appear in the Tools > Board menu.

But there are no new boards in the Tools > Board menuNow I have done this for other boards and it always worked. If I look at the 'Optiboot' folder in my hardware folder, its structure is completely different from the ones that do work. Other folder (e.g. Attiny85) have a 'boards.txt' file in their folder and a folder called 'cores'. That folder then has a subfolder called Attiny85 again and only that folder then has all sorts of 'h', 'c' etc files in it. So not the optiboot folder: no 'boards.txt' no cores folder, it just has all of its files (boot.h, makeall, makebat, pin_def etc directly in that one folder.

So, Am I forgetting something? Is there anything in the 5 line instructions that was too difficult for me to understand?

Yes, I did close and restart the IDE.Anybody a solution as it seems to work for all you guys and calls.Tnx