rtc_get_time returns error -61 when reading the time from a RV-8263-C8 RTC which means that the OS flag is set.
To Reproduce
Use the rtc_get_time API call with a RV-8263-C8 device.
Expected behavior
OS flag should be cleared when reading the time and the flag is set so the next read will be successful.
Environment (please complete the following information)
Zephyr Main branch
Additional context
The OS flag is never cleared and so the oscillator doesn´t run anymore if the flag is set. The flag must be cleared by software.
@jakubtopic
We missed this in our initial discussion about the OS flag. There is an issue that get_time doesn´t work anymore as soon as the flag is set. I would like solve this issue in this way in rv8263c8_time_get:
/* Return an error when the oscillator is stopped. */
if (regs[0] & RV8263_BM_OS) {
/* Clear the OS flag. */
regs[0] &= ~RV8263_BM_OS;
i2c_reg_write_byte_dt(&config->i2c_bus, RV8263C8_REGISTER_SECONDS, ®s[0]);
return -ENODATA;
}
So the application get´s an error when the flag is set and the flag is reset. If this error happens again the application will get the same error again.
What do you think? I think it´s the best way to handle it because you have to clear it by software every time.
Describe the bug
rtc_get_time
returns error-61
when reading the time from a RV-8263-C8 RTC which means that the OS flag is set.To Reproduce
Use the
rtc_get_time
API call with a RV-8263-C8 device.Expected behavior
OS flag should be cleared when reading the time and the flag is set so the next read will be successful.
Environment (please complete the following information)
Additional context
The OS flag is never cleared and so the oscillator doesn´t run anymore if the flag is set. The flag must be cleared by software.
@jakubtopic We missed this in our initial discussion about the OS flag. There is an issue that
get_time
doesn´t work anymore as soon as the flag is set. I would like solve this issue in this way inrv8263c8_time_get
:So the application get´s an error when the flag is set and the flag is reset. If this error happens again the application will get the same error again.
What do you think? I think it´s the best way to handle it because you have to clear it by software every time.