出错时间不一定导致波形难以抓取,长的话两天会出现一次error,短则几小时出现一次error
Hi,
I am thinking there with potential risk during SPI robust test: when SPI master start the transaction, while SPI slave are not ready (SPI slave eDMA was not ready to receive data). You can calculate the SPI communication count . During SPI master code, you could print count value with 10 minutes interval. Then you could check when there with communication issue happens.
Mike
Hi,
I checked attached codes, the SPI slave has a loopCounter variable.
What's the loopCounter value when the communication issue happens.
If add the delay time at SPI master could make the situation be better?
delay_ms(2);
And I also find below different setting with SPI pads, could you using below setting at <pin_mux.c> file.
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_28_LPSPI1_SCK, 0x02U);
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_29_LPSPI1_PCS0, 0x02U);
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_30_LPSPI1_SOUT, 0x02U);
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_31_LPSPI1_SIN, 0x02U);
Wish it helps.
Mike
PinConfig设置0x02,延迟设置20ms,多次测试,仍然会出现问题。关于errorCount的值会不同,出问题时errorCount有时是1024有时是1或者其他值,并不固定
Hi
Could you try to make below change:
while (1)
{
LPSPI_MasterTransferEDMA(EXAMPLE_LPSPI_MASTER_BASEADDR, &g_m_edma_handle, &masterXfer);
/* Wait until transfer completed */
while (!isTransferCompleted)
{
}
isTransferCompleted = false;
Change to
while (1)
{
isTransferCompleted = false;
LPSPI_MasterTransferEDMA(EXAMPLE_LPSPI_MASTER_BASEADDR, &g_m_edma_handle, &masterXfer);
/* Wait until transfer completed */
while (!isTransferCompleted)
{
}
Wish it helps.
Mike