You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RTC save writes the weekday in binary; the RX8130CE's WEEK register is one-hot #39
zephcore_rtc_save() writes the day of the week as a binary 0-6 (0 = Sunday) into whichever time-block byte the date does not use. That suits the DS3231, PCF8563 and RV3028. It is wrong for the RX8130CE, whose WEEK register (13h) is one-hot.
The manual: Epson RX8130CE Application Manual ETM50E-10, §14.1.2 "Week counter", Table 15, p. 27: "The day (of the week) is indicated by 7 bits, bit 0 to bit 6", Sunday 01h, Monday 02h … Saturday 40h, and "Do not set '1' to more than one day at the same time."
What ZephCore writes:
Day
Should be
ZephCore writes
Sunday
01h
00h: no day
Monday
02h
01h: Sunday
Wednesday
08h
03h: two days at once
Saturday
40h
06h: two days at once
The time and date are unaffected, since ZephCore never reads the weekday back, but the chip's week counter holds an invalid value after every sync. It matters only to whatever reads it, such as a weekday alarm or another firmware.
Affected boards: any that include rtc-i2c.dtsi with an RX8130CE fitted at 0x32. meshtracker_x1's own 0x32 descriptor (RX8900 layout) needs the same check against that part's data sheet.
Fix direction: a per-descriptor property for the weekday encoding (binary or one-hot), set on the RX8130CE descriptor, with the save writing 1 << dow for one-hot.
Found by the local review of #38. Not fixed there, being pre-existing and outside its scope.
MeshCore has the same defect: RTC_RX8130CE::setTime() in src/helpers/RTC_RX8130CE.cpp writes bin2bcd(t->tm_wday) & 0x07 to 13h, and getTime() reads it back the same way (checked at ptr727/meshcore-dev-MeshCore dev3e3150c, which includes the latest upstream merge). Passed to the MeshCore session to decide its upstream handling.
MeshCore's fix for the same defect is upstream: meshcore-dev/MeshCore#3550 (issue meshcore-dev/MeshCore#3549), writing 1 << tm_wday and decoding the lowest set bit. ZephCore's fix should follow the same encoding.
A lead on the open meshtracker_x1 part, from the local review of #45 after dev (liquidraver#98) was merged in. Not proven.
The suspected gap. meshtracker_x1's rtc-ysn8900@32 node uses the RX8900 register layout, and its weekday is still written as 0-6.
The evidence so far. Linux drives epson,rx8900 through rtc-rv8803.c, which writes the weekday as 1 << tm_wday. If the YSN8900 follows the RX8900 there, this board has the same wrong-day defect as the RX8130CE, and the fix is to add weekday-one-hot; to that node.
What's missing. No RX8900 or YSN8900 data sheet is available here. The upstream PR for rtc: write the RX8130CE weekday one-hot #45 leaves this board unchanged until one confirms the encoding.
Resolved for meshtracker_x1. The Epson RX8900 Application Manual (ETM45E-11, §8.2.2, Table 15, p. 16) gives WEEK (03h) as one-hot, Sunday 01h to Saturday 40h. The YSN8900 brief has no register map, but its pinout matches the RX8900CE pin for pin, and the board already uses the RX8900 map. With Pieter's approval, weekday-one-hot is now set on the rtc-ysn8900@32 node and folded into liquidraver#101 (head 2621782). The YSN8900 programming guide is still unavailable, so this rests on it being an RX8900 second source. MeshCore is unaffected: its meshtracker_x1 never drives the chip.
Activity
ptr727 commentedon Oct 4, 2026
MeshCore has the same defect:
RTC_RX8130CE::setTime()insrc/helpers/RTC_RX8130CE.cppwritesbin2bcd(t->tm_wday) & 0x07to 13h, andgetTime()reads it back the same way (checked at ptr727/meshcore-dev-MeshCoredev3e3150c, which includes the latest upstream merge). Passed to the MeshCore session to decide its upstream handling.ptr727 commentedon Oct 4, 2026
MeshCore's fix for the same defect is upstream: meshcore-dev/MeshCore#3550 (issue meshcore-dev/MeshCore#3549), writing
1 << tm_wdayand decoding the lowest set bit. ZephCore's fix should follow the same encoding.ptr727 commentedon Oct 5, 2026
A lead on the open meshtracker_x1 part, from the local review of #45 after
dev(liquidraver#98) was merged in. Not proven.rtc-ysn8900@32node uses the RX8900 register layout, and its weekday is still written as 0-6.epson,rx8900throughrtc-rv8803.c, which writes the weekday as1 << tm_wday. If the YSN8900 follows the RX8900 there, this board has the same wrong-day defect as the RX8130CE, and the fix is to addweekday-one-hot;to that node.ptr727 commentedon Oct 5, 2026
Resolved for meshtracker_x1. The Epson RX8900 Application Manual (ETM45E-11, §8.2.2, Table 15, p. 16) gives WEEK (03h) as one-hot, Sunday
01hto Saturday40h. The YSN8900 brief has no register map, but its pinout matches the RX8900CE pin for pin, and the board already uses the RX8900 map. With Pieter's approval,weekday-one-hotis now set on thertc-ysn8900@32node and folded into liquidraver#101 (head 2621782). The YSN8900 programming guide is still unavailable, so this rests on it being an RX8900 second source. MeshCore is unaffected: its meshtracker_x1 never drives the chip.ptr727 commentedon Oct 10, 2026
Fixed upstream by liquidraver#101, merged 2026-10-06: the RX8130CE and YSN8900 weekday is written one-hot.