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.

RTOS/AM5718: McSPI multiple channels usage

Part Number: AM5718

Tool/software: TI-RTOS

I'm having troubles using SPI in multi-channel configuration with SPI interrupt enabled in TI-RTOS application.
I have a custom board with AM5718 and four SPI devices connected to single SPI port via four different chip-selects.
Application is running under SYS/BIOS and I'm trying to take advantage of using interrupts and callbacks. I've tried lots of combination of parameters while configuring MCSPI devices, but I can't make MCSPI to work properly.

If "chMode" parameter in "spiInitCfg[]" is set as "MCSPI_SINGLE_CH" and all four channels are opened with "MCSPI_open()" I can't start any transmission with "MCSPI_transfer()" on any channel other than default "chNum".
Futhermore, setting "chMode" as "MCSPI_MULTI_CH" completely freezes any transmission on any channel at all.

Examples of MCSPI applications from PDK which I have (pdk_am57xx_1_0_13) does not contain code of MCSPI usage in master mode with read-write operations on multiple channels of one MCSPI instance.

Can you please share a link where I can find and study such an example?
What does the "chMode" parameter with "MCSPI_MULTI_CH" possible value stands for?

Regards.

  • Hi Anton,

    Do you use AM571x McSPI module in master mode?

    You can use up to 4 channels only in master mode.

    Regards,
    Pavel

  • Anton,

    I made a search but not able to find AM57x MCSPI multi channel example. I can only find below test code:

    pdk_am57xx_1_0_14/packages/ti/drv/spi/test/src/main_mcspi_test.c

    spi_test_multiple_channel()

    MCSPI_MULTI_CH correspond to MCSPI_MODULCTRL[0] SINGLE = 0. When you configure your McSPI module, make sure you have SINGLE = 0.

    As debug hints I can provide:

    - make register dump between working case (single channel mode) and non-working case (multi-channel mode), make sure you have the correct values for multi-channel mode

    - probe the McSPI pins and check if you will have the expected signals there for multi-channel mode

    Regards,
    Pavel

  • McSPI is configured in master mode.
    I've made some exercises with McSPI module using that example as a base and eventually made it work with multiple SPI devices. However, the only way I was able to achieve this is to do a complete reinitialization (as in example) of every channel starting with next active one each time before I call any SPI transmission. This does not seem to be a smart solution, but is the only one that works. Now I have all CS lines blinking together each time I reconfigure channels, fortunately it does not affect any board elements in any serious way. I consider that workaround is found for an issue.