FS26 CRC error when commucating with MCU K396 by SPI

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

FS26 CRC error when commucating with MCU K396 by SPI

847 次查看
HarryFu
Contributor I

Hello,I use the SDK package of FS26 0.9 autosar R21-11 version 0.9.0,I fix some bugs of the RTD and make the FS26 feedback some value from SPI port,however,the CRC check is always wrong .I put the code as the following shown.

 

eReturnValue = Sbc_fs26_TransferData(&txData, pRxData);

it contains the function:

Sbc_Ip_SpiTransferExternal(const Sbc_Ip_SpiSetupType *pSpiSetup, const uint8 * pTxBuffer, uint8 * pRxBuffer);

it contains the function:

#elif defined(USE_IPV_LPSPI)
 eStatus = (Std_ReturnType)Lpspi_Ip_SyncTransmit(ExternalDevice,
(uint8 *)pTxBuffer,
(uint8 *)pRxBuffer,
(uint16)pSpiSetup->NumberOfBytes,
pSpiSetup->Timeout);

and the following code:

/* Trigger the SPI transfer */
eReturnValue = Sbc_Ip_SpiTransferExternal(&spiSetup, &au8SpiTxFrame[0], &au8SpiRxFrame[0]);

if ((Std_ReturnType)E_OK == eReturnValue)
{
/* Check the CRC of the retrieved frame */
eReturnValue = Sbc_fs26_CheckCrc(au8SpiRxFrame, SBC_FS26_COMM_FRAME_SIZE);

if (((Std_ReturnType)E_OK == eReturnValue) && (NULL_PTR != pRxData))
{
/* Copy the retrieved data into the user provided buffer */
pRxData->u8DeviceStatus = au8SpiRxFrame[0];
pRxData->u16ReadData = ((uint16)au8SpiRxFrame[1] << 8U) | (uint16)au8SpiRxFrame[2];
}
}

I found that the first eReturnValue is E_OK ,whereas the second one after checkCrc function it becomes NoT_OK,so the readdata cannot receive the correct data.

I past the picture as th following shown:

微信图片_20250117203020.png.

Anyone can help me to analysis the root reason of the issue?thanks!

 

 

 

 

0 项奖励
回复
3 回复数

761 次查看
quangvuanh
NXP Employee
NXP Employee

Hello @HarryFu 

Can you please help me to know more detail about:

1) Did this issue happen on every ReadRegister calls, or did it just occur only on a specific register address?

2) Can you let me exactly what software version of FS26 and RTD that you are using? I need the correct name of the update site packages, as we have delivered separate packages of FS26 for K396 and other K3 devices.

Assumption from me on your CRC issue:

Taking a look into your configuration I dont see any possible issue from Spi or FS26 software setup.

we also recorded this CRC error in the case logic level of VDDIO(FS26) is different from VDDHV_A/VDDHV_B( K3 MCU), for example 3.3V vs 5V. It rarely happens, but can you please confirm that you have the same logic level with your hardware setup?

0 项奖励
回复

825 次查看
HarryFu
Contributor I

I put my Mcal configuration for SPI and FS26 as the following shown:

SPI Config.jpgSPI Config2.jpgSPI Config3.jpgSPI Config4.jpg

0 项奖励
回复

799 次查看
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi Quang (@quangvuanh),

Could you please please help with this question from Vepic Technologies China?

Thanks & BRs, Tomas

0 项奖励
回复