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.

SK-AM62A-LP: Steps to modify the device tree source file and building final image to boot SD for AM62AX board

Part Number: SK-AM62A-LP
Other Parts Discussed in Thread: SYSCONFIG

Hi,

I am using the SK-AM62AX-LP board and I am planning to use the SPI communication on the board, to test the spidev test.

But there is no spidev under the /dev folder. After visiting forum, I have understood that, DTS files needs to be modified.

root@am62axx-evm:~# ls /dev/spidev*
ls: cannot access '/dev/spidev*': No such file or directory

So, i would like to know 

a) How and where to modify

b) How to compile it for getting the final image file.

Thanks, Manoj.

  • Hi Manoj,

    which SPI interface do you want to use on that board? The DTS configuration for SPI and pinmux will greatly depend on this.

    Regards, Andreas

  • Hi Andreas,

    To connect to the external AFE board, I want to use the MCSPI0 of the mcu header pins.
    So, if you could please tell me how to access it.

    Thanks, Manoj

  • Hi Manoj,

    thanks for the clarification. I'm currently traveling but will provide you some pointers by early next week. There's plenty of resources / E2E posts that can be referenced, will dig up some of those. While most won't be specific to AM62A at this time, the general concept/steps will be the same as for AM62 and AM64 devices discussed in other threads.

    Regards, Andreas

  • To connect to the external AFE board, I want to use the MCSPI0 of the mcu header pins.

    The MCU_SPIx pins you are referring to are originating from what's called an "MCU Domain SPI module", and those are usually reserved for use by the MCU portion of the AM62A SoC (Cortex-R5F real-time core).

    If you want to use Linux for interfacing with SPI peripherals, you would want to use one of the "Main Domain SPI modules" available through the "User Expansion Connector" (J3) on the SK-AM62A-LP board. Both Main Domain SPI0 and SPI2 modules are available on that header. Looking at the schematics I noticed both of those are connected through a MUX, so that may need to be configured in addition to any pinmux etc. and device driver setup you'll need.

    Note there's also some related information on how to bring up and enable SPI access that can be found in this thread here: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1259941/sk-am64-sk-am64x-enable-spi-on-j4/   While it is for AM64x, the general principle and steps will apply to AM62Ax as well.

    Regards, Andreas

  • Hi Andreas,

    I appreciate your response following your vacation. 

    In the previous week, I followed the advice you provided above, and I'm listing the steps I took.


    1) I have successfully run the spidev_test and enabled the SPI2 peripheral of the "user expansion connector" pins in the device tree source file. However, when sending data using the echo "test" > /dev/spidev1.0 command, I am unable to see any data coming from the pins after connecting to an oscilloscope.

    2) I've modified the primary spi2 pins using the sysconfig tool and the TI-recommended mcu_plus_sdk mcspi driver example, but I'm still unable to see any data arriving from the pins.

    So, please let me know the things that I am missing in this process.

    Regards, Manoj

  • sending data using the echo "test" > /dev/spidev1.0 command

    The SPIDEV-exposed device can't be used like a simple character device, you need ioctl() accesses to configure and transfer data. The Linux Kernel source tree actually has a nice userspace sample application that shows exactly how to do that, see here:

    https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/tools/spi/spidev_test.c?h=ti-linux-6.1.y

    You'll need to cross-compile the C source file with the toolchain ("linux devkit") part of the SDK, and copy it to the target so you can execute it. Please give this a try.

    Regards, Andreas