Go Down

Topic: NEWER New Optiboot bootloader (Read 979 times) previous topic - next topic

westfw

May 11, 2015, 11:32 pm Last Edit: May 23, 2015, 03:02 am by westfw
The thread at New optiboot; beta testers welcome has become rather stale; originally offered in 2011, the most important changes were integrated into the IDE and onto Uno in about the IDE 1.0 timeframe, and they fixed nearly all of the actual bugs that used to bother Arduino users.

However, development of the Optiboot bootloader has continued (rather slowly) in its own source repository, and may have features that are interesting to a small minority of users, so I'd like to continue discussion in this thread.

The Optiboot bootloader that is contained in the IDE, and that ships on Unos, is version 4.4.
The current "Development" Optiboot is version 6.2, and includes the following changes.
(Note that many of these are not relevant to the ATmega328 that ships with Uno.)

  • Support for additional chips.  Notably ATmega1284p, but also ATmega32, Atmega88, and Atmega168p
  • Support for the additional uarts on chips with more than one.
  • Save reset cause in a way that the application can read it.
  • Adjust source and compilation options so that newer versions of gcc can be used to compile Optiboot.
  • (while making sure that the core stays less than 512 bytes!)
  • implement build infrastructure that makes it easier to build "custom" versions of Optiboot
  • increase range of available baudrates, but also check whether the specified baudrate is likely to work.
  • Move everything from Google code to Github
  • Write some documentation in Wiki formatting, and attach it to the repository.


The repository is here: https://github.com/Optiboot/optiboot/
And the wiki is here: https://github.com/Optiboot/optiboot/wiki

Many of the more recent and visible features were contributed by 3rd parties; the way open source is supposed to work.  Yeah!

twice

What do you mean by "Save reset cause in a way that the application can read it."?

westfw

Quote
What do you mean by "Save reset cause in a way that the application can read it."?
Optiboot normally "eats" the initial contents of the MCUSR register (which contains the reset cause) as part of its normal operation.  "dkinzer" came up with a patch that will pass most of the relevant bits to the application in the R2 register, and the sketch can save that.   There are actually some additional improvements for this "in the queue".

See https://code.google.com/p/optiboot/issues/detail?id=66


Paul__B

#3
May 12, 2015, 04:47 am Last Edit: May 12, 2015, 04:48 am by Paul__B
There are status bits that record whether the last reset was the result of a power on, external reset, or watchdog time-out.  There is some concern that the bootloader might alter those status bits as it perform its check for synchronisation with the IDE, so a standardised way is provided to preserve them when it hands execution over to the loaded sketch.

jaidevraghu

@Paul__B, I think you are saying right but these steps already performed by the problem raiser! According to me it is problem from long time and most of the time i have also deducted in my end..need permanent solutions for same.. 

hiduino

  • Support for additional chips.  Notably ATmega1284p, but also ATmega32, Atmega88, and Atmega1698p


What's a Atmega1698p?  Typo?

hiduino

What do you mean by "Save reset cause in a way that the application can read it."?
One example I use it for is to avoid a loud audio "pop" on my speakers when I power up the Arduino with an audio DAC card.  Otherwise I would also get a audio "pop" when just pressing the reset button.  So I want to ramp up the audio to mid level only during power up and not just a reset.

Code: [Select]

void setup() {
  // Get reset flags
  resetFlagsInit();
  // ramp up to mid audio level to avoid pop, unless from reset.
  mcpDacInit();
  if (resetFlags & _BV(PORF)) {
    for(int i=0; i<=2048; i++) {
      mcpDacSend(i);
    }
  }
}

westfw

There is now a version of Optiboot that will install automatically using the new 1.6.4 Boards Manager.
You can point the Preferences "additional url" field here: https://github.com/Optiboot/optiboot/releases/download/v6.2/package_optiboot_optiboot-additional_index.json
(this is a sort of "interim" pre-release, mostly for use in testing the auto-install stuff.)
And then use the Boards Manager to install (many of) the Optiboot .hex files and menus.


ruggb

I discovered that I have no clue about bootloaders and all the info I have found further confuses me.
Mostly b/c it does not directly fit me. Hopefully, someone in this thread can educate me.

I have a mega 2560 R3 that has a CH340G. It is acting very strange and I would like to reload a bootloader.
I have Arduino 1.6.4. The bd is used with Ramps V1.4 on a 3D printer.
I have loaded sketches many times (TOO many). I have another mega bd due here today with (hopefully) a 16a2 instead of the 340.

I would like to know which bootloader to use on the old bd and how to load it with what I have?

If that doesn't work, what do I need? The bd is cheap so it is more a learning exercise, otherwise I would just toss it.

thx for your help

jstampfl

To burn a bootloader

http://www.arduino.cc/en/Tutorial/ArduinoISP

westfw

Many of the "burn bootloader" instructions won't work on a MEGA2560.  Optiboot doesn't work on it, for instance, and neither does Arduino as ISP.   You should start another thread, and describe "acting very strange" in a lot more detail.  From your description, it doesn't sound like a bootloader problem.  The bootloader is ONLY used to load new sketches.  If you can load a sketch, the bootloader is working fine, and shouldn't be having any effect on the sketch itself.

pradipkhare

Hello,

Request to share the (latest and working ) opti-boot-loader for Atmega32 in hex file format.

Currently I am working with Atmega32A mcu as well, but having problem in terms of serial communication. Tried different boot-loader for mega32 but giving problems. On net there are multiple version available not sure about which one to pick. Hence this request.

- Pradip

 
PK

hansibull

Hello,

Request to share the (latest and working ) opti-boot-loader for Atmega32 in hex file format.

Currently I am working with Atmega32A mcu as well, but having problem in terms of serial communication. Tried different boot-loader for mega32 but giving problems. On net there are multiple version available not sure about which one to pick. Hence this request.

- Pradip

 
I got the lastest Optiboot working with ATmega32 at 8MHz internal and 16MHz external oscillator :)
You'll find all the files you need to get started!
http://forum.arduino.cc/index.php?topic=322745.msg2232420#msg2232420

Isaac96

Does the 1 MHZ option use the internal xtal?
I use UnoJoy and Hoodloader for HID. No Leonardo!
Do not PM me for help.Only links to topics.

CONNECT THE GROUNDS!

Go Up