This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: TDA4VM Main_MCSPI3 master mode full duplex issue

Part Number: TDA4VM

Tool/software:

Hi,

I have referred document https://www.ti.com/lit/an/sprad26/sprad26.pdf?ts=1733206794643&ref_url=https%253A%252F%252Fwww.google.com%252F to enable main_spi3 master interface on TDA4VM board.

Interface is up in spidev and only transmit data on SPI lines but unable to read or receive data on SDI line.

configuration for spi enable are as below:

file k3-j721e-common-proc-board.dts:

main_spi3_pins_default: main_spi3-pins-default {
            pinctrl-single,pins = <
                   J721E_IOPAD(0x144, PIN_INPUT, 4) /* (Y25) PRG0_PRU1_GPO17.SPI3_CLK */
                   J721E_IOPAD(0x11c, PIN_INPUT, 4) /* (AA24) PRG0_PRU1_GPO7.SPI3_CS0 */
                   J721E_IOPAD(0x124, PIN_INPUT, 4) /* (Y24) PRG0_PRU1_GPO9.SPI3_CS3 */
                   J721E_IOPAD(0x148, PIN_INPUT, 4) /* (AA26) PRG0_PRU1_GPO18.SPI3_D0 */
                   J721E_IOPAD(0x14c, PIN_INPUT, 4) /* (AA29) PRG0_PRU1_GPO19.SPI3_D1 */
            >;

};

&main_spi3 {
      pinctrl-names = "default";
      pinctrl-0 = <&main_spi3_pins_default>;
      ti,spi-num-cs = <4>;
      status="okay";

      spidev@0 {
              spi-max-frequency = <24000000>;
              reg = <0>;
              compatible = "linux,spidev";
      };
      spidev@3 {
               spi-max-frequency = <24000000>;
               reg = <3>;
               compatible = "linux,spidev";
      };
};

file: k3-j721e-main.dts

main_spi3: spi@2130000 {
               compatible = "ti,am654-mcspi","ti,omap4-mcspi";
               reg = <0x00 0x02130000 0x00 0x400>;
               interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>;
               #address-cells = <1>;
               #size-cells = <0>;
               power-domains = <&k3_pds 269 TI_SCI_PD_EXCLUSIVE>;
               clocks = <&k3_clks 269 1>;
               status = "okay";
};

file defconfig:

CONFIG_SPI_SPIDEV=y

After bootup detected spi interfaces::

root@j721e-evm:~# ls -l /sys/class/spi*
/sys/class/spi_master:
total 0
lrwxrwxrwx 1 root root 0 Apr 28 2022 spi3 -> ../../devices/platform/bus@100000/2130000.spi/spi_master/spi3

/sys/class/spidev:
total 0
lrwxrwxrwx 1 root root 0 Apr 28 2022 spidev3.0 -> ../../devices/platform/bus@100000/2130000.spi/spi_master/spi3/spi3.0/spidev/spidev3.0
lrwxrwxrwx 1 root root 0 Apr 28 2022 spidev3.3 -> ../../devices/platform/bus@100000/2130000.spi/spi_master/spi3/spi3.3/spidev/spidev3.3

spi-test tool logs::

root@j721e-evm:~# ./spidev_test -v -D /dev/spidev3.0 -p "HELLOWORLD"
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 | 00 00 00 00 00 00 00 00 00 00 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ | ..........

i wanted to know whether anything is missing in configuration or not. I am unable to get data on RX, according to spi guide provided by TI data on RX line should be FF but i am receiving it 00