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 | am263px-cc, am263px-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:
- AM263px CC and AM263x HSEC Board
- MCU_SPI0_CS0 (C11) (HSEC Pin 12) -> MCU_SPI1_CS0 (C9) (HSEC Pin 16)
- MCU_SPI0_CLK (A11) (HSEC Pin 11) -> MCU_SPI1_CLK (A10) (HSEC Pin 15)
- MCU_SPI0_D0 (C10) (HSEC Pin 9) -> MCU_SPI1_D0 (B10) (HSEC Pin 14)
- MCU_SPI0_D1 (B11) (HSEC Pin 10) -> MCU_SPI1_D1 (D9) (HSEC Pin 13)
- AM263px CC 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 67) -> MCU_SPI1_D0 (B10) (HSEC Pin 77)
- MCU_SPI0_D1 (B11) (HSEC Pin 69) -> MCU_SPI1_D1 (D9) (HSEC Pin 75)
- AM263px LP
- MCU_SPI0_CS0(Pin 8) (C11) -> MCU_SPI1_CS0(Pin 58) (C9)
- MCU_SPI0_CLK(Pin 7) (A11) -> MCU_SPI1_CLK(Pin 47) (A10)
- MCU_SPI0_D0(Pin 15) (C10) -> MCU_SPI1_D1(Pin 54) (D9)
- MCU_SPI0_D1(Pin 14) (B11) -> MCU_SPI1_D0(Pin 55) (B10)
- 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!!