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: SPI communication is not working

Part Number: TMS570LC4357

HI Support,

I integrated driver of  MCP2518FD (External CAN FD through SPI interface) into TI code TMS570LC4357.

SPI communication is not working.

in debugging , I can see that execution got at stuck in a while loop

( /*SAFETYMCUSW 28 D MR:NA <APPROVED> "Hardware status bit read check" */
while((spi->FLG & 0x00000100U) != 0x00000100U)
{
} /* Wait */)

inside function uint32 spiTransmitAndReceiveData(spiBASE_t *spi, spiDAT1_t *dataconfig_t, uint32 blocksize, uint8 * srcbuff, uint8 * destbuff).

What could the problem?

Note : I am using Launchpad

  • It is waiting for the response from the SPI device. I don't know how MCP2518FD works. You should follow the SPI communication protocol defined in MCP2518FD datasheet.

    You can probe the SPI SIMO pin to check if MCU transmits correct data on the bus.