SPRAD26 April 2022 AM67 , AM67A , AM68 , AM68A , AM69 , AM69A , DRA821U , DRA821U-Q1 , DRA829J , DRA829J-Q1 , DRA829V , DRA829V-Q1 , TDA4AEN-Q1 , TDA4AH-Q1 , TDA4AL-Q1 , TDA4AP-Q1 , TDA4APE-Q1 , TDA4VE-Q1 , TDA4VEN-Q1 , TDA4VH-Q1 , TDA4VL-Q1 , TDA4VM , TDA4VM-Q1 , TDA4VP-Q1 , TDA4VPE-Q1
The Linux kernel provides spidev_test tool. We need just build & use that. Follow the instructions here:
cd ti-processor-sdk-linux-automotive-j7-evm-*/board-support/linux-*/tools/spi
make ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu-
cp spidev_test /media/$user/rootfs/home/root
The above should build spidev_test binary in the tools/spi folder and copy that to rootfs of your target filesystem.
Basic test on TDA4VM Linux command prompt:
cd /home/root
./spidev_test -v -D /dev/spidev6.0 -p "HELLOWORLD"
Output:
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 KHz)
TX | 48 45 4C 4C 4F 57 4F 52 4C 44 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ |HELLOWORLD|
RX | FF FF FF FF FF FF FF FF FF FF __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ |..........|
Since there is no Slave the RX we always see 0xFF.