Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1707139 - DS3231 RTC Module doesn't work properly
Summary: DS3231 RTC Module doesn't work properly
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: rawhide
Hardware: armhfp
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: ARMTracker
TreeView+ depends on / blocked
 
Reported: 2019-05-06 21:28 UTC by Michael
Modified: 2021-06-12 15:24 UTC (History)
21 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-06-12 15:24:11 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Michael 2019-05-06 21:28:23 UTC
Description of problem:
I have DS3231 RTC Module that works fine under centos arm arch, but under Fedora arm arch I can't get current date and time from this hardware RTC clock

Version-Release number of selected component (if applicable):
last updates

Steps to Reproduce:
1. connect DS3231 RTC to Raspberry Pi 3 
2. add options to file /boot/efi/config.txt
dtparam=i2c_arm=on
dtoverlay=upstream,i2c-rtc,ds3231
3. create file
echo -e "i2c-dev" >> /etc/modules-load.d/i2c.conf
4. dnf -y install i2c-tools && reboot

Actual results:
dmesg shows
hctosys: unable to open rtc device (rtc0)

sudo hwclock -r
hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --verbose option to see the details of our search for an access method.


Expected results:
hwclock have to get actual time from hardwate RTC


Additional info:

sudo hwclock -r --verbose
hwclock из util-linux 2.33.2
System Time: 1557177406.430509
Trying to open: /dev/rtc0
Trying to open: /dev/rtc
Trying to open: /dev/misc/rtc
hwclock: Cannot access the Hardware Clock via any known method.

Comment 1 Michael 2019-06-08 08:52:09 UTC
I've fixed my problem. I added new systemd unit

cat >> /lib/systemd/system/ebb_hwclock.service

[Unit]
Description=EBB RTC Service
Before=getty.target

[Service]
Type=oneshot
ExecStartPre=/bin/sh -c "/bin/echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device"
ExecStart=/sbin/hwclock -s -f /dev/rtc1
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target



Then enable new unit and reboot system

sudo systemctl enable ebb_hwclock
sudo reboot

Comment 2 Peter Robinson 2020-04-14 07:36:18 UTC
This is nothing to do with i2c-tools.

Comment 3 Peter Robinson 2021-06-12 15:24:11 UTC
There's documentation on how to use HATs with Fedora here: https://fedoraproject.org/w/index.php?title=Architectures/ARM/Raspberry_Pi/HATs

The hw clock support was improved in F-34.


Note You need to log in before you can comment on or make changes to this bug.