Trouble enabling SPI1 hardware with debian 4.4.9

249 views
Skip to first unread message

William Wendin

unread,
Aug 20, 2016, 5:42:12 PM8/20/16
to BeagleBoard
Background Info:
1) We are using BeagleBone Black to power our robot, using it since November.  
2) We use ADC, I2C1, I2C2, SPI0, 5 PWMs, and almost every available GPIO.  We have all these working using overlays, or config-pin, whichever is needed.   All is good.
3) Up until now I have not had to alter the default kernel or uEnv.txt.*
4) Upgraded to 4.4.9 a month or two ago.    I am up-to-date with all "apt-get update" and "apt-get upgrade".
5) /boot/uEnv.txt is attached.
6) root@beaglebone:/home/debian# uname -a
           Linux beaglebone 4.4.9-ti-r25 #1 SMP Thu May 5 23:08:13 UTC 2016 armv7l GNU/Linux

The problem: Now we need SPI1 (yes, we need two SPI busses).     I want to use all the IOs listed above  (see #2).

I think the best way is to use the default universal cape that comes with 4.4.9 (see above where I use it for all my IOs with little effort), but enable SPI1 instead of MCASP.

What I've tried:
* I've seen that folks say that the only way to add SPIDEV1 overlay is via /etc/rc.local (echo 'BB-SPIDEV1' > /sys/devices/platform/bone_capemgr/slots).    However, that then wipes out the availability of I2C, PWMs, etc.
* I've also tried adding BB-SPIDEV1 via uEnv.txt but that didn't work at all.

I've spent a few days trying various combination and can't find it.   Looked at source code too to try and see what is up, but didn't figure it out yet.

I guess my idea of the "best way" is heading down the wrong path.   

Questions:
* Do I have to make a whole new universal custom cape?
* Follow on question: Anybody have a way to turn on everything I use (see #2 above) and SPIDEV1 too?

William Wendin

unread,
Aug 20, 2016, 5:42:50 PM8/20/16
to BeagleBoard
uEnv.txt

William Wendin

unread,
Aug 20, 2016, 6:29:39 PM8/20/16
to BeagleBoard
Made a mistake in original post.   Should read:

What I've tried:
* I've tried adding BB-SPIDEV1 via uEnv.txt.   SPI1 now works.    However, that wipes out the availability of I2C, PWMs, etc which I don't know how to repair????
* I've seen that folks say that the only way to add SPIDEV1 overlay is via /etc/rc.local (echo 'BB-SPIDEV1' > /sys/devices/platform/bone_capemgr/slots).     But that didn't work at all for me (SPI1 not enabled AND it wipes out availability of I2C, PWMs etc).


On Saturday, August 20, 2016 at 2:42:12 PM UTC-7, William Wendin wrote:

William Hermans

unread,
Aug 20, 2016, 7:09:55 PM8/20/16
to beagl...@googlegroups.com
You'll need to put all your pin mux into one file. I'd probably test with universal io, to see if you can get it working that way first, and then perhaps you'll have to put that, or all pin mux into the board file.

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/353acaa9-0512-4099-a171-2b5cc0e2216c%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

William Wendin

unread,
Aug 24, 2016, 12:44:19 PM8/24/16
to BeagleBoard
I have tried these steps:
* altering cape-universaln-00A0.dts by uncommenting every spi2 lines in there (I called it universalbbb-00A0.dts).  Created new dtbo.  Copied it to /lib/firmware
* Changed uEnv.txt to "cmdline=coherent_pool=1M quiet cape_universal=disable"    Trying to load universalbbb in uEnv.txt DOES NOT work.
* root@beaglebone:/# echo 'universalbbb' > /sys/devices/platform/bone_capemgr/slots
* I see in dmesg that above fails to config debian pins 100, 101, 103

I tried some other things after above steps to see if I can fix it at runtime:
* config-pin manually to spi:
root@beaglebone:/# config-pin P9.29 spi
bash: /sys/devices/platform/ocp/ocp*P9_29_pinmux/state: No such file or directory
Cannot write pinmux file: /sys/devices/platform/ocp/ocp*P9_29_pinmux/state
* add cape overlay BB-SPIDEV1
root@beaglebone:/# echo 'BB-SPIDEV1' > /sys/devices/platform/bone_capemgr/slots
bash: echo: write error: File exists

I'm going to have to give up for now as I spent whole day yesterday on this.   Need to move on to other stuff but will return.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.

Danny B

unread,
Sep 26, 2016, 9:33:17 AM9/26/16
to BeagleBoard
Was there any luck on getting this to work?

William Wendin

unread,
Sep 27, 2016, 1:31:26 AM9/27/16
to BeagleBoard
Hi Danny,

No, I did not get spi2 working (SPI1_XXXX pins on P9 header) with all the other pins enabled.   I gave up for now.   Wasn't sure what to try next...   Maybe I don't understand William Hermans' instructions.

Jonatan Magnusson

unread,
Sep 27, 2016, 4:19:13 AM9/27/16
to BeagleBoard
Not sure if this is related, but I had problems getting SPI1 working as well. When I switched to SPI0 things started working.

There's a thread about it here: http://marc.info/?l=linux-omap&m=147152249802561&w=2

Regards,
Jonatan
Reply all
Reply to author
Forward
0 new messages