-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added optional copy_flash_pages function to load application from internal flash #269
base: master
Are you sure you want to change the base?
Conversation
MCUdude included |
Not sure where to ask this, but would you please add the |
it is there. not in built binaries, but in source code of the Optiboot |
Hmm. A bunch of chips with less than 128k of flash still define EIND, apparently because they belong to the same "family" as larger chips. This includes the ATmega640 and ATmega1280, but also some surprises like ATmega32u4... Ditto for RAMPZ and 64k. I guess it doesn't hurt much to set EIND/RAMPZ even when it's not necessary, but... |
As you can see I added EIND use the same way RAMPZ was already used. EDIT: there is no hurry with writiing to flash so some useless RAMZ or EIND instructions don't make a difference |
I resolved the conflicts. The PR is up to date again. The ArduinoOTA library is popular and many people use Arduino Mega with Optiboot 8 with 'copy_flash_pages' function to do OTA or OTEthernet. They usually use the Optiboot build from my_boards |
Great! |
MightyCore and MegaCore have now BIG_BOOT Optiboot binaries with the copy_flash_pages function included. |
Are there any simple examples showing how to use it? |
the purpose is to apply firmware update stored in flash with the do_spm function of Optiboot |
the function is added to Optiboot only with build option
COPY_FLASH_PAGES_FNC=1
Function
copy_flash_pages
usesdo_spm()
function to copy flash pages.It is intended to be called by the application over the 'vector table' in
pre_main()
.It uses 32bit addresses for use on devices with more then 64 kB flash memory.
Additionally parameter
reset_mcu
activates an (almost) immediate watchdog reset of the MCU after pages are copied.It was created to copy a new version of the application stored in the upper half of the flash memory to the beginning of the flash and then reset the MCU to run the new version.
It is used by ArduinoOTA library in InternalStorageAVR over utility/optiboot.h.
To fit into 1 kB,
COPY_FLASH_PAGES_FNC
excludes the version information section otherwise added toBIGBOOT
builds.and issue #265 with optiboot.h in examples/test_dospm is fixed too