Go Down

Topic: NEWER New Optiboot bootloader (Read 322 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);
    }
  }
}

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy