Hi :
I have some idea, maybe you can check this.
Environment:
S32K358, BMS GEN2 SDK 0.9.1, S32K3 RTD 6.0 (S32K3_RTD_6_0_0_D2506)
PHY: TPL33665, DUAL_SPI_MASTER_SLAVE, ICU sideband (EIRQ16)
BCC: MC33774A (TPL3 variable) + MC33772C (TPL2 fixed 48L)
RTOS: FreeRTOS
Previously working on RTD 3.0 (S32K3_RTD_3_0_0_P01_D2303)
Problem:
After migrating to RTD 6.0, all PHY TDs complete with PHY_TS_TIMEOUT instead of PHY_TS_FINISHED, even when valid response data is received (ResponseMsgNumAct > 0). The timeout handler also always reports PHY_NO_ERROR, making it impossible to distinguish successful transactions from real failures.
RTD 3.0 (correct): Successful → Status=FINISHED, PhyError=NO_ERROR | Failed → Status=TIMEOUT, PhyError=HW_ERROR
RTD 6.0 (buggy): Both cases → Status=TIMEOUT, PhyError=NO_ERROR
Root Cause (2 bugs in Phy_665a driver):
Race condition in IcuReqQueueLowNotification() — bRxExpectedFlag is cleared before DSpiRequestQueueLowIrq() is called. If SPI Slave RX fires in between, the response is ignored and SpiFinishStatusUpdate() is never called → GPT timeout always fires.
SpiTimeoutStatusUpdate() always called with PHY_NO_ERROR — even when no device responds. RTD 3.0 correctly reported PHY_HW_ERROR.
Workarounds applied:
Check ResponseMsgNumAct == 0 instead of Status == PHY_TS_FINISHED to detect real failures
Check only PhyError for write-only TDs
Split large multi-device TDs into per-device TDs to avoid GPT timeout truncation
Thanks
BR, BillWen