Issues with Enabling SPIDev on Beaglebone Black

3,579 views
Skip to first unread message

Brendan Merna

unread,
Jun 16, 2015, 10:39:14 AM6/16/15
to beagl...@googlegroups.com
I'm trying to  enable SPI on boot up on my Beaglebone Black. I followed the wiki link below under the title 

SPI1 D1 Output and D0 Input


I created the .dts file and compiled it. I then moved it to /lib/firmware/ and then enabled the device overlay tree. Finally, I changed the uenv.txt file by adding the text shown and I removed a pound sign at the end of the document. I did this because the boot command to enable the SPI wasn't working and I thought it wasn't reading the last command because of the pound sign. Unfortunately, now that I removed it, I reset my Beaglebone Black and it gets stuck in a state with the Power LED and USR0,USR1, USR2, and USR3 all stuck on. No blinking and my computer doesn't recognize its there. I'm powering through the USB port and have tried resetting and powering down numerous times. This same state keeps coming up. Can anyone help?

Tutorial Link:
http://elinux.org/BeagleBone_Black_Enable_SPIDEV

emile.co...@gmail.com

unread,
Jul 3, 2015, 9:14:54 PM7/3/15
to beagl...@googlegroups.com
There is a bug in recent kernels that makes the "capemgr.enable_partno=BB-SPI1-01" part not work. It has something to do with the filesystem not being available during boot up (I don't pretend to know the exact technical reasons why).

I have been able to load the SPI device overlay during boot up by adding this line in the /etc/rc.local file (before the exit 0 line):

echo BB-SPI1-01 > /sys/devices/bone_capemgr.9/slots

You may have to replace 9 with the number of your particular cape manager. Using the * symbol does not work here for some reason.

Hope this helps.

William Hermans

unread,
Jul 3, 2015, 10:23:10 PM7/3/15
to beagl...@googlegroups.com
Brendan, what media were you using when this problem happened ? sdcard, or eMMC ? How did you make these changes ? This is important, since if you used a Windows machine to make changes to your uEnv.txt file. uboot does not like Windows line feeds ( \r \n ).

If eMMC, you can download, and setup an sdcard to boot, then mount the eMMC, and revert the changes to your uEnv.txt file.

If sdcard, then you *could* mount the sdcard in an x86 / x86-64 system running linux, and revert the changes in the uEnv.txt file. Then reinsert the sdcard into the beaglebone black, and power it up. It should then boot, so long as you did not make any other changes to the file.

 @emile

There is a bug in recent kernels that makes the "capemgr.enable_partno=BB-SPI1-01" part not work. It has something to do with the filesystem not being available during boot up (I don't pretend to know the exact technical reasons why).

Well . . . capemgr.enable= is only meant to work with 3.8.x kernels. 3.14.x kernels do not have capemgr, and kernels 4.0.x use a different keyword. I believe it is bone_capemgr.enable=.

Anyway the point is, things are different between different major kernel releases. *And* we would need to know which kernel was being used before making this assumption.


--
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...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

rudydelo...@gmail.com

unread,
Dec 2, 2015, 7:40:53 AM12/2/15
to BeagleBoard
Had a similar problem following the same tutorial, used Emile's answer, the DT overlay loads every time.
To check:
cat /sys/devices/bone_capemgr.*/slots

root@beaglebone:~# cat /sys/devices/bone_capemgr.*/slots
 0: 54:PF---
 1: 55:PF---
 2: 56:PF---
 3: 57:PF---
 4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
 5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
 8: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-SPI0-01
Message has been deleted

vinaydiv...@gmail.com

unread,
Feb 19, 2016, 10:19:44 AM2/19/16
to BeagleBoard

  1. Another solution is also simple, just include the line "CAPE=ADAFRUIT-SP0" in /etc/default/capemgr file. Then reboot and all should work fine.

Rudy Misek

unread,
Feb 22, 2016, 5:40:41 PM2/22/16
to beagl...@googlegroups.com
Vinay is right, tried it out on a new BBB I just got, enabled UART1,2,4 and 5 plus ADAFRUIT-SPI0 by adding CAPE=BB-UART1,BB-UART2,BB-UART4,BB-UART5,ADAFRUIT-SPI0
to /ect/default/capemgr and rebooted.

I can't load ADAFRUIT-SPI1 using the same method even though I have disabled HDMI and HDMIN

Vinay, have you been able to enable SPI1? 

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/2O0-NwbKc2M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.

Rudy Misek

unread,
Feb 22, 2016, 5:42:33 PM2/22/16
to beagl...@googlegroups.com
root@beaglebone:/sys/devices/bone_capemgr.9# cat slots
 0: 54:PF---
 1: 55:PF---
 2: 56:PF---
 3: 57:PF---
 4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
 5: ff:P-O-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
 6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN
 7: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART1
 8: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART2
 9: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART4
10: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART5
11: ff:P-O-L Override Board Name,00A0,Override Manuf,ADAFRUIT-SPI0
root@beaglebone:/sys/devices/bone_capemgr.9#

Rudy Misek

unread,
Feb 22, 2016, 8:09:36 PM2/22/16
to beagl...@googlegroups.com
Ok, compiled my own device tree overlays for SPI0, SPI1 and added CAPE=BB-UART1,BB-UART4,BB-UART5,BB-SPI0-01,BB-SPI1-01 to the /etc/default/capemgr file and it works.
Thanks for posting that Vinay!

Just a note to my previous post UART2 and SPI0 share the same pins.

Here is the link for SPI the device tree overlays I compiled, hopefully it will help someone out that is getting started with both the SPI's on the BBB: 

After downloading: (these steps will enable SPI0 and SPI1)
 1. Disable HDMI, pins are used by SPI1: root@beaglebone:~# vim /boot/uEnv.txt
 2. Remove # from line: cape_disable=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
 3. Put the .dtbo files you downloaded from the link above in /lib/firmware on your BBB
 4. Add CAPE=BB-SPI0-01,BB-SPI1-01 to /etc/default/capemgr file: root@beaglebone:~# vim /etc/default/capemgr
 5. Reboot the BBB
 6. root@beaglebone:/sys/devices/bone_capemgr.*
 7. root@beaglebone:/sys/devices/bone_capemgr.9# cat slots
     You should see:
     ff:P-O-L Override Board Name,00A0,Override Manuf,BB-SPI0-01
     ff:P-O-L Override Board Name,00A0,Override Manuf,BB-SPI1-01
Now you're good to go with both SPI's :D



jb...@eng.ucsd.edu

unread,
May 15, 2016, 6:27:34 PM5/15/16
to BeagleBoard, rudydelo...@gmail.com
Hi Rudy,

I am trying to enable SPI0 in BBB. I cannot access the link you gave. I would appreciate if you could update the link or post the file in another way.

p.s. - I am using the kernel 4.4.8 and cannot find capemgr things... 

vinaydiv...@gmail.com

unread,
May 16, 2016, 9:19:11 AM5/16/16
to BeagleBoard, rudydelo...@gmail.com, jb...@eng.ucsd.edu
Step 1 : Go to root@beaglebone: /boot#
Step 2 : Open uEnv.txt file
Step 3 : Inside the file

You will find these lines, so do the following: In case If you dont find these lines for your kernel, then just append the line "cape_enable=bone_capemgr.enable_partno=BB-SPIDEV0" to the end of the file.

##Example v4.1.x
#cape_disable=bone_capemgr.disable_partno=
cape_enable=bone_capemgr.enable_partno=BB-SPIDEV0

Step 4 : Reboot your BBB
Step 5 : Go to /sys/devices/platform/bone_capemgr# cat slots or dmesg to check.

Then check if your SPI device has been loaded.

This works with Linux beaglebone kernel 4.1.18-ti-r53

wi...@willnapier.com

unread,
Jul 19, 2016, 7:25:40 AM7/19/16
to BeagleBoard
Hello all, I am new to BBB. My eventual aim is to use the BBB to flash a rom with libreboot on my Lenovo Thinkpad. I am using this guide at eLinux. It says that I need to disable HDMI before I can enable SPI.
I couldn't locate the uEnv.txt file at first, because there isn't a /lib/ directory. It was found in /boot/

But when I do this, ie reboot and look, it seems that the HDMI is still there:

root@beaglebone:/var/lib/cloud9# cat /sys/devices/bone_capemgr.*/slots

0: 54:PF---
1: 55:PF---
2: 56:PF---
3: 57:PF---
4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
5: ff:P-O-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN
root@beaglebone:/var/lib/cloud9#

====

I have now tried the advice of Vinay:

Another solution is also simple, just include the line "CAPE=ADAFRUIT-SP0" in /etc/default/capemgr file. Then reboot and all should work fine.


This did not work. I still get the same slots listing.

I then followed this advice also from vinay:

Re: [beagleboard] Re: Issues with Enabling SPIDev on Beaglebone Black
Step 1 : Go to root@beaglebone: /boot#
Step 2 : Open uEnv.txt file
Step 3 : Inside the file

You will find these lines, so do the following: In case If you dont find these lines for your kernel, then just append the line "cape_enable=bone_capemgr.enable_partno=BB-SPIDEV0" to the end of the file.

##Example v4.1.x
#cape_disable=bone_capemgr.disable_partno=
cape_enable=bone_capemgr.enable_partno=BB-SPIDEV0

Step 4 : Reboot your BBB
Step 5 : Go to /sys/devices/platform/bone_capemgr# cat slots or dmesg to check.

Then check if your SPI device has been loaded.

This works with Linux beaglebone kernel 4.1.18-ti-r53

===========

This didn't work. there is no /sys/devices/platform/bone_capemgr.

I hope that given the limited purpose of using BBB I won't need to learn a whole lot about embedded systems, device tree overlays, etc, just in order to do flash my rom, however interesting it is!

Any help greatly appreciated. Will.


Auto Generated Inline Image 1
Auto Generated Inline Image 2

Vinay Divakar

unread,
Jul 19, 2016, 7:25:48 AM7/19/16
to wi...@willnapier.com, BeagleBoard, Rudy Misek, jb...@eng.ucsd.edu
Can you provide info about the kernel your using?

On 18 July 2016 at 13:02, <wi...@willnapier.com> wrote:
Hello all, I am new to BBB and using it to flash the ROM on my Lenovo Thinkpad T400 with Libreboot, using these instructions on eLinux.

I disabled HDMI on the Beaglebone by opening vi and removing the comment from the line that says it disables HDMI.

I couldn't locate the uEnv.txt file at first, because there isn't a /lib/ directory. It was found in /boot/

But when I did this, ie reboot and look, it seems that the HDMI is still there:

root@beaglebone:/var/lib/cloud9# cat /sys/devices/bone_capemgr.*/slots

0: 54:PF---
1: 55:PF---
2: 56:PF---
3: 57:PF---
4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
5: ff:P-O-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN
root@beaglebone:/var/lib/cloud9#

====

I have now tried the advice of Vinay:


Another solution is also simple, just include the line "CAPE=ADAFRUIT-SP0" in /etc/default/capemgr file. Then reboot and all should work fine.

========


This did not work. I still get the same slots listing.

I then followed this advice also from vinay:
============

Re: [beagleboard] Re: Issues with Enabling SPIDev on Beaglebone Black
Step 1 : Go to root@beaglebone: /boot#
Step 2 : Open uEnv.txt file
Step 3 : Inside the file

You will find these lines, so do the following: In case If you dont find these lines for your kernel, then just append the line "cape_enable=bone_capemgr.enable_partno=BB-SPIDEV0" to the end of the file.

##Example v4.1.x
#cape_disable=bone_capemgr.disable_partno=
cape_enable=bone_capemgr.enable_partno=BB-SPIDEV0

Step 4 : Reboot your BBB
Step 5 : Go to /sys/devices/platform/bone_capemgr# cat slots or dmesg to check.

Then check if your SPI device has been loaded.

This works with Linux beaglebone kernel 4.1.18-ti-r53

===============

This didn't work. there is no /sys/devices/platform/bone_capemgr.


I would be very grateful for any help with this. With thanks, Will


wi...@willnapier.com

unread,
Jul 19, 2016, 7:25:54 AM7/19/16
to BeagleBoard, rudydelo...@gmail.com, jb...@eng.ucsd.edu, vinaydiv...@gmail.com
Hello all, I am new to BBB and using it to flash the ROM on my Lenovo Thinkpad T400 with Libreboot, using these instructions on eLinux.

I disabled HDMI on the Beaglebone by opening vi and removing the comment from the line that says it disables HDMI.

I couldn't locate the uEnv.txt file at first, because there isn't a /lib/ directory. It was found in /boot/

But when I did this, ie reboot and look, it seems that the HDMI is still there:

root@beaglebone:/var/lib/cloud9# cat /sys/devices/bone_capemgr.*/slots

0: 54:PF---
1: 55:PF---
2: 56:PF---
3: 57:PF---
4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
5: ff:P-O-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN
root@beaglebone:/var/lib/cloud9#

====

I have now tried the advice of Vinay:


Another solution is also simple, just include the line "CAPE=ADAFRUIT-SP0" in /etc/default/capemgr file. Then reboot and all should work fine.

========


This did not work. I still get the same slots listing.

I then followed this advice also from vinay:
============

Re: [beagleboard] Re: Issues with Enabling SPIDev on Beaglebone Black
Step 1 : Go to root@beaglebone: /boot#
Step 2 : Open uEnv.txt file
Step 3 : Inside the file

You will find these lines, so do the following: In case If you dont find these lines for your kernel, then just append the line "cape_enable=bone_capemgr.enable_partno=BB-SPIDEV0" to the end of the file.

##Example v4.1.x
#cape_disable=bone_capemgr.disable_partno=
cape_enable=bone_capemgr.enable_partno=BB-SPIDEV0

Step 4 : Reboot your BBB
Step 5 : Go to /sys/devices/platform/bone_capemgr# cat slots or dmesg to check.

Then check if your SPI device has been loaded.

This works with Linux beaglebone kernel 4.1.18-ti-r53

===============

This didn't work. there is no /sys/devices/platform/bone_capemgr.

Rudy Misek

unread,
Jul 19, 2016, 7:25:54 AM7/19/16
to Vinay Divakar, wi...@willnapier.com, BeagleBoard, Jason Koh
Whats crack'n Vinay!! Looks to me like Wheezy. 

Hey Will,
5: ff:P-O-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN
The L in P-O-L means loaded, so in the case above it's telling you that the HDMI hasn't been loaded. So you've successfully disabled it.

When you do this
"Another solution is also simple, just include the line "CAPE=ADAFRUIT-SP0" in /etc/default/capemgr file. Then reboot and all should work fine"
You'll have to do both, disable the HDMI like you've done (if you want to use SPI1) and load the SPI dtbo like in the step above. 
You should then see it loaded when you cat the slots. Below is what mine looks like (I have a few different things loaded, but you can see that the HDMI has been disabled and both SPI's loaded)

root@beaglebone:/sys/devices# cd /sys/devices/bone_capemgr.*
root@beaglebone:/sys/devices/bone_capemgr.9# cat slots
 0: 54:PF---
 1: 55:PF---
 2: 56:PF---
 3: 57:PF---
 4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
 5: ff:P-O-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
 6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN
 7: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-SPI0-01
 8: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-SPI1-01
 9: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART1
10: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART4
11: ff:P-O-L Override Board Name,00A0,Override Manuf,AEI-UART5
12: ff:P-O-L Override Board Name,00A0,Override Manuf,bspm_P8_32_f
13: ff:P-O-L Override Board Name,00A0,Override Manuf,am33xx_pwm
14: ff:P-O-L Override Board Name,00A0,Override Manuf,bone_pwm_P9_16
root@beaglebone:/sys/devices/bone_capemgr.9# 


check for 'spidev1.x' in /dev 
e.g
root@beaglebone:~# cd /dev
root@beaglebone:/dev# ls

If spidev is in there, you successfully loaded the SPI

This is the version of linux I'm running on my BBB
root@beaglebone:~# uname -a
Linux beaglebone 3.8.13-bone79 #1 SMP Tue Oct 13 20:44:55 UTC 2015 armv7l GNU/Linux




Rudy Misek

unread,
Jul 19, 2016, 7:26:48 AM7/19/16
to Vinay Divakar, wi...@willnapier.com, BeagleBoard, Jason Koh
I've attached the SPI device tree files I used.

Hope this help ya out!!
BB-SPI1-01-00A0.dts
BB-SPI0-01-00A0.dts
BB-SPI1-01-00A0.dtbo
BB-SPI0-01-00A0.dtbo

Will Napier

unread,
Jul 19, 2016, 9:25:29 AM7/19/16
to beagl...@googlegroups.com
Thank you Vinay and Rudy for your replies. I am using the Kernel
Version 3.8.13-bone79.
 
I realised about the L thing after my last post - thank you Rudy, that
is encouraging that I have successfully disabled HDMI. I have added
the suggested line in /etc/default/capemgr
(CAPE=ADAFRUIT-SP0). Following earlier advice the only other line I
have in this file is:
 
CAPE=BB-SP1-01.
 
Is this correct for my purpose (ie simply and only to use the BBB to
flash the Lenovo ROM)?
 
After adding the line you suggested, I rebooted and this is what I now get
in /sys/devices/bone_capemgr.9/slots:
 
 0: 54:PF---
 1: 55:PF---
 2: 56:PF---
 3: 57:PF---
 4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
 5: ff:P-O-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
 6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN
 7: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-SPI1-01
 
I am using the guide at
spidev on the BBB" it advises:
 
Log on as root on the BBB, using either SSH or a serial console as
defined in #bbb_access. Make sure that you have internet access on
your BBB.
 
 
Follow the instructions at
excluding) the point where it tells you to modify uEnv.txt
 
 
I did this, entering the .dtbo in the recommended location (for
SP01). Here is my uEnv.txt:
 
====================
 
 
uname_r=3.8.13-bone79
##uuid=
#dtb=
 
##BeagleBone Black/Green dtb's for v4.1.x (BeagleBone White just works..)
 
##BeagleBone Black: HDMI (Audio/Video) disabled:
#dtb=am335x-boneblack-emmc-overlay.dtb
 
##BeagleBone Black: eMMC disabled:
#dtb=am335x-boneblack-hdmi-overlay.dtb
 
##BeagleBone Black: HDMI Audio/eMMC disabled:
#dtb=am335x-boneblack-nhdmi-overlay.dtb
 
##BeagleBone Black: HDMI (Audio/Video)/eMMC disabled:
#dtb=am335x-boneblack-overlay.dtb
 
##BeagleBone Black: wl1835
#dtb=am335x-boneblack-wl1835mod.dtb
 
##BeagleBone Black: replicape
am335x-boneblack-replicape.dtb
 
##BeagleBone Green: eMMC disabled
#dtb=am335x-bonegreen-overlay.dtb
 
cmdline=coherent_pool=1M quiet init=/lib/systemd/systemd cape_universal=enable
 
#In the event of edid real failures, uncomment this next line:
#cmdline=coherent_pool=1M quiet init=/lib/systemd/systemd cape_universal=enable video=HDMI-A-1:1024x768@60e
 
##Example v3.8.x
#cape_disable=capemgr.disable_partno=
#cape_enable=capemgr.enable_partno=
 
##Example v4.1.x
#cape_disable=bone_capemgr.disable_partno=
#cape_enable=bone_capemgr.enable_partno=
 
##Disable HDMI/eMMC (v3.8.x)
#cape_disable=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN,BB-BONE-EMMC-2G
 
##Disable HDMI (v3.8.x)
cape_disable=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
 
##Disable eMMC (v3.8.x)
#cape_disable=capemgr.disable_partno=BB-BONE-EMMC-2G
 
##Audio Cape (needs HDMI Audio disabled) (v3.8.x)
#cape_disable=capemgr.disable_partno=BB-BONELT-HDMI
#cape_enable=capemgr.enable_partno=BB-BONE-AUDI-02
 
 
##enable Generic eMMC Flasher:
##make sure, these tools are installed: dosfstools rsync
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh
 
uuid=c3048a42-5170-419f-ae71-6f96bf7f6f11
 
cape_enable=bone_capemgr.enable_partno=BB-SPIDEV0
 
optargs=quiet drm.debug=7 capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
capemgr.enable_partno=BB-SPI1-01
 
=======
 
 
So my current questions are:
 
I am not clear from the guide what SPI things to install. SP0 &
SP1-01? or just one of them?
 
Also should the optargs entry and the capemgr.enable_partno=BB-SP1-01
be present in that file, or removed?
 
Thank you Rudy for your files. I am not sure what to do with them. Given what I have detailed above, do I need to do anything with them?
 
And a side-question about the slots listing at the top of this post,
number 4.. why does it say 2Gb not 4Gb? I'm pretty sure I have the
4Gb. Is it that there are 2x2?
 
With thanks to you all for invaluable help.
 
Will
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.

Rudy Misek

unread,
Jul 20, 2016, 9:13:20 AM7/20/16
to BeagleBoard
Hey Will!!

My responses are in green

I am not clear from the guide what SPI things to install. SP0 &
SP1-01? or just one of them?
From your comments it looks like you just need to talk out of 1 spi so my answers are for SPI0.
 
Also should the optargs entry and the capemgr.enable_partno=BB-SP1-01
be present in that file, or removed? 
Replace it with BB-SPI0-01
 
Thank you Rudy for your files. I am not sure what to do with them. Given what I have detailed above, do I need to do anything with them?
Put BB-SPI0-01-00A0.dtbo in /lib/firmware on your BBB

  .dts files are the pre compiled device tree files (human readable form) 
  You create a .dtbo file by compiling a .dts file
  .dbto are files that the BBB will use (machine readable form)
 
And a side-question about the slots listing at the top of this post,
number 4.. why does it say 2Gb not 4Gb? I'm pretty sure I have the
4Gb. Is it that there are 2x2?
Not sure, as far as I can tell it doesn't affect my 4G BBB in any way

Reboot your BBB and cat the slots again you should see BB-SPI0-01 loaded
root@beaglebone:/# cd /dev
root@beaglebone:/dev# ls
Check that spidev1.0 is in there

IMPORTANT!!! Make sure that the Lenovo SPI is 3.3v and not 5v. If it's 5v you'll probably blow those pins on your BBB.

Do you have a program that can send the data out of the SPI?


Vinay Divakar

unread,
Jul 20, 2016, 9:13:34 AM7/20/16
to BeagleBoard
Hi, Rudy,

Nothing much, Just hooked to my CC3200 LP. 

Will, looking at the slots, I can say that you have loaded the spi dev 1 successfully. For your kernel version, adding  CAPE=BB-SPI0-01 in the file  in "/etc/default/capemgr" is sufficient . To cross check the active spi devices use " ls -al /dev/spidev*", it will show you which spi devices are currently active and can be used. There nothing more to install or load, you have one spi device now active and can use it for your application. However, if I were you, I would first  do a loop back test on the spi module to check if its functioning using the code in Roberts blog SPI Test Utility Code. And about your last side question, I think that is the size of image that is currently running on your BBB 

William Napier

unread,
Jul 22, 2016, 6:00:33 AM7/22/16
to beagl...@googlegroups.com
Thank you Rudy and Vinay for your replies.

I have been reading the blog you recommended. He says:

=====

Now go into the file name uEnv.txt.  The appears in the external device BEAGLEBONE if you have the board plugged into a computer.  If using an external monitor go to Computer click the BEAGLEBONE device and open uEnv.txt with gedit.

Delete any lines that may appear in uEnv.txt and add the following and save.  This change will tell the board to apply the SPI0 Device Tree Overlay we created on startup.

 optargs=quiet drm.debug=7 capemgr.enable_partno=BB-SPI0-01  

Reboot the BeagleBone Black.



Do I need to delete (or comment out) ALL entries? I think I have the DTO enabled now. But I am anxious not to leave anything in any file that may cause a problem when I get to attempting the flash.

Rudy I read your last post as saying to take out the line starting ‘optargs=‘. Was that correct? Or will I need that line as described above?

Here is my current version of uEnv.txt (without lines that are commented-out):

====

uname_r=3.8.13-bone79

cmdline=coherent_pool=1M quiet init=/lib/systemd/systemd cape_universal=enable

cape_disable=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN

uuid=c3048a42-5170-419f-ae71-6f96bf7f6f11

cape_enable=bone_capemgr.enable_partno=BB-SPIDEV0

capemgr.enable_partno=BB-SPI0-01



Should I delete/comment-out, or change, any of the above? And should I include the optargs line mentioned by Robert’s blog?

the spidev1.0 file is listed in /dev as it is.

I am having problems with the loop-back test. I tried to compile on the BBB but it gave errors such as these:


root@beaglebone:~# gcc -Wall spi_test.c -o spi_test.o
spi_test.c: In function 'transfer':
spi_test.c:54:18: error: 'SPI_TX_QUAD' undeclared (first use in this function)
spi_test.c:54:18: note: each undeclared identifier is reported only once for each function it appears in
spi_test.c:55:14: error: 'struct spi_ioc_transfer' has no member named 'tx_nbits'
spi_test.c:56:23: error: 'SPI_TX_DUAL' undeclared (first use in this function) 
ETC, ETC.

So I tried to compile on the host machine (my Lenovo Thinkpad, as yet unliberated, running Xubuntu), and it worked fine, producing the object file. So I then tried scp-ing the .o file to the BBB and trying to run it there. But I got the error ‘Cannot execute binary file’. Is this because I don’t have gcc installed on the BBB (man gcc showed it isn’t there)?

I think I have the wires connected to the correct pins. I rebooted the BBB and tried again just to be sure and I’m getting the same error.

As for your question Rudy “Do you have a program that can send data out of the SPI?”… at this stage I don’t even know what that question means - I realise I will need to. I have downloaded and scp-ed across to the BBB the program called libreboot_util. In it’s directory I see files/directories named ‘flash’, ‘flashrom’, ‘ich9deblob’. I think these are what I need.

I am also not clear about how this will work practically: I presume I will need a usb connection to the BBB in order to issue the commands. This will need to be a connection from another computer (unless I plug in a keyboard and monitor but then we’ve just disabled the hdmi so perhaps that isn’t an option?). I suppose I could ssh to the BBB from my macbook - or get another old lenovo and install linux and do it from there. 

Rudy I’m pretty sure the Lenovo ROM is 3.3v because that is what I understand from the Libreboot guide.

Thank you both again for all your time and help.

Will

terteil...@gmail.com

unread,
Feb 13, 2018, 2:21:56 PM2/13/18
to BeagleBoard
Hello everyone
I am working on Kernel version 4.4 and I have tried all the mentioned solutions in this discussion but still I can't add SPI0 or SPI1, If anyone have used this type of kernel please help.
Reply all
Reply to author
Forward
0 new messages