-
Notifications
You must be signed in to change notification settings - Fork 1k
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
RPi not working with spidev #138
Comments
I know it may sound kind of odd, but have you tried rebooting the RPi? If I remember correctly, I had a number of problems when attempting to get SPIDEV working fully because the bcm driver + examples tends to leave the SPI pins active/enabled. The most simple way to ensure they are cleared is just to reboot and test SPIDEV immediately. Since SPIDEV now uses kernal driven chip-select toggling, this likely won't work until compile for SPIDEV then reboot. |
Thanks for chiming in. Yes, I've done numerous reboots at various stages, and definitely after everything was compiled. |
Can you give this a try: https://www.raspberrypi.org/documentation/hardware/raspberrypi/spi/README.md#troubleshooting with the wire between MOSI and MISO to see if SPIDEV is working correctly for you? |
I actually did that last night after my post. Seems to confirm that SPI is working fine. |
Ok, so we know SPI works, and that would maybe point at the CE/CS pins, or a general problem with the RF24 spi code... Here is a shot in the dark, and a bit of a 'hack', but if you open the RF24/arch/BBB/spi.c in a text editor and look at the I don't understand the differences/details myself, but at one point I upgraded (via apt-get) and had to switch between the two methods. If you are comfortable with making these changes and recompiling, its at least something to try ( uncomment the 'other' sections and comment out the corresponding section of the 'current' code ) Unfortunately one of my RPis just decided to do the solid red pwr light after a power outage, so it looks like I am one down, and am just upgrading my main one to jessie from wheezy, so I can test further with the latest updates eventually... |
Per #138 n8henrie - SPIDEV not working with newest firmware.
Per the above commit, once I upgraded to 4.1.7+ from |
Awesome, I cherry-picked the commit and can confirm it works. I wonder why it needs to be initialized first now. I need to learn more about SPI! |
I have RF24 and RF24Network working great with BCM2835 but decided to give spidev a shot. Unfortunately, I'm not having any luck.
I think I have spi loaded properly:
I cleaned the RF24 repo, then followed the instructions to change
arch/BBB/spi.cpp
to point to/dev/spidev0.0
instead of1.0
(actually just commented and uncommented the already included RPI lines below). Then I didsudo make install -B RF24_SPIDEV=1
. It seems to work properly. Thensudo ldconfig
. It looks like the spidev uses the same pins definitions as BCM2835, so I should be able to just leave it as it was working:RF24 radio(22,0);
.Next I clean and compile my
text.cpp
file, which I've eliminated everything possible to just make it print the connection details, and it's clearly not working.Output:
Next, just to verify, I cleaned everything, re-cloned the repos, and reinstalled with the default (BCM2835) driver. My sketches send and receive data, everything works great. So I re-cleaned again and reinstalled with spidev as described again, and get the exact same result.
Am I doing something wrong? Can anybody else verify that spidev is still working with the latest RPi firmware?
The text was updated successfully, but these errors were encountered: