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.

CCS/TMS320F28377D: SPI example gets stuck while waiting RX ready bit

Part Number: TMS320F28377D

Tool/software: Code Composer Studio

In modestly modified spi_loopback example below the code never exits while (SpiaRegs.SPIFFRX.bit.RXFFST != 1) {} loop.

As far as I can tell the code is correct (via the example provided).  What have I missed?

Code:

#include <stdio.h>
#include "F28x_Project.h"

void spi_fifo_init(void);
void spi_xmit(Uint16 a);
void error(void);

void main(void)
 {
    InitSysCtrl();

    InitSpiaGpio();

    DINT;

    InitPieCtrl();

    IER = 0x0000;
    IFR = 0x0000;

    InitPieVectTable();

    Uint16 rData, sData = 0x0000;

    while (1)
    {
        spi_xmit(sData);

        while (SpiaRegs.SPIFFRX.bit.RXFFST != 1)
        {
            puts("Waiting for RX bit");
        }

        rData = SpiaRegs.SPIRXBUF;

        if (rData != sData)
        {
            puts("Error\n");
        }

        puts("No Error");

        sData++;
    }
}

void spi_fifo_init()
{
    // Initialize SPI FIFO registers
    SpiaRegs.SPIFFTX.all = 0xE040;
    SpiaRegs.SPIFFRX.all = 0x2044;
    SpiaRegs.SPIFFCT.all = 0x0;

    // Initialize core SPI registers
    InitSpi();
}

void error(void)
{
    asm("ESTOP0");     // Test failed!! Stop!
    for (;;);
}

void spi_xmit(Uint16 a)
{
    SpiaRegs.SPITXBUF = a;
}

Kindly,

Graham