Trying to get my very basic Nerves (on RPi3B+) solution talking to an I2C RTC, the Maxim DS3231,
apparently a very supported device for Raspbian 9 !
Followed the steps documented but still no /dev/rtc appears.
The Raspberry Pi doc suggests turning on dtdebug=on in config.txt and then using the VideoCore debug utility to read the resulting logs . . problem is that the nerves_system_rpi3 buildroot image doesn’t carry the /opt/vc/bin or /opt/vc/lib folders !
Tried pushing those bits into rootfs_overlay but then the vcdbg utility still can’t load the shared object /opt/vc/lib/libelftoolchain.so . … and in fact none of the usual ld files seem to be around (/etc/ld.so.cache, /etc/ld.so.conf, etc.)
If you end up doing this frequently, take a look at toolshed. It has a number of IEx helper functions. One of them is cmd/1. It deals with Erlang vs. Elixir strings when calling :os.cmd() and also prints stdout as it’s generated rather than waiting until the program exits.
iex> use Toolshed
iex> cmd("LD_LIBRARY_PATH=/opt/vc/lib /opt/vc/bin/vcdbg log msg")
p.s. I didn’t realize that vcdbg could help debug DT issues. That’s really helpful!
p.p.s. I have the feeling that you downloaded a vcdbg binary that was built with the opposite hard float/soft float ABI setting that we use on Nerves and it caused frustration. I don’t think you should change what you’re doing now since you got it to work. However in the future, you can also add vcdbg to nerves_system_rpi3 by setting BR2_PACKAGE_RPI_FIRMWARE_INSTALL_VCDBG=y in the nerves_defconfig. This can also be found via make menuconfig, but it’s kind of buried.
Thanks alot for those details; very helpful for me !
Will investigate the hard/soft float setting on that vcdbg executeable . . though I just copied the exe and two .so from a vanilla RPi3B+ host running Raspbian latest, with kenel 4.14.79+.
I’ll keep on exploring this one until I get that RTC running !
Maybe I first need to health-check the device with some manual probing using an ElixirALE.I2C port . .
It does respond, as expected, at 0x68.
Both Time and the “water under the bridge” have flowed . .
Next thing I (was) going to try today was to get my bespoke nerves_system_rpi3 working so that I could use linux-menuconfig to add a driver for the ds1307 RTC ( in the vain hope of getting the i2c-rtc.dtbo doing something (anything at all) with my (healthy) Maxim DS3231 RTC I2C device but . . tried this . . now what !? (looks like I still need that linux-menuconfig to get the /dev/rtc to materialize)