Optiboot - improved Arduino bootloader

Udo: Optiboot already supports devices without a UART, with an AVR305 bitbanged soft-UART. The Lilypad version programs at 115200 baud with an 8MHz CPU clock - which can't be done with the onboard UART.

Hi Peter,

sorry for this. I just swa the first page and did not get that there are more pages. Shame on me. :-[

Udo

Hi Udo,

not sure what you want to suggest... connecting an attiny via SPI to the PC does not seem to be the right way to me. SoftwareUART on the other hand seems to be a good choice. But maybe I did not get your point, please explain your idea...

Well, I thought that the Tinys are very restricted. So if they support SPI and it makes it easier on the controller side then the programmer side should take care to provide a suitable interface. That is I would use an Arduino to provide the SPI interface between the PC and the Tiny. Of course this implies that you need some hardware in addition to your controllers but in this forum the availability of an Arduino seems a reasonable assumption :wink:

Udo

Hey Peter.

Just wanted to say thanks for developing the optiboot.

It is currently running in my Duemilanove ATmega328, enabling me to make use of the built in watchdog.

Thumbs up! :slight_smile: :slight_smile: :slight_smile:

I hate being the party pooper. But I have an issue using Optiboot. I'm running Ubuntu 9.10 32 Bit. The standard bootloader has been working well for several months. I came across this thread and I thought it sounded great and I downloaded and installed it as per instructions. All appeared to be well, the extra options appeared in the board menu and burning the bootloader to one of my homebrew arduinos with a USBtiny programmer worked fine and it downloaded sketches which appeared to run OK.

Confident I was on a winner I burnt the bootloader to one of my Duemilanoves (a fake, if thats relevant,but it has long since proven itself with the standard bootloader). I uploaded my home monitoring sketch to it and I could see by my slow heartbeat monitor and the serial output the sketch was running fine. So I unplugged it and transferred it to the running environment. It fired up with the telltale double blink and there was no output either to the serial or the LCD panel I have attached. It had forgotton the sketch with being unplugged. So I uploaded it again on my progamming computer and checked it was running with no problem. So I unplugged it from the USB and then plugged it back in, back to the double blink and no sketch. I've restored it to the standard bootloader and its back working as expected.

It seems to do it with any sketch , it appears to work fine, but it forgets all about the sketch if its deprived of power. The optiboot is the latest version 3 from the google code site

pluggy: Sorry to hear that. Avrdude (part of Arduino) automatically verifies - and would definitely let you know if the program failed. So it sounds like Optiboot isn't doing something the default bootloader is, and that is breaking your code.

Because of the tight code constraints, Optiboot assumes the application will set up all the peripherals it needs. In particular, it assumes all the ports you use are set up with pinMode() or equivalent.

It would be extremely helpful if you can file an Optiboot issue report, and then I can focus on rectifying this for you. Google Code Archive - Long-term storage for Google Code Project Hosting.

You guys seem to be the experts on boot loaders... I need some help.

I have modified the standard bootloader to work on the 2560. I have it working and downloading correctly but it will not start the code. If I program the BOOTRST bit to 0, it will run the bootloader, if I flip it the otherway, it will run my program. But the bootloader will not start the program. I have compared fuse bits to the 1280 and have them set the same.

Once I get this working I am going to try to implement st500v2 in order to take advantage of the rest of the program space.

Thanks

Mark

Mark S: Run your bootloader through disassembler (see the Optiboot makefile for how I do that) and see what code is generated for the jump to the application. In particular, watch out for RAMPZ which is used by some jump instructions and should be set to the correct value.
Generating jumps outside the bootloader memory space are tricky (there are linker issues), so Optiboot generates:

clr r30
clr r31
ijmp

which is guaranteed to jump to the application reset vector, without any linker fiddling.

Peter

Thanks so much, it now works. I have the standard bootloader working on a 2560. The board that I have been testing with is a cerebot plus. It does not have reset so you have to manually hit reset, but it WORKS!!!

The previous code just did a call to 0x000

Mark

Mark S: Ah, the call to 0 is the problem. When you link the code, "jmp 0" gets relocated to "jmp ". So the bootloader jumps to the bootloader start address, not the application address. That one caught me out a few times!

I'd be very interested in seeing your code, as I'm expanding Optiboot to support a lot of new targets. Have you put it on the web yet?

Peter

The code is the standard bootloader modified to include the 2560

I have not tried to make it work on other cpus so the jump might be an issue

I have included the source file, the make file, and the new boards.txt file

http://www.cbxdragbike.com/arduino/bootloader/bootloader.zip

I want to add stk500v2 support

Mark

Hi guys, is this bootloader working on Tiny84 or Tiny85? I am making a small bot and it would be much more convenient than using the hardware programmer every time...

Thanks for your efforts!

Interesting, what gcc version are you using? with 4.3.0 I recompiled it but it goes to 516 bytes or something like this.

Any news on compatibility with Tiny chips?
Thanks.

could somebody explain to me why the bootloader works when specifying "-p stk500v1" in avrdude but not "-p arduino"?

i've ported optiboot to a mega325 and for some reason the reverse is true, though the flash doesn't actually get written.

thanks!

I hate being the party pooper. But I have an issue using Optiboot. I'm running Ubuntu 9.10 32 Bit. The standard bootloader has been working well for several months. I came across this thread and I thought it sounded great and I downloaded and installed it as per instructions. All appeared to be well, the extra options appeared in the board menu and burning the bootloader to one of my homebrew arduinos with a USBtiny programmer worked fine and it downloaded sketches which appeared to run OK.

Confident I was on a winner I burnt the bootloader to one of my Duemilanoves (a fake, if thats relevant,but it has long since proven itself with the standard bootloader). I uploaded my home monitoring sketch to it and I could see by my slow heartbeat monitor and the serial output the sketch was running fine. So I unplugged it and transferred it to the running environment. It fired up with the telltale double blink and there was no output either to the serial or the LCD panel I have attached. It had forgotton the sketch with being unplugged. So I uploaded it again on my progamming computer and checked it was running with no problem. So I unplugged it from the USB and then plugged it back in, back to the double blink and no sketch. I've restored it to the standard bootloader and its back working as expected.

It seems to do it with any sketch , it appears to work fine, but it forgets all about the sketch if its deprived of power. The optiboot is the latest version 3 from the google code site

I'm having the same problem with an DFRduino Duemilanove (328p) on Win XP (SP3). Loaded the bootloader with USBtinyISP v2.0 (clone).

Also tried it on a DFRduino nano V3.0, and there all is working fine.

Is the reported problem with flash amnesia when power is removed related to a fuse setting?

HI:

Not sure if this it the write place for my question. I have an arduino 2009 and I want to install the new optiboot. I have tried the instruction to use one arduino to program another but get avrdude errors. (I used an adruino mega as programmer and arduino 2009 as target)

So I was looking into using my bus pirate to upload the new optiboot via ICSP. Problem is I can't seem to find any tutorials or directions on how to actually use the bus pirate with the avr firmware to program a 328p in an arduino 2009 board. I can't even find any info on what application to use and how to use it. I see avrdude and avr studio mentioned as being used to do the programming. But those are quite complicated. Avr studio for example has a tabbed programing dialog with tons of settings. Nowhere can I find what fuses etc. need to be set or reset when programming the optiboot_atmega328.hex to the arduino's 328p chip.

Does anyone have an easy tutorial for dong this? Or maybe post directions here?

Right now I have my bus pirate with svr programmer firmware installed connected to my adruino 2009 via icsp cable and avr studio. Don't know how to go any further.

My Arduino 2009 with optiboot v3 suffers flash amnesia

It's programmed with blink application, it works until I remove power

I used another Arduino to flash mine