Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Jul 2022 15:22:29 -0300
From:      "Dr. Rolf Jansen" <freebsd-rj@cyclaero.com>
To:        John Kennedy <warlock@phouka.net>
Cc:        David Cornejo <dave@dogwood.com>, freebsd-arm@freebsd.org
Subject:   Re: RPI4 + ntpdate + unbound
Message-ID:  <D2CC7543-D04C-4588-8333-A87AFDF8F916@cyclaero.com>
In-Reply-To: <YsG6/tFzMG74jvT2@phouka1.phouka.net>
References:  <Yr/DPWc9Y%2Brp0J78@phouka1.phouka.net> <CAFnjQbuLQJJ9Y1wvGPB7kEeAts_WZXTj7T0ZU5o8TP9NvcKUGg@mail.gmail.com> <YsG6/tFzMG74jvT2@phouka1.phouka.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> Am 03.07.2022 um 12:51 schrieb John Kennedy <warlock@phouka.net>:
>=20
> On Fri, Jul 01, 2022 at 10:49:33PM -1000, David Cornejo wrote:
>> I always hated this about the RPIs - I put a DS3231 on mine and the
>> problem disappears. ...
>=20
> Yeah.  Not sure where Eben would cram it (much less the battery), but
> one of these days his form factor needs to expand a bit.  But with =
what
> I do with the RPI4 it runs hot, so I've got a good passive case, but
> this one hides the GPIO pins entirely and the active-cooling one I'm
> looking at is a big chunk of aluminum + fans, which means some pretty
> significant risers/headers to get it to clear the heatsink and some
> contention with the PWR/GRD pins to power the fan.
>=20
> Haven't dug into what RTC driver FreeBSD may support to see where I
> can stick the RTC.  I do want one, just not seeing options that jump =
out
> at me.

Before this just ended weekend, I would have recommended the DS3231 as =
well, because it is working very well on my BeagleBone's Black for years =
now. It is very well documented and FreeBSD comes with a kernel module =
for it. Beginning on last Friday I started with FreeBSD 13.1-RELEASE on =
a brand new RPi 4 B 2 GB, and with that one, attaching the DS3231 became =
a major hassle.

Here is the whole story:
  =
https://lists.freebsd.org/archives/freebsd-arm/2022-February/001024.html

On 19.02.2022 6:01, Brian Scott wrote:
> The MAX77620 driver introduced for an NVIDIA TEGRA210 system seems to=20=

> unilaterally claim anything at address 68. It doesn't understand the=20=

> DS3231 and fails to operate properly, but in claiming the device, the=20=

> ds3231 driver doesn't get a chance. This is compounded by the MAX77620=20=

> driver being compiled into the kernel by default so the loadable =
module=20
> doesn't get to try until after the wrong driver has claimed it.

As suggested by Brian Scott, I compiled a custom kernel without the =
NVIDIA Tegra option. Only, with that custom kernel my RPi 4 (0xb03115) =
stuck at boot right before mounting the system partition. Then I =
switched to FreeBSD 14.0-CURRENT in which the problem has been resolved, =
and with that my RPi and the DS3231 is properly working.

I got this one: =
https://produto.mercadolivre.com.br/MLB-971284468-ds3231-shield-relogio-te=
mpo-real-arduino-rtc-eeprom-at24c32-_JM

If you have a close look at the picture, you can see that I would have =
been able to change its address, by soldering the address pads A0, A1 =
and A2 respectively. Perhaps, I should have done this, since I would =
have liked to stay with RELEASE instead of CURRENT.

The DTS code for the DS3231 is given in said thread on the mailing list. =
Using the dtc utility, I compiled a .dtbo and placed it into =
/boot/msdos/overlays as ds3231-rpi4.dtbo. Then I added two lines to =
/boot/msdos/config.txt:

  gpio=3D2,3=3Da0
  dtoverlay=3Dds3231-rpi4

It is working now, but the operation felt like pulling teeth at the =
dentists. I am still surprised why we get the NVIDIA Tegra compiled in =
the kernel of a 13.1-RELEASE SD card image which according to its file =
name is destined to the Raspberry Pi's.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D2CC7543-D04C-4588-8333-A87AFDF8F916>