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.

TMS570LC4357: tms570lc4357 mibspi can receive

Part Number: TMS570LC4357
Other Parts Discussed in Thread: TEST2

Hello,

I use tms570lc4357 mibspi5 to control flash (s25fl064l). The mibspi sends normally, but the data returned by flash cannot be received. The oscilloscope show that data has been sent and the flash has returned the data, but the software has not received the data.

Mibspi5 internal loopback test was successful;

mipspi5 input/output loopback test both successful;

some code: 


void mibspi_test_main(void)
{
/* USER CODE BEGIN (3) */
int i = 0;

sciDisplayText(sciREG3, "\r\nmibspi test ......\r\n", 22);
/* enable irq interrupt in */
_enable_IRQ_interrupt_();

/** Initialize MIBSPI */
mibspiInit();
mibspiGetrecvbuf(mibspiREG5);

//mibspiEnableLoopback(mibspiREG5, Analog_Lbk);
mibspiEnableGroupNotification(mibspiREG5, 0, 0);
while(1)
{
mibspiSetData_my(mibspiREG5, 0, &tx_data5[0]);
mibspiTransfer(mibspiREG5, 0);
sciDisplayText(sciREG3, "\r\nmibspi test2 ......\r\n", 23);

while (0 == mibspiIsTransferComplete(mibspiREG5, 0))
{
sciDisplayText(sciREG3, "\r\nspiwait.\r\n", 12);
}
sciDisplayText(sciREG3, "\r\nmibspi compl ......\r\n", 23);
mibspiGetrecvbuf(mibspiREG5);
mibspiGetData(mibspiREG5, 0, &rx_data5[0]);
//dbgPrintf(" mibspiGetData group=%d, data=%d:\r\n", 0, rx_data5[0]);
mibspiGetrecvbuf(mibspiREG5);

for (i = 0; i < 8; i++)
dbgPrintf(" mibspiGetData group=%d, %d, data=%d:\r\n", 0, i,rx_data5[i]);
}

}

8508.tms570lc4357_bsp.rar

  • Hello,

    I just reviewed your code, and didn't see the problem. 

    You said you saw the correct returned data on SOMI bus. Can you please check if the wire is properly connected to MibSPI5SOMI[0] pin? Is any error flag set in RXRAM buffer register or SPI flag register? 

    The TG size is 4 buffers in your setup. How many byte of TX data are used for command and address to flash? How many SPI clock cycles are required for flash to prepare the returned data? How many bytes of data should be returned from flash?