jsimmonds2
Device Tree overlay debugging (Adafruit DS3231 RTC breakout)
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.)
Most Liked
ConnorRigby
I don’t actually think you should need an overlay to enable the DS3231.
in make linux-menuconfig
check device drivers → real time clock support → Dallas/Maxim DS1307/37/38/39/40/41, ST M41T00, EPSON RX-8025, ISL12057
You can set that to * and you should have rtc0 after booting.
fhunleth
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.
ConnorRigby
Its essentially black magic… Just kidding, they are a little weird though. The kernel docs have a good gist of it: https://www.kernel.org/doc/Documentation/devicetree/overlay-notes.txt
You shouldn’t need to touch any device tree overlays to get any of the DS based real time clocks to work. They work via i2c so as long as you linux device has i2c enabled, you should be good to go.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








