Project

General

Profile

Using spidev

Configuring SPI4 on the devkit

Pin function ARM pin Devkit connector
SPI4_SCLK pinmuxed to N7 J5-12 on devkit
SPI4_D1 pinmuxed to R4 J5-13 on devkit
SPI4_D0 pinmuxed to N9 J5-10 on devkit
SPI4_CS0 pinmuxed to P9 J5-8 on devkit

picture50-1.png

Setup pinmux in u-boot: https://support.criticallink.com/gitweb/?p=processor-sdk-u-boot.git;a=commitdiff;h=658f00171b0033c393b103e9ca39584d826bc213;hp=8888d032bca7c9e6a2331b274ca27848e1347735
Setup mcspi4 in linux: https://support.criticallink.com/gitweb/?p=processor-sdk-linux.git;a=commitdiff;h=7b3880db4969f146482d48db21caa637b551d232
Removed spidev warning...: https://support.criticallink.com/gitweb/?p=processor-sdk-linux.git;a=commitdiff;h=d207d2432202215fab4295d7fbd8e276ab0375a9

Build linux spidev_test:

 $ make O="build-mitysom57x" -C tools/spi/
 $ scp build-mitysom57x/spidev_test eth:

Connect logic analyzer:

20210427_102437.jpg

Run spidev_test

root@mitysom-am57x:~# ./spidev_test -D /dev/spidev1.0 -v 
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 KHz)
TX | 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 F0 0D | ......@......................ð.
RX | 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 | ................................

Spi signals seen on spi4_sclk and spi4_d0

spidev_logic_capture.png

Note: spidev_test is just to send some signal over the spi bus to make sure the pinmux and kernel config is in place

libdaq

For an example userpace library, see libdaq dac8554.cpp

Go to top
Add picture from clipboard (Maximum size: 600 MB)