• Re: Activate a Real Time Clock chip on I2C in Raspberry Pi 4B with Debi

    From Diederik de Haas@21:1/5 to Rick Thomas on Sun Apr 16 10:01:08 2023
    Copy: debian-arm@lists.debian.org
    Copy: gwolf@debian.org

    On Sunday, 16 April 2023 04:47:37 CEST Rick Thomas wrote:
    I've got a Raspberry Pi 4B (4GB) with a DS3231 RTC module. I can make the combo work with Ubuntu and RaspberryPI-OS. I'd like to try it with the plain-vanilla Debian from <https://raspi.debian.net/tested-images/> but I can't find instructions for activating the I2C and RTC hardware in that OS.

    Documentation/devicetree/bindings/rtc/rtc-ds1307.yaml in the kernel source describes how one could use it ('compatible = "maxim,ds3231"' for DS3231).
    I think you should make a DeviceTree Overlay, but I don't know how to do that. -----BEGIN PGP SIGNATURE-----

    iHUEABYIAB0WIQT1sUPBYsyGmi4usy/XblvOeH7bbgUCZDurRAAKCRDXblvOeH7b boHgAP97KuQJu5vFxeTOsmtssEtv91uReMSjgDOVjFz5uB8OSgD/buxAZR8fwH7q MuT3fBBvVf4CpgehG67xduwh5j0vdgg=
    =dM3F
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Georg Gast@21:1/5 to All on Sun Apr 16 11:30:01 2023
    Am Sun, 16 Apr 2023 10:01:08 +0200
    schrieb Diederik de Haas <didi.debian@cknow.org>:

    On Sunday, 16 April 2023 04:47:37 CEST Rick Thomas wrote:
    I've got a Raspberry Pi 4B (4GB) with a DS3231 RTC module. I can
    make the combo work with Ubuntu and RaspberryPI-OS. I'd like to
    try it with the plain-vanilla Debian from <https://raspi.debian.net/tested-images/> but I can't find
    instructions for activating the I2C and RTC hardware in that OS.

    Documentation/devicetree/bindings/rtc/rtc-ds1307.yaml in the kernel
    source describes how one could use it ('compatible = "maxim,ds3231"'
    for DS3231). I think you should make a DeviceTree Overlay, but I
    don't know how to do that.

    I got this working with that systemd unit on a Rpi3 but should also
    work on a RPi4. Maybe you need to adjust the modprobe sequence. I guess
    the 2708 is 2835 on the Pi4.

    cat /etc/systemd/system/hwclock-pi.service
    [Unit]
    Description=HWClock at the I2C Bus of the Raspberry pi
    Before=basic.target
    Conflicts=shutdown.target
    DefaultDependencies=no

    [Service]
    Type=oneshot
    ExecStart=/bin/sh -c "modprobe i2c_bcm2835 && modprobe i2c_bcm2708 &&
    modprobe rtc_ds1307 && sleep 1 && echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device && /sbin/hwclock -s" ExecStop=/sbin/hwclock -w RemainAfterExit=yes

    [Install]
    WantedBy=basic.target

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From gene heskett@21:1/5 to Diederik de Haas on Sun Apr 16 13:20:01 2023
    On 4/16/23 04:01, Diederik de Haas wrote:
    On Sunday, 16 April 2023 04:47:37 CEST Rick Thomas wrote:
    I've got a Raspberry Pi 4B (4GB) with a DS3231 RTC module. I can make the >> combo work with Ubuntu and RaspberryPI-OS. I'd like to try it with the
    plain-vanilla Debian from <https://raspi.debian.net/tested-images/> but I
    can't find instructions for activating the I2C and RTC hardware in that OS.

    Documentation/devicetree/bindings/rtc/rtc-ds1307.yaml in the kernel source describes how one could use it ('compatible = "maxim,ds3231"' for DS3231).
    I think you should make a DeviceTree Overlay, but I don't know how to do that.

    The last time I made a realtime preempt kernel for an armhf, the
    makefile did that. Std output from a make menuconfig, an rpi4b runs it
    just as if it doesn't know any better, has been since Feb 20, 2020.

    Cheers, Gene Heskett.
    --
    "There are four boxes to be used in defense of liberty:
    soap, ballot, jury, and ammo. Please use in that order."
    -Ed Howdershelt (Author, 1940)
    If we desire respect for the law, we must first make the law respectable.
    - Louis D. Brandeis
    Genes Web page <http://geneslinuxbox.net:6309/>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Diederik de Haas@21:1/5 to All on Sun Apr 16 14:11:44 2023
    On Sunday, 16 April 2023 11:17:43 CEST Georg Gast wrote:
    ExecStart=/bin/sh -c "modprobe i2c_bcm2835 && modprobe i2c_bcm2708 && modprobe rtc_ds1307 && sleep 1 && echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device && /sbin/hwclock -s"

    Nice :-)
    I wonder whether this (essentially) is what a DTO does.
    I'm pretty sure that based on the 'compatible' the appropriate kernel module gets loaded (rtc_ds1307 in this case) and what you described above, seems reasonable to be the rest of what it does/triggers.
    -----BEGIN PGP SIGNATURE-----

    iHUEABYIAB0WIQT1sUPBYsyGmi4usy/XblvOeH7bbgUCZDvmAAAKCRDXblvOeH7b bmsFAQDkI8JrGhAMywFJWJ99fjfj1H4yHzafWYapY02PS7X55AD6A85Gwla5XWu3 3H16zc8/dFnwxKh13cF9fWm3p4okPgQ=
    =MSR/
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rick Thomas@21:1/5 to Georg Gast on Mon Apr 17 04:10:03 2023
    Thanks for your response, Georg!

    Is there somewhere that these modules are documented that I can read-up for a more detailed understanding?

    As an experiment, I tried running the following (It didn't work, but maybe you can suggest a modification that will. I'm probably not fully understanding something!):
    modprobe i2c_bcm2835 &&
    modprobe rtc_ds1307 &&
    sleep 1 &&
    echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device &&
    /sbin/hwclock -r
    This is what I got when I tried it:
    hwclock: Cannot access the Hardware Clock via any known method.

    and when I tried:
    i2cdetect -y 1
    I got"
    Error: Could not open file `/dev/i2c-1' or `/dev/i2c/1': No such file or directory

    I found this in journalctl :
    Apr 16 18:23:33 pi kernel: rtc-ds1307: probe of 1-0068 failed with error -121
    Apr 16 18:23:33 pi kernel: i2c i2c-1: new_device: Instantiated device ds1307 at 0x68

    Is rtc_ds1307 the wrong module for my DS3231 rtc hardware?

    Thanks!
    Rick

    =================================================================
    On Sun, Apr 16, 2023, at 2:17 AM, Georg Gast wrote:
    Am Sun, 16 Apr 2023 10:01:08 +0200
    schrieb Diederik de Haas <didi.debian@cknow.org>:

    On Sunday, 16 April 2023 04:47:37 CEST Rick Thomas wrote:
    I've got a Raspberry Pi 4B (4GB) with a DS3231 RTC module. I can
    make the combo work with Ubuntu and RaspberryPI-OS. I'd like to
    try it with the plain-vanilla Debian from
    <https://raspi.debian.net/tested-images/> but I can't find
    instructions for activating the I2C and RTC hardware in that OS.

    Documentation/devicetree/bindings/rtc/rtc-ds1307.yaml in the kernel
    source describes how one could use it ('compatible = "maxim,ds3231"'
    for DS3231). I think you should make a DeviceTree Overlay, but I
    don't know how to do that.

    I got this working with that systemd unit on a Rpi3 but should also
    work on a RPi4. Maybe you need to adjust the modprobe sequence. I guess
    the 2708 is 2835 on the Pi4.

    cat /etc/systemd/system/hwclock-pi.service
    [Unit]
    Description=HWClock at the I2C Bus of the Raspberry pi
    Before=basic.target
    Conflicts=shutdown.target
    DefaultDependencies=no

    [Service]
    Type=oneshot
    ExecStart=/bin/sh -c "modprobe i2c_bcm2835 && modprobe i2c_bcm2708 && modprobe rtc_ds1307 && sleep 1 && echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device && /sbin/hwclock -s" ExecStop=/sbin/hwclock -w RemainAfterExit=yes

    [Install]
    WantedBy=basic.target

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Reco@21:1/5 to Rick Thomas on Mon Apr 17 10:40:01 2023
    Hi.

    On Sun, Apr 16, 2023 at 06:41:53PM -0700, Rick Thomas wrote:
    I found this in journalctl :
    Apr 16 18:23:33 pi kernel: rtc-ds1307: probe of 1-0068 failed with error -121
    Apr 16 18:23:33 pi kernel: i2c i2c-1: new_device: Instantiated device ds1307 at 0x68

    Is rtc_ds1307 the wrong module for my DS3231 rtc hardware?

    No, because ds1307 kernel module should work with DS3231.
    But the address of the device (0x68) on I2C bus could be different,
    or the device is actually connected to another I2C bus (i.e. - not 1st).

    Consider running i2cdetect to clarify things.

    Reco

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rick Thomas@21:1/5 to Reco on Mon Apr 17 12:10:01 2023
    Sadly, when I do:
    i2cdetect -l
    I get nothing back. Leading me to conclude that there are no busses available.

    FWIW, when I do:
    /sbin/hwclock -vr
    I get:
    hwclock from util-linux 2.36.1
    System Time: 1681724077.614748
    Trying to open: /dev/rtc0
    Trying to open: /dev/rtc
    Trying to open: /dev/misc/rtc
    No usable clock interface found.
    hwclock: Cannot access the Hardware Clock via any known method.

    Also FWIW, when I do:
    ls -l /dev/i2c*
    I get:
    ls: cannot access '/dev/i2c*': No such file or directory

    Further confirming that there are no available busses.

    Is it possible that I need to modprobe a different (or additional) module than "i2c_bcm2835"?

    Thanks!
    Rick

    PS: I'm still wondering if there is some kind of documentation of these modules and what they do that would give me a bit of background for this project.


    On Mon, Apr 17, 2023, at 1:10 AM, Reco wrote:
    Hi.

    On Sun, Apr 16, 2023 at 06:41:53PM -0700, Rick Thomas wrote:
    I found this in journalctl :
    Apr 16 18:23:33 pi kernel: rtc-ds1307: probe of 1-0068 failed with error -121
    Apr 16 18:23:33 pi kernel: i2c i2c-1: new_device: Instantiated device ds1307 at 0x68

    Is rtc_ds1307 the wrong module for my DS3231 rtc hardware?

    No, because ds1307 kernel module should work with DS3231.
    But the address of the device (0x68) on I2C bus could be different,
    or the device is actually connected to another I2C bus (i.e. - not 1st).

    Consider running i2cdetect to clarify things.

    Reco

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Reco@21:1/5 to Rick Thomas on Mon Apr 17 12:40:01 2023
    Hi.

    On Mon, Apr 17, 2023 at 02:48:44AM -0700, Rick Thomas wrote:
    Sadly, when I do:
    i2cdetect -l
    I get nothing back. Leading me to conclude that there are no busses available.

    "modprobe i2c-dev" should fix that.

    Reco

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rick Thomas@21:1/5 to Reco on Mon Apr 17 13:50:01 2023
    That helps some...

    root@pi:~# i2cdetect -l
    i2c-3 i2c bcm2835 (i2c@7e804000) I2C adapter
    i2c-1 i2c Broadcom STB : I2C adapter
    i2c-2 i2c bcm2835 (i2c@7e205000) I2C adapter
    i2c-0 i2c Broadcom STB : I2C adapter

    and:
    root@pi:~# i2cdetect -y 3
    0 1 2 3 4 5 6 7 8 9 a b c d e f
    00: -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --

    All other busses (0 1 and 2 as arguments to i2cdetect give no devices)

    So, if I change "i2c-1" to "i2c-3" in the "echo > /sys/class ..." I find that the hwclock command now works!

    Now all I have to do is get all that into a systemd service file so it is done at boot time.

    It's late now. I'll try that tomorrow!

    Thanks very much to all who contributed!
    Rick

    PS: Anybody who can explain why it has to be bus 3 -- and how I could have predicted that -- will get a hundred Internet guru-points!

    On Mon, Apr 17, 2023, at 3:39 AM, Reco wrote:
    Hi.

    On Mon, Apr 17, 2023 at 02:48:44AM -0700, Rick Thomas wrote:
    Sadly, when I do:
    i2cdetect -l
    I get nothing back. Leading me to conclude that there are no busses available.

    "modprobe i2c-dev" should fix that.

    Reco

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Wise@21:1/5 to Georg Gast on Tue Apr 18 02:00:01 2023
    On Sun, 2023-04-16 at 11:17 +0200, Georg Gast wrote:

    ExecStart=/bin/sh -c "modprobe i2c_bcm2835 && modprobe i2c_bcm2708 && modprobe rtc_ds1307 && sleep 1 && echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device && /sbin/hwclock -s"

    I feel like there should be a better way to do this than manually doing
    /sys changes? Is there no i2c command for wrapping /sys i2c changes?

    --
    bye,
    pabs

    https://wiki.debian.org/PaulWise

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEYQsotVz8/kXqG1Y7MRa6Xp/6aaMFAmQ93U8ACgkQMRa6Xp/6 aaPEtA//V7TeBVQQ1mc5sXHI6DBL4b8gGJMloj9HsVkRMdrGICkl88A2SVwtE/Pa HS52WXESPsfl1OGjm1ShGOTlzIfs9tjMDaCV0n9Yu5ddtSN5WFJUy5zkkzcsKxF4 p0FIMwtWWP80GmgAcwNQDZkCdGAQIyLuUj4mXOvLzC8Mb/WlnMC5AwUeSshbwLav qxAgOiHLGLv5VbvBPz2We1+WHqq0542pBPED2vf0qqUJG6PWzLNTlIINStfPUgAQ mfNQClEnNhzjpHfwiT+1ING/nllFQXB532tUurKbCiy+s8p5G44yAsKIKQCaco9Q IP12lfFQ6F+/I25hZFs6ljvxKfRSy3vn6cXkkosHU7Ttx/K5FJoVIwRRaTSQ8sKB HEmY0SZD6Dh/ETJyBleQ4Fgti2mF5IXFO5zMJOTjfStLgUNwglMnN+xY6izoC0u6 cuQAr0E4f4lyZ3VXoYUnxAgQYa6qmq40MCyUirnAGMgB+Zt+Md9JWtbZEIWOpLel Qtapaar5kCrwUs1lCbsh4mudxu4uei5RcxwpVrLmI7DxlGyDabkluhW2RtbDKAt6 ZIldoEHEXI8cwXldj+bG1SoDoEB7XDDYymMREmIc/sBnYVo+2b9BLPgti9XG50AK rl+s3R/PM08DZcIIR1NvChqLx2VPL3DjB4soXk3fldYjh2xMEs0=
    =27Ol
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Wise@21:1/5 to Reco on Tue Apr 18 05:00:02 2023
    On Mon, 2023-04-17 at 13:39 +0300, Reco wrote:
    On Mon, Apr 17, 2023 at 02:48:44AM -0700, Rick Thomas wrote:
    Sadly,   when I do:
        i2cdetect -l
    I get nothing back.  Leading me to conclude that there are no busses available.

    "modprobe i2c-dev" should fix that.

    This seems like a usability issue, so I have sent a patch that
    adds a bunch of error messages in situations of silent failure:

    https://lore.kernel.org/linux-i2c/20230418023248.250685-1-pabs3@bonedaddy.net/T/

    --
    bye,
    pabs

    https://wiki.debian.org/PaulWise

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEYQsotVz8/kXqG1Y7MRa6Xp/6aaMFAmQ+BqEACgkQMRa6Xp/6 aaNibhAAt8rJSsESWqShZZWaUeGiPUb2AWj9COVY/oB2WRc8rZH8DXjOxmcMkpDH TNnmVS1Shs9iienu6oBciwSJl+FavgFWUibx1nLRWpwUt6H2zz4+hiNcfWRwqYsQ 2nfCrx5PA2gqSxrq8k0woQlJnFPvZR4jvKzrQ99AmdRvZ3npz21oeFlK5Mv3YI/C Vy5iosQKauwiWezuq/WMYavsHRdkXh+8t03s61f6aNPWLARXRVmpH9zcv2p1fBtO +MfTXaLFI/P5dOkHKq9FQQmvIOsSU3Jw3Ttox84X2IbjZR/yN57stlZbkxt0Z92m v4vdsBRsV5sIqw5s181SglUjqE0ysV/oHa7STUvGlKQaPp1CgVQqfdqfpqWJBNKF WaTv4N9Cltt3SjlAOWj3Pvm0beWCYNTvPWGG3aY5tLp0VKnVDKFfBKO3oIpHOjAV 5M0u8cG8RdNrJFBaMw/EPBO8QDhMfVDv9SYz/KXQHbKji2zBVOXJl7jwnbZECKWr iYtO/vKv2sIBH1dKWstQuwgT6myfxCesUuBnOHrWbaf2MjoX+uw8r9q4pswdszeH bI/UpbO1hecxIoSQMUe2Ls2LdJGRVEtuBmQ9jC6//8mtdadvSm5yq8pGsn0UgO8r XdXE4XZ0VQIjvkvFYfw9+OYU2Znp6IkTAaU77nQwGxHk7nJNbqU=
    =ZiSj
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rick Thomas@21:1/5 to Paul Wise on Tue Apr 18 07:40:01 2023
    On Mon, Apr 17, 2023, at 7:55 PM, Paul Wise wrote:
    On Mon, 2023-04-17 at 13:39 +0300, Reco wrote:
    On Mon, Apr 17, 2023 at 02:48:44AM -0700, Rick Thomas wrote:
    Sadly,   when I do:
        i2cdetect -l
    I get nothing back.  Leading me to conclude that there are no busses available.

    "modprobe i2c-dev" should fix that.

    This seems like a usability issue, so I have sent a patch that
    adds a bunch of error messages in situations of silent failure:

    https://lore.kernel.org/linux-i2c/20230418023248.250685-1-pabs3@bonedaddy.net/T/

    That would have been great while I was trying to track down the solution to this problem.
    What would have been even greater is if the error messages include references to some documentation that explained the problem and gave some clues to the larger context in which the problem arose.

    I'm still hoping that someone here can point me to documentation that can give me answers to questions like these: For example, I'd like to know why it chose bus3 rather than one of the other busses (0,1,2,4)? I'd also like to know what the various
    modules do and what kinds of parameters there are to influence the detailed behavior? And where is the documentation for the magic writing into /sys ?

    Big Thanks! to all who have contributed to this discussion.
    Rick

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Georg Gast@21:1/5 to All on Tue Apr 18 10:30:01 2023
    I searched for other ways but this was the only way to do it from userspace without device tree changes ... The online device tree overlays don't work without kernel support and a DT that got compiled with the "-@" option. That is not the case with stock
    Debian kernels. In my opinion, dtcs are nowadays more like firmware as they change more or less often between kernel versions. In the original meaning they were thought to stay the same even among different os like Linux and FreeBSD.

    Bye

    Georg

    18.04.2023 01:59:14 Paul Wise <pabs@debian.org>:

    On Sun, 2023-04-16 at 11:17 +0200, Georg Gast wrote:

    ExecStart=/bin/sh -c "modprobe i2c_bcm2835 && modprobe i2c_bcm2708 &&
    modprobe rtc_ds1307 && sleep 1 && echo ds1307 0x68 >
    /sys/class/i2c-adapter/i2c-1/new_device && /sbin/hwclock -s"

    I feel like there should be a better way to do this than manually doing
    /sys changes? Is there no i2c command for wrapping /sys i2c changes?

    --
    bye,
    pabs

    https://wiki.debian.org/PaulWise

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?=@21:1/5 to Rick Thomas on Tue Apr 18 17:30:01 2023
    Copy: debian-arm@lists.debian.org
    Copy: gwolf@debian.org
    Copy: didi.debian@cknow.org (Diederik de Haas)

    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------8BwcgaS2YvAlRtMO0P14EP2V
    Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64

    T24gNC8xNi8yMyAxMDowMSwgRGllZGVyaWsgZGUgSGFhcyB3cm90ZToNCj4gT24gU3VuZGF5 LCAxNiBBcHJpbCAyMDIzIDA0OjQ3OjM3IENFU1QgUmljayBUaG9tYXMgd3JvdGU6DQo+PiBJ J3ZlIGdvdCBhIFJhc3BiZXJyeSBQaSA0QiAoNEdCKSB3aXRoIGEgRFMzMjMxIFJUQyBtb2R1 bGUuICBJIGNhbiBtYWtlIHRoZQ0KPj4gY29tYm8gd29yayB3aXRoIFVidW50dSBhbmQgUmFz cGJlcnJ5UEktT1MuICBJJ2QgbGlrZSB0byB0cnkgaXQgd2l0aCB0aGUNCj4+IHBsYWluLXZh bmlsbGEgRGViaWFuIGZyb20gPGh0dHBzOi8vcmFzcGkuZGViaWFuLm5ldC90ZXN0ZWQtaW1h Z2VzLz4gYnV0IEkNCj4+IGNhbid0IGZpbmQgaW5zdHJ1Y3Rpb25zIGZvciBhY3RpdmF0aW5n IHRoZSBJMkMgYW5kIFJUQyBoYXJkd2FyZSBpbiB0aGF0IE9TLg0KPiANCj4gRG9jdW1lbnRh dGlvbi9kZXZpY2V0cmVlL2JpbmRpbmdzL3J0Yy9ydGMtZHMxMzA3LnlhbWwgaW4gdGhlIGtl cm5lbCBzb3VyY2UNCj4gZGVzY3JpYmVzIGhvdyBvbmUgY291bGQgdXNlIGl0ICgnY29tcGF0 aWJsZSA9ICJtYXhpbSxkczMyMzEiJyBmb3IgRFMzMjMxKS4NCj4gSSB0aGluayB5b3Ugc2hv dWxkIG1ha2UgYSBEZXZpY2VUcmVlIE92ZXJsYXksIGJ1dCBJIGRvbid0IGtub3cgaG93IHRv IGRvIHRoYXQuDQoNCkFuIG92ZXJsYXkgaXMgdGhlIG5pY2Ugd2F5IHRvIGFkZCB0aGUgUlRD IHRvIHRoZSBzeXN0ZW0uIFdpdGggdGhlIGRldmljZSANCnRyZWVzIHByb3ZpZGVkIGJ5IERl YmlhbiB0aGlzIGlzIGEgYml0IG1vcmUgY29tcGxpY2F0ZWQgdGhhbiB3aXRoIA0KUmFzcGJl cnJ5UEktT1MsIGJlY2F1c2UgdGhleSBhcmUgbm90IGNvbXBpbGVkIHVzaW5nIGR0YyAtQC4N Cg0KSWYgdGhlIHN5c2ZzIHN0dWZmIHRoYXQgR2VvcmcgR2FzdCBzdWdnZXN0ZWQgd29ya3Ms IEkgY2FuIGhlbHAgeW91IHRvIA0KY3JlYXRlIGEgZHQgb3ZlcmxheS4NCg0KQmVzdCByZWdh cmRzDQpVd2UNCg==

    --------------8BwcgaS2YvAlRtMO0P14EP2V--

    -----BEGIN PGP SIGNATURE-----

    iQEzBAEBCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmQ+s3sACgkQj4D7WH0S /k5+DQf/UUFZuuYBTwnbq3OMA1DKH5jE/WcMYwt9zOd3P00mwgUXAzImlVVIOYVH n477DnZrJGEfsWLxUe8iOHIk+ndqsvvYnnpbLmgnbwy/pZxFRs+VDwVAK0QDQfUO uoLt20x//p8dc4RRhHkTHcJNTkQsIftErO/xj9T7w3g0WDQ5qkBCgrOfiIC/6Kn8 x0bPf4nyADI2nZbazK4Gm/qrGlh12x6uV63mGSezpFCAPk3P6LgF7biwGtbth/gt EsxPYLQQEXtl9uujdD3WkTAiL7GP148RkkPef4RwxarDnjZZWa6Diz5dLxAVRuzC 2vo/WXddLNvFuJ2MN99DOGVtbtiuGQ==
    =Aqiq
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Wise@21:1/5 to Rick Thomas on Wed Apr 19 02:00:02 2023
    On Mon, 2023-04-17 at 22:21 -0700, Rick Thomas wrote:

    What would have been even greater is if the error messages include
    references to some documentation that explained the problem and gave
    some clues to the larger context in which the problem arose.

    The messages I sent that patch adding are for very simple issues;
    "/proc not mounted", "/sys not mounted" and "i2c-dev not loaded" and
    since they all have very simple solutions, I just added the commands
    to fix them instead of pointers to documentation about each error.

    Probably the i2c manual pages should get some links to the Linux kernel documentation and wiki for I2C. I'm unlikely to work on that though,
    hopefully someone else is willing to do that.

    For example, I'd like to know why it chose bus3 rather than one of
    the other busses (0,1,2,4)?

    I expect that depends on the bus driver code for your device,
    those do not seem to document their ordering though and it
    looks like your particular i2c bus driver has no documentation.

    https://www.kernel.org/doc/html/latest/i2c/busses/index.html

    I'd also like to know what the various modules do and what kinds of parameters there are to influence the detailed behavior?

    Looks like the devices are defined by DeviceTree, ACPI, board files, dynamically by drivers for other devices, hardware probing or sysfs:

    https://www.kernel.org/doc/html/latest/i2c/instantiating-devices.html

    And where is the documentation for the magic writing into /sys ?

    Seems to be here:

    https://www.kernel.org/doc/html/latest/i2c/instantiating-devices.html#method-4-instantiate-from-user-space
    https://www.kernel.org/doc/html/latest/i2c/i2c-sysfs.html

    These may also be useful:

    https://www.kernel.org/doc/html/latest/i2c/ https://archive.kernel.org/oldwiki/i2c.wiki.kernel.org/

    PS: I am subscribed, no need to CC me, please respect Reply-To.

    --
    bye,
    pabs

    https://wiki.debian.org/PaulWise

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEYQsotVz8/kXqG1Y7MRa6Xp/6aaMFAmQ/LocACgkQMRa6Xp/6 aaPWMw/+KJ6R3rP6i+arULZs38O23LqMdlvEyVEowyzvH0yM9jkiaB/9dkY6hzV6 aT02YaApub98u67ssJxU8cTljGDR2c7Ye63bZPiVkel9+kqkyowrffHZcwkm7eXt GP6NugBFbA52eDext6/Km4/jRbTcRlrnv8Nr3PIbaIsPZsHckURAVEKu6Gn2ZAiT IquD4FWC3yMhORPENVsrZlB17pYWl5b7itCkpMZ6Co4D7PF0nGhczTbAlsAHCp4m Nvgmt8x409kMjzis3I2+IVTlS8q7ghp7wIs7MxAmdS5pfXvkTRTJsyESh2wkDWeg y2DJmuJwPbt51vLy0PL6nKOQ1IV0AIo/A3h+5TkMkFtpqsabR3c0QKWYuiDqT2Uy LKAAJ4+OkTU6tTd+V+SQhZpej4fHIjhMrBv46S1BKWsUHM5EzGGVVYZnIPmETiuP Yktr5S0smDMztB+3YClZTMatJ51mJSiUX/ZJwyt7q7ovjZEBmzhGpEE6mGT1rq/a zwfOmZQLPcbYkiCgOMmNlUOUu//JQGio9SjXR32AE8Z6WcJBAj+KI1/l2wePPkJO x+4EaLexmKSV9b6idNO0kAK+EKUGwOa4twDXlLaoWU4kBjEOUGX48egHHOOObqpH mWskj61wrWeto1MQt7OYoKtro2seav9w8f7yXLc70dgMJ5xMHWw=
    =Ad3a
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rick Thomas@21:1/5 to Paul Wise on Wed Apr 19 08:30:01 2023
    Thanks very much, Pabs! I will follow up on those links and hopefully get a better understanding of what is going on and why. Perhaps the next time someone has a question like mine, I'll be able to be as helpful to them as the folks here have been to
    me!

    Rick

    On Tue, Apr 18, 2023, at 4:57 PM, Paul Wise wrote:
    On Mon, 2023-04-17 at 22:21 -0700, Rick Thomas wrote:

    What would have been even greater is if the error messages include
    references to some documentation that explained the problem and gave
    some clues to the larger context in which the problem arose.

    The messages I sent that patch adding are for very simple issues;
    "/proc not mounted", "/sys not mounted" and "i2c-dev not loaded" and
    since they all have very simple solutions, I just added the commands
    to fix them instead of pointers to documentation about each error.

    Probably the i2c manual pages should get some links to the Linux kernel documentation and wiki for I2C. I'm unlikely to work on that though, hopefully someone else is willing to do that.

    For example, I'd like to know why it chose bus3 rather than one of
    the other busses (0,1,2,4)?

    I expect that depends on the bus driver code for your device,
    those do not seem to document their ordering though and it
    looks like your particular i2c bus driver has no documentation.

    https://www.kernel.org/doc/html/latest/i2c/busses/index.html

    I'd also like to know what the various modules do and what kinds of
    parameters there are to influence the detailed behavior?

    Looks like the devices are defined by DeviceTree, ACPI, board files, dynamically by drivers for other devices, hardware probing or sysfs:

    https://www.kernel.org/doc/html/latest/i2c/instantiating-devices.html

    And where is the documentation for the magic writing into /sys ?

    Seems to be here:

    https://www.kernel.org/doc/html/latest/i2c/instantiating-devices.html#method-4-instantiate-from-user-space
    https://www.kernel.org/doc/html/latest/i2c/i2c-sysfs.html

    These may also be useful:

    https://www.kernel.org/doc/html/latest/i2c/ https://archive.kernel.org/oldwiki/i2c.wiki.kernel.org/

    PS: I am subscribed, no need to CC me, please respect Reply-To.

    --
    bye,
    pabs

    https://wiki.debian.org/PaulWise

    Attachments:
    * signature.asc

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)