avr_boot icon indicating copy to clipboard operation
avr_boot copied to clipboard

Question: Is it possible to choose between .hex files?

Open alequeiroz opened this issue 8 years ago • 1 comments

Hello guys i´ve been working on a embedded project that switches modules of different functions, but the code on the mega is too large to integrat all of modules functions and to to write it again, so i´ve been wondering if i can set the bootloader to determine what module the system is using so it can change between the .hex files store on the SD. Whet do you guys think?

alequeiroz avatar Dec 21 '17 02:12 alequeiroz

I have thought about this idea before, but only theoretically because I didn't actually have a need for it. The filename is hardcoded into the bootloader.

I think the easiest way would be to have the code in your sketch rename the appropriate file to FIRMWARE.BIN before you reset the microcontroller to initiate the loading of that file from the SD card. I'm not sure how inconvenient that process would be.

A more difficult alternative would be to modify the bootloader to read the filename of the .bin file from a special file on the SD card (defaulting back to FIRMWARE.BIN if the file was not present). Your sketch code would write the desired filename to the special file on the SD card before resetting the microcontroller to activate the loading of the .bin file.

per1234 avatar Apr 24 '19 07:04 per1234