Skip to content
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

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

Open
alequeiroz opened this issue Dec 21, 2017 · 1 comment
Open

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

alequeiroz opened this issue Dec 21, 2017 · 1 comment

Comments

@alequeiroz
Copy link

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?

@per1234
Copy link
Contributor

per1234 commented Apr 24, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants