Optiboot / optiboot

Small and Fast Bootloader for Arduino and other Atmel AVR chips
Other
1.09k stars 401 forks source link

Implemented load of OSCCAL value (draft) #343

Open LadislavOzobot opened 2 years ago

LadislavOzobot commented 2 years ago

Based on discussion with @ondrej-stanek-ozobot , this is attempt at implementing osccal in the bootloader. Would solve issue #87 The idea is originally by @WestfW in https://github.com/Optiboot/optiboot/pull/342#issuecomment-1090918606, this is the implementation i came up with:

Caveats:

We will test on our platform and report if it works as expected. For now, we can have a discussion if this approach on the bootloader side is OK-ish and what more needs to be done.

Feel free to discuss, modify and reject if necessary :-)

Edit: formating.

LadislavOzobot commented 2 years ago

We have implemented the part that writes calibration using do_spm stub and it seems to work fine on atmega328 target. Is there interest in this PR? If so, let me know, I'll add documentation and example calibration code.