AnsweredAssumed Answered

LPSPI_DRV_MasterTransferBlocking gets TIMEOUT error

Question asked by 文明 徐 on Mar 27, 2020
Latest reply on Apr 1, 2020 by 文明 徐

Hello,

 

I'm using S32K148 with S32DS.ARM.2018.R1. 

LPSPI_DRV_MasterTransferBlocking gets TIMEOUT error in some cases:

 

Configuration of LPSPI:

 

const lpspi_master_config_t spi0_ipc_sys_ma_MasterConfig0 = {
.bitsPerSec = 12000000U,
.whichPcs = LPSPI_PCS1,
.pcsPolarity = LPSPI_ACTIVE_LOW,
.isPcsContinuous = false,
.bitcount = 8U,
.lpspiSrcClk = 80000000U,
.clkPhase = LPSPI_CLOCK_PHASE_1ST_EDGE,
.clkPolarity = LPSPI_SCK_ACTIVE_LOW,
.lsbFirst = false,
.transferType = LPSPI_USING_DMA,
.rxDMAChannel = 0U,
.txDMAChannel = 1U,
.callback = NULL,
.callbackParam = NULL,
};

 

Testing cases:

1. LPSPI_DRV_MasterTransferBlocking(SPI0_IPC_SYS_MA, send_data, NULL, 16, 100);

    >> OK.

 

2. LPSPI_DRV_MasterTransferBlocking(SPI0_IPC_SYS_MA, send_data, NULL, 32, 10000);

    >> TIMEOUT. I have already set timeout to 10000 and even more, still timeout.

 

3. LPSPI_DRV_MasterTransferBlocking(SPI0_IPC_SYS_MA, send_data, receive_data, 32, 10000);

    >> OK.

 

4. LPSPI_DRV_MasterTransferBlocking(SPI0_IPC_SYS_MA, send_data, receive_data, 32, 100);

    >> OK. Less timeout still works. 

 

5. LPSPI_DRV_MasterTransferBlocking(SPI0_IPC_SYS_MA, send_data, receive_data, 256, 100);

    >> OK. More packets still work.

 

SDK:

Please check attachment for SDK version.

Attachments

Outcomes