tobin
Getting second SPI interface to work with nerves_system_rpi3
I’m working on an Elixir application that I’m deploying to a Raspberry Pi Model B using Nerves and nerves_system_rpi3.
I’m communicating with devices using Circuits.SPI and the standard /dev/spidev0.0 and /dev/spidev/0.1 channels. Now I’d like to talk to more devices, and use the second SPI interface to do so (info about SPI devices).
To do this, I am led to believe that I need to add the following line to /boot/config.txt:
dtoverlay=spi1-3cs
I have therefore followed the instructions for overwriting files in the boot partition. I copied fwup.conf and config.txt to my '/configdirectory and edited them andconfig.exs` to point to one another.
However, when I deploy to my RPi, the devices do not show up:
iex> Toolshed.cmd "ls /dev/spi*"
/dev/spidev0.1
/dev/spidev0.0
I was hoping for a /dev/spidev1.0! My change is definitely there:
iex> Toolshed.cmd "grep spi /boot/config.txt"
dtparam=spi=on
dtoverlay=spi1-3cs
Help! How do I troubleshoot this? is there something I’m missing? I would appreciate any pointers I can get!
Trending in Questions
Other Trending 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
- #elixirconf-us
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










First 4 of 4 Posts!
jsimmonds2
Hi @tobin
If you add
dtdebug=ontoconfig.txtthe early boot that happens in the VideoCore 4 GPU will be logged.To see the log after Linux is booted, use
vcdbg log msg.Also see this “freshman” question thread in this forum.
(caveat, I’ve not (yet) used any SPI devices)
[edit]

I just now tried this on my Rpi3B+ with latest Nerves etc. and got the log ::
Failed to load overlay 'spi1-3cs'brfs: File read: /mfs/sd/overlays/spi1-3cs.dtband sure enough,
/boot/overlaysdoes not contain anyspi1*.dt?Drop the right
.dtboin there and things might work[edit++]
To "drop the right
.dtbo. . " you need to editfwup.confto make sure thespi1-3cs.dtbofile is copied in all the correct places.tobin
Fantastic! Thank you so much for that great answer.
I downloaded
spi1-3cs.dtbofrom the raspberrypi/firmware github and then added these lines to myfwup.conf:… a quick
mix firmware, and I’ve now got three more SPI channels to play with!tobin
Addendum: There are a couple more lines of
on-resource spi1-3cs.dtbo {...}I needed to add to myfwup.conf(I just copied what was there). Notably I had theBOOT_B_PART_OFFSETline but not the correspondingAline, which meant it only worked once every two times I deployed the firmware!jsimmonds2
@tobin, Hey, good work !
Think you didn’t need to fetch that
spi1-3cs.dtbofile . . that and many other overlays are already present in thenerves_system_rpi3artifacts cached in your~/.nervesfolder.Just change that file resource path to be like existing ones above coming from
images/rpi-firmware/overlays/