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:
.
Anyone can help me to analysis the root reason of the issue?thanks!