jsimmonds2

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

ConnorRigby

Nerves Core Team

I don’t actually think you should need an overlay to enable the DS3231.

in make linux-menuconfig
check device driversreal time clock supportDallas/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

fhunleth

Co-author of Nerves

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

ConnorRigby

Nerves Core Team

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.

Where Next?

Popular in Questions Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
Kurisu
For example for a current url like http://localhost:4000/cosmetic/products?_utf8=✓&query=perfume&page=2, I would like to get: ...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lists...
New
tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New

Other popular topics Top

Nvim
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help. Where are they similar? Where do they differ the m...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

We're in Beta

About us Mission Statement