200jaky
Posts: 1
Joined: Thu Apr 05, 2018 1:22 pm

SPI loopback not working PI 3

Thu Apr 05, 2018 1:33 pm

The first time I installed the SPI onto my PI 3 everything worked smoothly. Then several days later it stopped working. Hardware built was identical to the first one. After a lot of troubleshooting i reseted my SD and redid the entire installation and started testing via the loopback feature.
Loopback from pin 21 to pin 19
Here is the result:

Code: Select all

[email protected]:~ $ ./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
The SPI is enabled

Code: Select all

[email protected]:~ $ ls /dev | grep "spi"
spidev0.0
spidev0.1
BCM is running

Code: Select all

[email protected]:~ $ lsmod | grep "bcm"
btbcm                   7916  1 hci_uart
bluetooth             365780  29 hci_uart,bnep,btbcm,rfcomm
snd_bcm2835            24427  1
snd_pcm                98501  1 snd_bcm2835
snd                    70032  5 snd_timer,snd_bcm2835,snd_pcm
bcm2835_gpiomem         3940  0
spi_bcm2835  
And the SPI is enabled in the raspi-config

I do not know why it is not working.

rostallone
Posts: 1
Joined: Wed Jun 20, 2018 12:53 pm

Re: SPI loopback not working PI 3

Wed Jun 20, 2018 2:06 pm

I am stuck in same issue
i am using PI 3B and trying to test loopback test.

Is it some issue in driver in kernal Linux raspberrypi 4.14.34-v7+

User avatar
joan
Posts: 13407
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: SPI loopback not working PI 3

Wed Jun 20, 2018 4:55 pm

If you are using a loopback try pigpio. It uses a different driver. Perhaps not a great deal of use but it should show if hardware is the problem.

$ sudo pigpiod

$ pigs spio 0 50000 0
0
$ pigs spix 0 1 2 3 4
4 0 0 0 0
$

If loopback works you should receive 4 1 2 3 4.

Return to “Interfacing (DSI, CSI, I2C, etc.)”

Who is online

Users browsing this forum: Dancaster, nospam2000 and 11 guests