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.

TMDX654IDKEVM: Use SPI in Slave Mode

Part Number: TMDX654IDKEVM

Hello,

I want write a Linux Driver to use the SPI in slave mode. I am in a very early stage of the project and I have to clearify, if this is possible and how much effort is necessary to achive this goal.

Therefore I have the following questions:

- Do I have to change settings by using the TISCI interface to the DMSC to achive my goal?

- If so, are there any examples how to make TISCI calls in a Linux Kernel Module?

Best regards,

Johannes

  • Hi Johannes,

    https://patchwork.kernel.org/project/linux-omap/patch/20160525141119.14486-2-rk@ti.com/

    This was tried long long back. I believe even before getting to TISCI interface go though the
    above link & see what are missing & What work arounds were done. This never get going
    so effort will be big from my understanding.

    Best Regards,
    Keerthy

  • Hi Keerthy,

    thanks for your reply.

    Yes, you are right. If I want to try to add the slave functionality to spidev, this will be a lot of effort.

    My approach is more like writing a Linux Kernel Module, which offers a device file. The module will setup the SPI HW for Slavemode and activate some interrupts (byte received, ...). If an interrupt occurs, the kernel module will send a notification (maybe a signal or with poll) to an userspace app. This app will write a value back to the module via the device file and this will be the value, which will be transferred on the next SPI transfer. I know, this approach wouldn't work with high SPI frequencies, but this is not necessary.

    So, I am thinking about bringing the Bare Metal code for a SPI slave device (from the RTOS SDK) to a Kernel module and add some interfaces to userspace.

    Do you think this is doable? Are there any DMSC calls necessary for the Bare Metal code for a SPI slave device (from the RTOS SDK)?

    Best regards,

    Johannes

  • Hi Johannes,

    The SPI expert recommend watching this video: https://www.youtube.com/watch?v=tCa_ydVwKhM

    As I explained earlier this will be complicated you can try your ideas but TI claims no support for the slave mode.

    Best Regards,
    Keerthy