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.

PROCESSOR-SDK-AM65X: SPI test fails

Part Number: PROCESSOR-SDK-AM65X
Other Parts Discussed in Thread: TMDX654IDKEVM

I wanted to test the simple sending and receiving SPI message in my device.

Following the SDK documentation i configured the spidev driver which provides that interface. After configuring all the required steps , when I try to test the SPI using the spidev_test application present in kernel source, the core is getting dumped.

software-dl.ti.com/.../Foundational_Components_Kernel_Drivers.html

In spidev_test.c file, the path was set to default (/dev/spidev1.1) device. In my system it was /dev/spidev3.0 was available. I changed the default path in the source code. Compiled and copied the binary to SD card and executed it.

1. Executing just the binary provides the following output.

2. These are the following options that are accepted by the test application.

3. When i try to test the SPI loop-back, the core is getting dumped.

4. I looked for the error in the source code and it is getting generated from here.


Q1. Is it the right way to test the application ?

Q2. Is compatible = "rohm,dh2228fv"; right for AM65x_IDK board ?

  • Hi Venkatesh,

    Do you use EVM TMDX654GPEVM or IDK TMDX654IDKEVM ?

    spidev3.0 corresponds to SPI3 CS0. Make sure you are using SPI3/0x02130000 module.

    Make sure SPI3 pinmux is setup correctly. Can you also attach your DTS file (or spi3 portion at least) for review?

    To test the spidev_test application for loopback, you need to short spi3_d0 and spi3_d1 pins. Check also below pointers for details:

    venkatesh Rayavarapu said:
    Q2. Is compatible = "rohm,dh2228fv"; right for AM65x_IDK board ?

    Yes

    Regards,
    Pavel

  • Hi Pavel,

    Thanks for your reply and sorry for the delay.

    Do you use EVM TMDX654GPEVM or IDK TMDX654IDKEVM ?

    I am using IDK TMDX654IDKEVM.

    spidev3.0 corresponds to SPI3 CS0. Make sure you are using SPI3/0x02130000 module.

    I configured the SPI1 driver but i got spidev3.0 in /dev/ section. Only spidev3.0 was available.

    Make sure SPI3 pinmux is setup correctly. Can you also attach your DTS file (or spi3 portion at least) for review?

    Please find DTS and PINMUX files attached below. The snippets added inside "/* ADDED- SPI - START */ and /* ADDED- SPI - END */ ".

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/DTS_5F00_PINMUX.7z

  • Venkatesh,

    I made a search and find that this option -l (loopback) is not supported. For SPI loopback, you need to short MISO and MOSI pins, as internal loopback is not possible. Refer to the below e2e threads for details:

    Regards,
    Pavel

  • Thanks for the threads.

    I understood about the loop back but for my case, what was causing the core dump ?

    What does the &mode expecting ?

    What mistake i did in the configuration that i was getting spidev3.0 instead spidev1.0 for spi1 configuration ?

  • Venkatesh,

    spidev_test -l option set spi mode to SPI_LOOP, check below file:

    linux-kernel/tools/spi/spidev_test.c

    static void parse_opts(int argc, char *argv[])
    {

    switch (c) {

    case 'l':
                mode |= SPI_LOOP;
                break;

    }

    And SPI_LOOP is NOT supported for AM65x McSPI module and AM65x McSPI linux driver:

    linux-kernel/drivers/spi/spi-omap2-mcspi.c


    For example, you can compare SPI_LOOP mode with SPI_CS_HIGH mode, which is supported for AM65x device and software.

    You need to run below command:

    am65xx-evm:# ./spidev_test -D /dev/spidev3.0 -v

     

    Regards,
    Pavel

  • Okay.

    Thanks.

    Understood. I will test this and get back to you.

  • Hi,

    While sending a message, I am not not getting any signals on the CLK, D1 and D0 headers.

    What can be wrong ?

  • Venkatesh,

    Do you have any signal on SPI1_CS0 (AD12) pin? From what I understand, you are using main_spi1 at address 0x02110000. If you need to export main_spi1 signals on test header J20, you need to populated R317 resistor. Check AM65x IDK user guide:


    Also, you need to configure SPI1_CLK (AH12) pin as input, refer AM65x TRM, NOTE under Table 12-442. MCSPI I/O Signals (Master Mode)

    Also, for loopback test you need to configure one SPi data pin as input, other is output and short these pins.In your current DTS file, you configure both SPI1 data pins AE12 and AF12 as outputs. Then you need to configure "ti,pindir-d0-out-d1-in" entry properly.

    If isue still exist, please provide me full console log of your boot up flow , plus spidev_test command execution. I also will need your latest version of DTS file and register dump of your main_spi1 pinmux registers.

    Regards,
    Pavel