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.

Last Post!

jsimmonds2

jsimmonds2

Love that phrase !! Thanks :grin:

Where Next?

Popular in Questions Top

vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
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
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

Other popular topics Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36820 110
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 44265 214
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
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

We're in Beta

About us Mission Statement