Comments (21)
Do we need it? If you look in the well commented /boot/config.txt
you see the following:
# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on
Just uncomment and reboot. There's no need for rpi-config - but I added the basic compatibility, so you can use it if you want!
from raspberrypi-ua-netinst.
ah sorry missed that, thanks!
from raspberrypi-ua-netinst.
If you find missing parameters in config.txt
- like the camera was - I'd definitely add it, too!
from raspberrypi-ua-netinst.
I enabled the following in config.txt:
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=spi=on
But when I reboot dmesg | grep spi
is supposed to show up but the command doesn't return anything. Does this work for you @FooDeas?
I2C is enabled though:
$ dmesg | grep i2c
[ 3.776209] bcm2708_i2c 3f804000.i2c: BSC1 Controller at 0x3f804000 (irq 83) (baudrate 100000)
Maybe this is related? raspberrypi/linux#1547
from raspberrypi-ua-netinst.
It definitely is. Do an apt-get update/upgrade to see, if that changes something. The package "raspberrypi-kernel" is required (latest version is from 2016-09-21).
If this doesn't work, try rpi-update to update these files from latest build repository because this issue is pretty new and the deb package is from 2 weeks ago.
from raspberrypi-ua-netinst.
$ sudo apt-get install rpi-update
$ sudo rpi-update
...
*** If no errors appeared, your firmware was successfully updated to 667cfabe63bc663383559ef88317e86f9bd41e45
*** A reboot is needed to activate the new firmware
After reboot still nothing..
from raspberrypi-ua-netinst.
Post lsmod
.
from raspberrypi-ua-netinst.
$ lsmod
Module Size Used by
bnep 10340 2
hci_uart 17943 1
btbcm 5929 1 hci_uart
bluetooth 326105 22 bnep,btbcm,hci_uart
cpufreq_stats 3463 0
brcmfmac 186339 0
brcmutil 5661 1 brcmfmac
cfg80211 427855 1 brcmfmac
joydev 9024 0
snd_soc_bcm2835_i2s 6354 0
rfkill 16037 3 cfg80211,bluetooth
snd_soc_core 125885 1 snd_soc_bcm2835_i2s
snd_bcm2835 20447 0
snd_pcm_dmaengine 3391 1 snd_soc_core
snd_pcm 75762 3 snd_bcm2835,snd_soc_core,snd_pcm_dmaengine
snd_timer 19288 1 snd_pcm
snd 51908 4 snd_bcm2835,snd_soc_core,snd_timer,snd_pcm
i2c_bcm2708 4834 0
bcm2835_gpiomem 3040 0
spi_bcm2835 6678 0
bcm2835_wdt 3225 0
evdev 11396 0
uio_pdrv_genirq 3164 0
uio 8000 1 uio_pdrv_genirq
ipv6 347530 34
$ ls -1 /dev/spi*
/dev/spidev0.0
/dev/spidev0.1
from raspberrypi-ua-netinst.
The driver (spi_bcm2835) is loaded and the device is up. Looks like it's already working without a dmesg debug/info output.
from raspberrypi-ua-netinst.
I just tried it without rpi-update. It works as well.
Summary: Enabling in config.txt still suffices.
from raspberrypi-ua-netinst.
Hmm, alright. Does the loopback test listed here work for you?
Only output I see is:
$ ./spidev_test -D /dev/spidev0.0
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 KHz)
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00
Fuck what a time waster :(
dmesg | grep spi
should show something like:
dmesg | grep spi
[ 12.450507] bcm2708_spi bcm2708_spi.0: registered master spi0
[ 12.450574] spi spi0.0: setup: cd 0: 4000000 Hz, bpw 8, mode 0x0 -> CS=00000000 CDIV=0040
[ 12.450613] spi spi0.0: setup mode 0, 8 bits/w, 4000000 Hz max –> 0
[ 12.450747] bcm2708_spi bcm2708_spi.0: registered child spi0.0
[ 12.450796] spi spi0.1: setup: cd 1: 500000 Hz, bpw 8, mode 0x0 -> CS=00000001 CDIV=0200
[ 12.450822] spi spi0.1: setup mode 0, 8 bits/w, 500000 Hz max –> 0
[ 12.450945] bcm2708_spi bcm2708_spi.0: registered child spi0.1
[ 12.450972] bcm2708_spi bcm2708_spi.0: SPI Controller at 0x20204000 (irq 80)
For what it's worth, I'm trying to talk to a MAX7219 device using https://github.com/rm-hull/max7219.
Using the spidev python library also doesn't show any errors:
$ python3.5
Python 3.5.2 (default, Oct 3 2016, 23:20:34)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import spidev
>>> spi = spidev.SpiDev()
>>> bus = device = 0
>>> spi.open(bus, device)
>>> to_send = [0x01, 0x02, 0x03]
>>> spi.xfer(to_send)
[0, 0, 0]
>>>
Here's another thread that mentions it broke recently (after switch from spi-bcm2708 to spi-bcm2835).
from raspberrypi-ua-netinst.
I've also tested this on a Raspberrypi model B + v1.2 with Raspbian wheezy:
$ uname -a
Linux raspberrypi 4.1.19+ #858 Tue Mar 15 15:52:03 GMT 2016 armv6l GNU/Linux
and the loopback works fine there after adding dtparam=spi=on
:
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 KHz)
FF FF FF FF FF FF
40 00 00 00 00 95
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
DE AD BE EF BA AD
F0 0D
And the max7219 example now also works fine. Sigh. I suppose I'll also test it on a RPi2 with the latest and greatest to see if it's not a hardware issue with the Pi3 I was using before. I also haven't done a clean raspberrypi-ua-netinst installation yet with spi so maybe it'll work after a fresh start there.
from raspberrypi-ua-netinst.
On RPi 3:
root@pi:~# uname -a
Linux pi 4.4.21-v7+ #911 SMP Thu Sep 15 14:22:38 BST 2016 armv7l GNU/Linux
root@pi:~# dmesg | grep spi
(no output)
root@pi:~# ./spidev_test -D /dev/spidev0.0
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 KHz)
FF FF FF FF FF FF
40 00 00 00 00 95
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
DE AD BE EF BA AD
F0 0D
Works as intended...
Make sure, you use GPIO 9 & GPIO 10
from raspberrypi-ua-netinst.
On that Raspberry B+:
$dmesg | grep spi
[ 5.817699] spi spi0.0: setting up native-CS0 as GPIO 8
[ 5.818605] spi spi0.1: setting up native-CS1 as GPIO 7
I used the same GPIOs you mentioned, on both Rpi3 and Rpi1B+, but only Rpi1B+ succeeded the loopback test.
from raspberrypi-ua-netinst.
RPi 3 and RPi B+ have the same Pin layout regarding SPI MISO/MOSI. Because the device exists on your RPi, it has to work.
I did nothing special: Fresh installed, uncommented the SPI in config.txt, rebooted, installed gcc and typed in the three lines for the loopback test. Nothing else!
from raspberrypi-ua-netinst.
Many people abused their Pis with 5V from Arduino hardware/shields. I hope, you accidentally didn't...
Always keep in mind:
GPIO voltage levels are 3.3 V and are not 5 V tolerant. There is no over-voltage protection on the board...
from raspberrypi-ua-netinst.
Yea f...!! hehe we'll see. But I did the same on the Rpi1B+ @FooDeas and it worked there ;)
from raspberrypi-ua-netinst.
I already noticed it above. But it doesn't seem to be a software issue if you didn't change more than you already wrote.
from raspberrypi-ua-netinst.
With a fresh system installation the RaspberryPi 3 SPI still doesn't work, but its not fried, the GPIO channels still work. I'll leave this rest for a week and take a look again later, perhaps try on a RPi2 in the meantime.
from raspberrypi-ua-netinst.
For debugging:
Try disabling the camera and/or I²C. From firmware documentation:
It is recommended to only enable those interfaces that are needed. Leaving all interfaces enabled can lead to unwanted behaviour (i2c_vc interfering with Pi Camera, I2S and SPI hogging GPIO pins, etc.)
I don't think this applies here, but you could have a try.
from raspberrypi-ua-netinst.
It eventually started working on that particular machine, it probably was a broken package or kernel. Thanks for the suggestions though.
from raspberrypi-ua-netinst.
Related Issues (20)
- no space left on 1GB SD card HOT 2
- Fastest possible boot time? HOT 9
- Is this distribution working on RPI 1b? HOT 2
- Doesn't boot reliably on RPi 4B HOT 4
- Adapt the install script for Raspi4 USB mass storage boot, and regenerate the image HOT 1
- Kernel 5.10 issues HOT 1
- Installation works, reinstallation doesn't
- buildroot.sh ends in :(stdin) HOT 1
- Booting release 2.4.0+ (caf7423) on RPi 3B+ using WiFi fails HOT 2
- Build ceases and reboot before post-install.txt executes HOT 1
- cp: cannot stat 'tmp/lib/modules/5.10.17- HOT 6
- Reproducible Installs HOT 3
- Replace existing system HOT 3
- apt list --installed reports testing HOT 3
- How to enable Bluetooth HOT 4
- Selecting a specific version of kernel HOT 1
- Raspbian bullseye - Installation fails "Iek!" HOT 6
- Please add support for bullseye HOT 5
- Raspberry pi Zero 2 W support HOT 3
- Bookworm support HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raspberrypi-ua-netinst.