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

Use EEPROM flag to skip bootloader #13

Open
per1234 opened this issue Feb 5, 2016 · 2 comments
Open

Use EEPROM flag to skip bootloader #13

per1234 opened this issue Feb 5, 2016 · 2 comments

Comments

@per1234
Copy link
Owner

per1234 commented Feb 5, 2016

Ariadne currently runs the bootloader on every reset. The img_stat EEPROM address is currently used to disable the bootloader timeout so that it will perpetually wait for an upload before running the program. At the start of each upload the bad flag value is written to the address and then the OK flag value is only written to it after successful upload(and currently I think it also verifies the file although that behavior may be removed soon).

The change I propose is that if the img_statEEPROM address is set to the skip flag value in the sketch then on the next reset the bootloader would write the OK value to the address and then immediately time out without waiting for an upload. Define the 3 flag values(OK, bad, and skip) of img_stat in neteeprom.h and these defines will also be available to the user in the copy of that file included in the bundled network configuration library. Add these names to the keywords.txt of that library.

@hachi
Copy link

hachi commented Jan 14, 2018

If I might suggest, having a configurable delay in the eeprom as the number of seconds might be useful. 0 can imply no delay and -1 (255) could imply wait forever.

@per1234
Copy link
Owner Author

per1234 commented Jan 14, 2018

Do you think users have significant variation in their delay length needs? I use a script to send the reset command and then start the upload immediately after so I can get by with a very short delay. If someone is doing this manually they will require more time.

I did end up reducing the delay from 20 seconds to 10 seconds in the parent repository (loathingKernel@e1e3d11) but have not gotten around to merging that change (or other significant improvements) to this repository.

My idea here was that if the bootloader had a mechanism to skip the delay then a long bootloader delay won't pose any problems since it will only be encountered when an upload is intended and so a reasonable one-size-fits-all delay would be fine. However, that does require the users to set the EEPROM flag.

There is some relevant discussion here: loathingKernel#8 (comment)
Moving the configuration to flash memory as proposed in that issue would generally be a significant improvement. However, it would make setting this flag less user friendly since it's quite easy and common to write to EEPROM, less so to write to flash from the application.

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

No branches or pull requests

2 participants