jsimmonds2
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.)
Trending in Questions
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hello,
I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind.
However, when I launch mix phx.server, I get an error...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
I’m working on a small exercise involving update_in/3, and I came up with this solution:
data = %{
name: "Periodic Table",
category:...
New
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication):
toke...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ai
- #ecto-query
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #metaprogramming
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
ConnorRigby
I don’t actually think you should need an overlay to enable the DS3231.
in
make linux-menuconfigcheck
device drivers→real time clock support→Dallas/Maxim DS1307/37/38/39/40/41, ST M41T00, EPSON RX-8025, ISL12057You can set that to
*and you should havertc0after booting.jsimmonds2
Ok, two quick things about that . .
i2c-rtcDTB doco includes the DS3231 which should then provide the/dev/rtcchar special linkThanks anyways
How do I go about adding that VC optional package to my basic Nerves project ?
jsimmonds2
Inching toward enlightenment . .
Worked out how to run
/opt/vc/bin/vcdbgand, sure enough, the DT load debugging is there ! (Almost)How do I get the complete output of
:os.cmd(below) ?iex(fb2@fb2-5116)99> :os.cmd 'export LD_LIBRARY_PATH=/opt/vc/lib ; /opt/vc/bin/vcdbg log msg''001322.945: brfs: File read: /mfs/sd/config.txt\n001323.887: brfs: File read: 1479 bytes\n001333.499: HDMI:EDID error reading EDID block 0 attempt 0\n001334.804: HDMI:EDID error reading EDID block 0 attempt 1\n001336.101: HDMI:EDID error reading EDID block 0 attempt 2\n001337.399: HDMI:EDID error reading EDID block 0 attempt 3\n001338.694: HDMI:EDID error reading EDID block 0 attempt 4\n001339.992: HDMI:EDID error reading EDID block 0 attempt 5\n001341.287: HDMI:EDID error reading EDID block 0 attempt 6\n001342.586: HDMI:EDID error reading EDID block 0 attempt 7\n001343.882: HDMI:EDID error reading EDID block 0 attempt 8\n001345.180: HDMI:EDID error reading EDID block 0 attempt 9\n001346.239: HDMI:EDID giving up on reading EDID block 0\n001363.125: brfs: File read: /mfs/sd/config.txt\n001363.948: HDMI:Setting property pixel encoding to Default\n001364.006: HDMI:Setting property pixel clock type to PAL\n001364.068: HDMI:Setting property content type flag to No data\n001364.125: HDMI:Setting property fuzzy format match to enabled\n001584.974: gpioman: gpioman_get_pin_num: pin DISPLAY_DSI_PORT not defined\n001586.303: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead\n001586.378: hdmi: HDMI:>>>>>>>>>>>>>Rx sensed, reading EDID<<<<<<<<<<<<<\n001586.721: hdmi: HDMI:EDID error reading EDID block 0 attempt 0\n001588.028: hdmi: HDMI:EDID error reading EDID block 0 attempt 1\n001589.330: hdmi: HDMI:EDID error reading EDID block 0 attempt 2\n001590.632: hdmi: HDMI:EDID error reading EDID block 0 attempt 3\n001591.933: hdmi: HDMI:EDID error reading EDID block 0 attempt 4\n001593.235: hdmi: HDMI:EDID error reading EDID block 0 attempt 5\n001594.537: hdmi: HDMI:EDID error reading EDID block 0 attempt 6\n001595.839: hdmi: HDMI:EDID error reading EDID block 0 attempt 7\n001597.140: hdmi: HDMI:EDID error reading EDID block 0 attempt 8\n001598.442: hdmi: HDMI:EDID error reading EDID block 0 attempt 9\n001599.507: hdmi: HDMI:EDID giving up on reading EDID block 0\n001599.575: hdmi: HDMI: No lookup table for resolution group 0\n001599.637: hdmi: HDMI: hotplug attached with DVI support\n001599.709: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead\n001600.042: hdmi: HDMI:EDID error reading EDID block 0 attempt 0\n001601.348: hdmi: HDMI:EDID error reading EDID block 0 attempt 1\n001602.653: hdmi: HDMI:EDID error reading EDID block 0 attempt 2\n001603.959: hdmi: HDMI:EDID error reading EDID block 0 attempt 3\n001605.264: hdmi: HDMI:EDID error reading EDID block 0 attempt 4\n001606.569: hdmi: HDMI:EDID error reading EDID block 0 attempt 5\n001607.875: hdmi: HDMI:EDID error reading EDID block 0 attempt 6\n001609.180: hdmi: HDMI:EDID error reading EDID block 0 attempt 7\n001610.485: hdmi: HDMI:EDID error reading EDID block 0 attempt 8\n001611.790: hdmi: HDMI:EDID error reading EDID block 0 attempt 9\n001612.858: hdmi: HDMI:EDID giving up on reading EDID block 0\n001612.933: hdmi: HDMI: hotplug deassert\n001612.986: hdmi: HDMI: HDMI is currently off\n001613.037: hdmi: HDMI: changing mode to unplugged\n001613.101: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead\n001614.473: *** Restart logging\n001614.536: brfs: File read: 1479 bytes\n001618.178: brfs: File read: /mfs/sd/cmdline.txt\n001618.346: Read command line from file \'cmdline.txt\':\n001618.402: \'console=tty1 console=serial0,115200 fbcon=scrollback:1024k root=/dev/mmcblk0p2 rootwait consoleblank=0\'\n001618.699: brfs: File read: 341 bytes\n001773.870: brfs: File read: /mfs/sd/zImage\n001773.932: Loading \'zImage\' to 0x8000 size 0x264178\n001778.328: No kernel trailer - assuming DT-capable\n001778.415: brfs: File read: 2507128 bytes\n001781.363: brfs: File read: /mfs/sd/bcm2710-rpi-3-b-plus.dtb\n001781.426: Loading \'bcm2710-rpi-3-b-plus.dtb\' to 0x26c178 size 0x63e6\n001928.628: brfs: File read: 25574 bytes\n001933.099: brfs: File read: /mfs/sd/config.txt\n001933.479: dtparam: i2c_arm=on\n001950.237: dtparam: spi=on\n001964.748: dtparam: audio=on\n001984.044: brfs: File read: 1479 bytes\n001988.189: brfs: File read: /mfs/sd/overlays/rpi-ft5406.dtbo\n002000.911: Loaded overlay \'rpi-ft54' ++ ...iex(fb2@fb2-5116)100>NobbZ
Roughly and antested:
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.p.s. I didn’t realize that
vcdbgcould help debug DT issues. That’s really helpful!p.p.s. I have the feeling that you downloaded a
vcdbgbinary 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 addvcdbgtonerves_system_rpi3by settingBR2_PACKAGE_RPI_FIRMWARE_INSTALL_VCDBG=yin thenerves_defconfig. This can also be found viamake menuconfig, but it’s kind of buried.jsimmonds2
Elegant, useful and now tested
Thanks.
jsimmonds2
Thanks alot for those details; very helpful for me !
Will investigate the hard/soft float setting on that
vcdbgexecuteable . . though I just copied the exe and two.sofrom 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.
jsimmonds2
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_rpi3working so that I could uselinux-menuconfigto add a driver for the ds1307 RTC ( in the vain hope of getting thei2c-rtc.dtbodoing 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/rtcto materialize)iex(fb2@fb2-5116)1> ~c' echo ds3231 0x69 > /sys/class/i2c-adapter/i2c-1/new_device '|>:os.cmd()|>IO.puts11:33:23.801 [info] [ 32.630303] i2c i2c-1: new_device: Instantiated device ds3231 at 0x69jsimmonds2
Indeed ! As soon as I mustered the courage and followed the clear instructions on building a custom rpi3 system the interfaces appeared in
/dev/rtc0,/sys/class/rtc, etc.Thanks to you, @ConnorRigby
Only thing left for me to understand is how DT Overlays work and whether I still need to add one to get the DS3231-specific differences . . (?) , e.g.
iex(fb2@fb2-5116)1> ~c' cat /sys/devices/platform/soc/3f804000.i2c/i2c-1/1-0068/name '|>:os.cmd()|>IO.putsds3231:okConnorRigby
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.