Skip to content

Support diagnostic text reads from the RTC device - #2

Merged
JohnAmadis merged 1 commit into
mainfrom
feat/rtc-text-read
Oct 16, 2026
Merged

JohnAmadis merged 1 commit into
mainfrom
feat/rtc-text-read

Conversation

@JaxCalder

Copy link
Copy Markdown
Contributor

cat /dev/rtc previously failed because the driver rejected read operations. Return a 20-byte diagnostic line, YYYY-MM-DDTHH:MM:SS\n, followed by EOF. The line carries the device's civil time without assuming a timezone.

Capture time on the first nonempty read per open handle. Partial reads and seeks reuse the same snapshot, so a changing calendar cannot splice two timestamps together; reopen for fresh time. Unset clocks return ENODATA without caching the failure. Validate handle, read permissions, buffer and offset; setting time continues through the standard ioctl interface.

Validation: native ctest 3/3 with 14/14 driver steps, STM32F4/F7 builds, and STM32F746G-DISCO RTC 12/12 through VFS, dmdrvi 6/6, RNG 6/6. Actual cat output checked before and after restoring PC time. Snapshot/partial-read/EOF/buffer-guard/error cases are covered; console evidence and package hashes are in docs/testing.md.

This is a separate change based on main after the merge of #1.

@JohnAmadis
JohnAmadis merged commit 02b9761 into main Oct 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants