Hello,
I'm currently testing the PCF2131 RTC with I2C connection, on a Variscite devkit powered by i.MX8M Plus with Yocto Kirkstone (kernel 5.15.71).
The RTC works fine, but I have some strange behavior with the timestamp functions.
This is what I've done to make it work:
By default, as the datasheet states, the battery switch over is not active and timestamps save only the first triggered event (and not overwrites itself when triggered again).
I'm interested in:
To do so I made the following changes:
/* Enable timestamp function. */
ret = regmap_update_bits(pcf2127->regmap,
pcf2127->cfg->ts[ts_id].reg_base,
PCF2127_BIT_TS_CTRL_TSOFF,
0);
ret = regmap_update_bits(pcf2127->regmap,
pcf2127->cfg->ts[ts_id].reg_base,
PCF2127_BIT_TS_CTRL_TSM,
0);
// Set default behavour of RTC
// Activate switchover and low battery
ret = regmap_update_bits(pcf2127->regmap,
PCF2127_REG_CTRL3,
PCF2127_BIT_CTRL3_BTSE,
1);
ret = regmap_update_bits(pcf2127->regmap,
PCF2127_REG_CTRL3,
PCF2127_BIT_CTRL3_BF |
PCF2127_BIT_CTRL3_PWR0 |
PCF2127_BIT_CTRL3_PWR1 |
PCF2127_BIT_CTRL3_PWR2,
0);
Everything seems to work fine, the RTC time is correct and is maintained when going with the battery. Timestamps correctly overwrite itself when triggered.
The problem are the following:
Thank you in advande for any help,
Best regards
Reboot means power on reset for RTC, right ? if yes, all of the RTC registers will be set as default value.