This is an old revision of the document!



This tutorial was tested on STKa6x BSP with Rev.0104 and BSP Rev.0105

SPI can be tested with spidev_test from the kernel sources.
https://www.kernel.org/doc/Documentation/spi/spidev_test.c
You will find spidev_test under /usr/bin/ in the BSP.

spidev_test is a loopback test to use it on the starterkit please put a bridge between X27_43 (SPI.MOSI) and X27_44 (SPI.MISO).

To run spidev with /dev/spi0.1 you need to specify the device with -D parameter

root@MBa6x:/usr/bin ./spidev_test -D /dev/spidev0.1

console output with open bridge:

root@MBa6x:/usr/bin ./spidev_test -D /dev/spidev0.1
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 KHz)

FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF 

console output with closed bridge:

root@MBa6x:/usr/bin ./spidev_test -D /dev/spidev0.1
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
  • Last modified: 2022/08/04 15:04