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.

TMS570LS0432: SPI interrupts receive data is not working

Part Number: TMS570LS0432

Hello, 

I have problem with SPI interrupts. My device is in slave mode and I'm trying to get data using notification.c. When I'm getting message in main function using "spiReceiveData" everything is okey, so master device is working corectly and the problem is only with interrputs. I was trying to put breakpoints in notification.c and the app completely ignores it.

I will be grateful for every clue

Paulina

int main(void)
{
/* USER CODE BEGIN (3) */

    spiInit(); //master mode

    // dat config 
    spiDAT1_t dataConfig;
    dataConfig.CS_HOLD = FALSE;
    dataConfig.WDEL = FALSE;
    dataConfig.DFSEL = SPI_FMT_0;
    dataConfig.CSNR = SPI_CS_NONE;

    uint16_t generate = 0x07;

    //spiTransmitData(spiREG1, &dataConfig, 1, &generate);

    //slave mode 0xFFFFFFFC, master mode 0xFFFFFFFF
    uint32_t mode = 0xFFFFFFFC;
    spiREG1->GCR1 = (spiREG1->GCR1 & mode);

    _enable_IRQ();

    spiEnableNotification(spiREG1, 0x0100);

    // delay
    for (i=0; i<10000000; i++);

    // using in main func is working corectly 
    //spiReceiveData(spiREG1, &dataConfig, 1, rxData_ptr);


    while(1);
/* USER CODE END */

    return 0;
}


and func in notification.c 

#pragma WEAK(spiNotification)
void spiNotification(spiBASE_t *spi, uint32 flags)
{
/*  enter user code between the USER CODE BEGIN and USER CODE END. */
/* USER CODE BEGIN (31) */

    uint16_t rxData[2] = {0};
    uint16_t *rxData_ptr = &rxData;
    spiDAT1_t data_config;
    data_config.CS_HOLD = FALSE;
    data_config.WDEL = FALSE;
    data_config.DFSEL = SPI_FMT_0;
    data_config.CSNR = SPI_CS_NONE;
    spiGetData(spiREG1, &data_config, 1, rxData_ptr);
    int x;

/* USER CODE END */
}