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

Littlefs (or similar) datetime backup #87

Closed
Avamander opened this issue Oct 6, 2020 · 11 comments
Closed

Littlefs (or similar) datetime backup #87

Avamander opened this issue Oct 6, 2020 · 11 comments
Labels
enhancement Enhancement to an existing app/feature

Comments

@Avamander
Copy link
Collaborator

It would be nice if the watch kept track of at least the current date on it's own.

Writing a new date to a file once a day should be okay in terms of wear, but it'd make the watch much more useful if it needs to reboot in a situation where there's no phone nearby. Plus it'd make date look nicer during testing which constantly resets it.

@JF002
Copy link
Collaborator

JF002 commented Oct 7, 2020

Yes, good idea! We can also write the current date/time to flash just before issuing a reset (after a successful OTA, for example).

@ZephyrLabs
Copy link
Contributor

I have a proposal, perhaps we can create a partition in the FS for the SPI flash such that is some sort of EEPROM emulation for non-volatile data, eg. the request for time backup by @Avamander or user settings and other future things... 4Kb of storage should be ample for such a thing..

@JF002
Copy link
Collaborator

JF002 commented Oct 8, 2020

There's no FS in the SPI flash for now. The first 115200KB are used by the boot graphics, the rest is empty. As @Avamander wrote, I think the best would be to use a embedded FS like littleFS to manage the reste of the SPI flash space.
I think littlefs provides a higher level and easier to use API than a simple EEPROM.
We would be able to use this FS to store configuration parameters, data time, graphic assets, heart rate values,...

@JF002 JF002 added the enhancement Enhancement to an existing app/feature label Oct 11, 2020
@ilutchenko
Copy link

What about RAM retention?
We can store time in a certain part of RAM that will be excluded from startup initialization.
And after reboot time can be restored from this part of memory.
https://devzone.nordicsemi.com/f/nordic-q-a/272/ram-banks-ram-retention

@ObiKeahloa
Copy link
Contributor

What about RAM retention?
We can store time in a certain part of RAM that will be excluded from startup initialization.
And after reboot time can be restored from this part of memory.
https://devzone.nordicsemi.com/f/nordic-q-a/272/ram-banks-ram-retention

Ram is volatile memory right?

@Avamander
Copy link
Collaborator Author

Ram is volatile memory right?

Yes. There are sleep modes where RAM contents are kept (with extra power used) and methods to keep some amount of RAM untouched.

@ObiKeahloa
Copy link
Contributor

Well what if the device runs out of battery?

@pfeerick
Copy link
Contributor

If it runs out, it looses it... simple as that. That's when you would revert to the datetime stored in flash memory. But for reboots, either manual or update related, storing it in RAM would be perfect as it would save a write to the flash memory and preserve the time across the reboot (bar the bootloader/DFU update delay).

@myxor
Copy link

myxor commented Jun 15, 2021

This could not only be used for date and time but also for other data like steps counter and last hrm result.

@ObiKeahloa
Copy link
Contributor

ObiKeahloa commented Jun 16, 2021

This could not only be used for date and time but also for other data like steps counter and last hrm result.

I think there is a discussion for this , we could of course use this for a whole lot of other things.

@kieranc
Copy link
Contributor

kieranc commented Oct 1, 2021

This has been implemented in #595 and can be closed.

tgc-dk pushed a commit to tgc-dk/InfiniTime that referenced this issue Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to an existing app/feature
Projects
None yet
Development

No branches or pull requests

8 participants