AM261x MCU+ SDK: MCSPI External Loopback

| AM261x MCU+ SDK 26.00.00 |

MCSPI External Loopback

# Introduction

This example demonstrates the McSPI RX and TX operation configured in blocking, interrupt mode of operation with External loopback connection of 2 McSPI instances controlled by different cores - one in controller and other in peripheral mode

This example sends a known data in the TX mode of length APP_MCSPI_MSGSIZE and then receives the same in RX mode.

When transfer is completed, TX and RX buffer data are compared. If data is matched, test result is passed otherwise failed.

# Supported Combinations

Parameter | Value
--- | ---
CPU + OS | r5fss0-0 freertos
r5fss0-1 nortos
Toolchain | ti-arm-clang
Boards | am261x-som, am261x-lp
Example folder | examples/drivers/mcspi/mcspi_external_loopback

# Steps to Run the Example

- When using CCS projects to build, import the CCS project for the required combination and build it using the CCS project menu (see Using SDK with CCS Projects).
- When using makefiles to build, note the required combination and build using make command (see Using SDK with Makefiles)
- Make below external loopback connections between two SPI instances:
  - AM261x LP
    - MCU_SPI0_CS0 (J2/J4 Pin 19) (B13) -> MCU_SPI2_CS1 (J5/J7 Pin 59) A18
    - MCU_SPI0_CLK (J6/J8 Pin 7) (T2) -> MCU_SPI2_CLK (J6/J8 Pin 47) D17
    - MCU_SPI0_D0 (J6/J8 Pin 15) (T1) -> MCU_SPI2_D1 (J6/J8 Pin 54) B18
    - MCU_SPI0_D1 (J6/J8 Pin 14) (U1) -> MCU_SPI2_D0 (J6/J8 Pin 55) A16
  - AM261x SOM and AM263x HSEC Board
    - MCU_SPI0_CS0 (C11) -> HSEC_LIN3_RXD (J20-12) -> MCU_SPI1_CS0 (C9) -> HSEC_SPI1_CS0 (J20-16)
    - MCU_SPI0_CLK (A11) -> HSEC_LIN3_TXD (J20-11) -> MCU_SPI1_CLK (A10) -> HSEC_SPI1_CLK (J20-15)
    - MCU_SPI0_D0 (C10) -> HSEC_SPI0_D1 (J20-10) -> MCU_SPI1_D1 (D9) -> HSEC_SPI1_D1 (J20-14)
    - MCU_SPI0_D1 (B11) -> HSEC_SPI0_D0 (J20-9) -> MCU_SPI1_D0 (B10) -> HSEC_SPI1_D0 (J20-13)
  - AM261x SOM and C2000 HSEC Board
    - MCU_SPI0_CS0 (C11) -> HSEC PIN (73) -> MCU_SPI1_CS0 (C9) -> HSEC PIN (81)
    - MCU_SPI0_CLK (A11) -> HSEC PIN (71) -> MCU_SPI1_CLK (A10) -> HSEC PIN (79)
    - MCU_SPI0_D0 (C10) -> HSEC PIN (69) -> MCU_SPI1_D1 (D9) -> HSEC PIN (77)
    - MCU_SPI0_D1 (B11) -> HSEC PIN (67) -> MCU_SPI1_D0 (B10) -> HSEC PIN (75)
- Launch a CCS debug session and run the executable, see CCS Launch, Load and Run

# See Also

MCSPI

# Sample Output

Shown below is a sample output when the application is run,

[MCSPI] External Loopback example started in Peripheral mode...
[r5f0-1] 0.000059s : [MCSPI] External Loopback example started in Controller mode...
Successfully received and sent data in Peripheral mode!!
[r5f0-1] 2.348816s : Successfully received and sent data in Controller mode!!
[r5f0-1] 2.348837s : All tests have passed!!