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-Q1: mcspi1's Mosi/MISO has no data waveform

Part Number: TDA4VM-Q1
Other Parts Discussed in Thread: TDA4VM, SYSCONFIG

HI experts.

use  MCSPI1 (SPI1_CLK/SPI1_CS/SPI1_D0/SPI_D1) on tda4vm.

sdk:linux 08_04_00_11 ,rtos 08_04_00_06

I configured the device tree as follows.  Also added in the kernel config file.  

CONFIG_SPI_SPIDEV=y

CONFIG_SPI_OMAP24XX=y

 So I have the SPIDEV node under dev, Once I boot Linux one should entries like below:

root@j7-evm:~# ls  -l /sys/class/spi*
/sys/class/spi_master:
total 0
lrwxrwxrwx 1 root root 0 Apr  3 08:41 spi0 -> ../../devices/platform/bus@100000/2110000.spi/spi_master/spi0

/sys/class/spidev:
total 0
lrwxrwxrwx 1 root root 0 Apr  3 08:41 spidev0.0 -> ../../devices/platform/bus@100000/2110000.spi/spi_master/spi0/spi0.0/spidev/spidev0.0

When I used spidev_test to send data, there is no data on mosi.

root@j7-evm:~# ./spidev_test -D /dev/spidev0.0 -v -H  -p 0x12345678 
TX | 30 78 31 32 33 34 35 36 37 38 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __  |0x12345678|
RX | 00 00 00 00 00 00 00 00 00 00 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ _

waveform1 (yellow) :cs

waveform2 (green)  :mosi

waveform3 (purple) :miso

From the waveform I can see that the CS pin is being pulled down, but there is no data (0x12345678) being sent on Mosi. 

What are the possible reasons for this?

  • Hi,

    It seems like you have not done the pinmux configuration:

    Please follow the reference FAQ:

    https://e2e.ti.com/support/processors/f/791/t/947437

    Best Regards,
    Keerthy

  • hi, 

    I have set the pinctrl, 

    pinctrl-names = "default";
    pinctrl-0 = < &spi1_pins_default &tja1105_pins_default>;
    
    spi1_pins_default: spi1-pins-default {
    pinctrl-single,pins = <
            J721E_IOPAD(0x1dc, PIN_INPUT, 0) /* (Y1) SPI1_CLK */
            J721E_IOPAD(0x1d4, PIN_INPUT, 0) /* (Y3) SPI1_CS0 */
            J721E_IOPAD(0x1e0, PIN_INPUT, 0) /* (Y5) SPI1_D0 */
            J721E_IOPAD(0x1e4, PIN_INPUT, 0) /* (Y2) SPI1_D1 */
    		>;
    	};
    

    And dump the memory, it all has been set okay (0x00050000, ).  But there's still no data on Mosi. Any other reasons?

    devmem2 0x0011C1d4 
    devmem2 0x0011C1dc 
    devmem2 0x0011C1e0     
    devmem2 0x0011C1e4 

    root@j7-evm:~# devmem2 0x0011C1d4 
    /dev/mem opened.
    Memory mapped at address 0xffffb478e000.
    Read at address  0x0011C1D4 (0xffffb478e1d4): 0x00050000
    devmem2 0x0011C1d8 
    root@j7-evm:~# devmem2 0x0011C1dc 
    devmem2 0x0011C1e4 /dev/mem opened.
    Memory mapped at address 0xffffbcb7e000.
    Read at address  0x0011C1DC (0xffffbcb7e1dc): 0x00050000
    root@j7-evm:~# devmem2 0x0011C1e0     
    /dev/mem opened.
    Memory mapped at address 0xffff8d970000.
    Read at address  0x0011C1E0 (0xffff8d9701e0): 0x00050000
    root@j7-evm:~# devmem2 0x0011C1e4 
    /dev/mem opened.
    Memory mapped at address 0xffffa618e000.
    Read at address  0x0011C1E4 (0xffffa618e1e4): 0x00050000

  • Hi,

    This is from the sysconfig:

    &main_pmx0 {
    	myspi1_pins_default: myspi1_pins_default {
    		pinctrl-single,pins = <
    			J721E_IOPAD(0x1dc, PIN_INPUT, 0) /* (Y1) SPI1_CLK */
    			J721E_IOPAD(0x1d4, PIN_INPUT, 0) /* (Y3) SPI1_CS0 */
    			J721E_IOPAD(0x1d8, PIN_INPUT, 0) /* (W4) SPI1_CS1 */
    			J721E_IOPAD(0xa8, PIN_INPUT, 1) /* (AD19) PRG1_MDIO0_MDIO.SPI1_CS2 */
    			J721E_IOPAD(0xac, PIN_INPUT, 1) /* (AD18) PRG1_MDIO0_MDC.SPI1_CS3 */
    			J721E_IOPAD(0x1e0, PIN_INPUT, 0) /* (Y5) SPI1_D0 */
    			J721E_IOPAD(0x1e4, PIN_INPUT, 0) /* (Y2) SPI1_D1 */
    		>;
    	};

    Can you try with this pinmux?

    - Keerthy

  • Hi,

    I have set the same pinctrl, the waveform is still the same. There is no data on mosi.

    I'm very confused.   

    &main_pmx0 {
    myspi1_pins_default: myspi1_pins_default {
    pinctrl-single,pins = <
    J721E_IOPAD(0x1dc, PIN_INPUT, 0) /* (Y1) SPI1_CLK */
    J721E_IOPAD(0x1d4, PIN_INPUT, 0) /* (Y3) SPI1_CS0 */
    J721E_IOPAD(0x1d8, PIN_INPUT, 0) /* (W4) SPI1_CS1 */
    J721E_IOPAD(0xa8, PIN_INPUT, 1) /* (AD19) PRG1_MDIO0_MDIO.SPI1_CS2 */
    J721E_IOPAD(0xac, PIN_INPUT, 1) /* (AD18) PRG1_MDIO0_MDC.SPI1_CS3 */
    J721E_IOPAD(0x1e0, PIN_INPUT, 0) /* (Y5) SPI1_D0 */
    J721E_IOPAD(0x1e4, PIN_INPUT, 0) /* (Y2) SPI1_D1 */
    >;
    };

  • Hi,

    Can you double confirm the SoC that you are using? Also can you probe the spi clock? Is that running?

    Best Regards,

    Keerthy 

  • hi,

    I used  XJ721EGALF, and this is the screen print I took.

    root@j7-evm:~# ./spidev_test -D /dev/spidev0.0 -v -H  -p 0x12345678 
    TX | 30 78 31 32 33 34 35 36 37 38 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __  |0x12345678|
    RX | 00 00 00 00 00 00 00 00 00 00 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ _

    yes,  The clk seems  to be running.   CLK runs as CS pulls down.  The Mosi has not changed and is not sure why it has been high level

    This is a scaled-down picture picture.

  • Hi,

    One question. Is this a custom board or a TI EVM? I will look into this on TI EVM. Let me know.

    - Keerthy

  • Yes, I used on my custom board.

    I don't have an EVM board, so I haven't run on it.

  • Hi,

    Can you share the points where you are probing? The pinmux and clock seem correct. The TX data should have come.

    Best Regards,

    Keerthy

  • HI,

     I probe the voltage of resistor R313. The oscilloscope is always at a high level.

    I am also confused why there is no TX data

  • I will check internally and get back.

    - Keerthy

  • Hi,

    Is it possible to test the internal loopback? Connecting the TX and Rx lines?

    Best Regards,

    Keerthy 

  • HI,

    I don't have the Tx/Rx shorted together. So loopback is not set.

  • Hi,

    On the EVM we have tried with different instances & they work fine.

    https://www.ti.com/lit/pdf/sprad26

    Could you try other instances? Your settings with pinmux seem correct.

    - Keerthy