Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPI0.write crashes Beagleblone #106

Open
jonturner53 opened this issue Aug 8, 2016 · 1 comment
Open

SPI0.write crashes Beagleblone #106

jonturner53 opened this issue Aug 8, 2016 · 1 comment

Comments

@jonturner53
Copy link

Running the following code causes the BeagleBone to crash when it gets
to the SPI0.write() call. To recover, I have to reset the board.
Am I doing something wrong here?

I am new to both the BeagleBone and PyBBIO, so I may be making a newbie error.
However, I have run a few tests involving the GPIOs and they all seem to work ok.
The blinking led example works fine, so I think the installation is ok.
I currently have no circuits connected to the board, so the tests using the GPIOs
are just wiggling pins (I have checked a few using a multi-meter, to make sure they're
responding).

Jon Turner


import sys
from bbio import *

def setup():
    SPI0.open()
    SPI0.setClockMode(0,0)  
    SPI0.setMaxFrequency(0,1000000) 
    SPI0.setBitsPerWord(0,10) 
    SPI0.setMSBFirst(0)

def loop() :
    print "about to write"
    SPI0.write(0,[0x15])
    print "done"
    sys.exit(0)

run(setup, loop)
@alexanderhiam
Copy link
Member

See this issue on the serbus library (which PyBBIO uses): graycatlabs/serbus#1

It looks to be an bug in the omap2-mcspi kernel driver, so unfortunately nothing can really be done about it at the PyBBIO level. You could try using 12 or 16 bit words - in my experience SPI slave devices that use weird word sizes often just work with larger words.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants