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.

AM2634-Q1: AM263x MCSPI silent loopback

Part Number: AM2634-Q1
Other Parts Discussed in Thread: SYSCONFIG

Hello,

As set in SDK examples and explained here  https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1291962/am2634-q1-how-to-disable-loopback-function-in-mcspi-sample-code?tisearch=e2e-sitesearch&keymatch=mcspi%252520loopback# it is possible to internally connect D0/D1 for loopback even though Sysconfig states that it is invalid configuration. It seems to work anyway.

However, data appears on the pins. Is it possible to have silent MCSPI loopback in a way that neither CS, MOSI, MISO and CLK appear on the pins and how to do it?

Regards,

Eugene

  • Hi Eugene,
    Thanks for the detailed question. Based on the AM263x MCSPI Technical Reference Manual and the related E2E thread you linked (1291962), here's a more precise answer:
    Why signals still appear on the pins: The "internal loopback" you're using (MCSPI_LOOPBACK_INTERNAL combined with dataLine[0] = MCSPI_DATA_LINE_COMM_MODE_TX_RX) works by routing TX and RX through the same physical data pin (D0). This is confirmed in the earlier thread — an expert noted that configuring a single data line as both TX and RX is what creates the loopback, and functionally it still drives/reads through the pad. This isn't a pure "core-only" loopback — it's pad-level, so SPICLK, D0/D1, and CS still toggle externally as part of normal operation. This is also why SysConfig flags it as an "invalid" configuration — it's a side effect of pin reuse, not a supported test mode.
    Comparison — is there a true silent mode? For reference, TI's MCAN peripheral does have a dedicated "Internal Loopback / Hot Self-test" mode (MCAN_TEST[LBCK] + MCAN_CCCR[MON]) that explicitly disconnects the RX pin from the module and holds TX recessive — i.e., a genuine "silent" loopback where activity never reaches the pins. MCSPI does not have an equivalent dedicated register bit for this. There's no MCSPI control bit that disconnects SPICLK/D0/D1/CS from the pads while still exercising the SPI logic internally.
    Possible approach to get a "silent" MCSPI loopback: Since MCSPI does not have a dedicated silent-loopback register, the practical way to keep activity off the physical pins is at the pinmux level, not the peripheral level:
    • In SysConfig, do not assign the SPICLK, SPI_D0, SPI_D1, and CS signals of that MCSPI instance to any physical package pin (leave them unassigned with no pin selected, or route to an alternative mux state).
    • The MCSPI IP itself doesn't require its signals to be pinmuxed to a pad in order to operate — the internal loopback path (D0 configured TX_RX) works independent of whether that signal is routed to physical silicon I/O. If it's never muxed to a package pin, there's no way for it to appear externally, regardless of internal SPI activity.
    • If you need other functions on those same physical pins simultaneously (e.g., GPIO), as mentioned, mux the pins to that alternate function instead, and MCSPI should continue looping data internally without touching those pads.
    If pins must stay pinmuxed to MCSPI for other reasons: In that case, based on available documentation, there isn't a supported bit-level way to suppress pad toggling while keeping SPI-internal loopback active — you'd need external hardware isolation (e.g., disabling the pin's output buffer at the board level, or bus switches) since the SoC doesn't expose an MCSPI-equivalent of the MCAN "Hot Selftest" mode.

    References:

    Best Regards,
    Zackary Fleenor
  • Hi Zackary,

    Thank you for very detailed explanation. I am not sure though that this could be done with Sysconfig. Some generated code hacking will be required but concept is clear.

    Regards,

    Eugene