Index: Source/cifXHWFunctions.c =================================================================== --- Source/cifXHWFunctions.c (revision 6242) +++ Source/cifXHWFunctions.c (working copy) @@ -23,6 +23,8 @@ Version Date Author Description ---------------------------------------------------------------------------------- + 40 07.04.2014 MT Bus synchronous host flags may be out of sync with DPM on flash based-devices or after a system reset, + resulting in timeouts from xChannelSyncState, and missing sync callbacks 39 05.03.2014 MT DEV_WaitForBitState_Poll / DEV_WaitForSyncState_Poll may wait an additional cycle 38 16.10.2013 RM DEV_TransferPacket() does not call receive callback if command and answer not correspond 37 11.02.2013 MT Removed unneccessary readout of Sync handshake cells in DEV_IsReady/DEV_IsRunning/ @@ -730,12 +732,22 @@ /*****************************************************************************/ void DEV_ReadHostFlags(PCHANNELINSTANCE ptChannel, int fReadHostCOS) { + PDEVICEINSTANCE ptDevInstance = (PDEVICEINSTANCE)ptChannel->pvDeviceInstance; + if(ptChannel->bHandshakeWidth == RCX_HANDSHAKE_SIZE_8BIT) ptChannel->usHostFlags = HWIF_READ8(ptChannel->pvDeviceInstance, ptChannel->ptHandshakeCell->t8Bit.bHostFlags); else ptChannel->usHostFlags = LE16_TO_HOST(HWIF_READ16(ptChannel->pvDeviceInstance, ptChannel->ptHandshakeCell->t16Bit.usHostFlags)); - - + + /* Also read host sync flags, as they might not be set to zero on flash based devices */ + if( (ptDevInstance->pbHandshakeBlock != NULL) && + (ptChannel->fIsSysDevice) ) + { + NETX_HANDSHAKE_ARRAY* ptHandshakeBlock = (NETX_HANDSHAKE_ARRAY*)ptDevInstance->pbHandshakeBlock; + + ptDevInstance->tSyncData.usHSyncFlags = ptHandshakeBlock->atHsk[1].t16Bit.usHostFlags; + } + if(NULL != ptChannel->ptCommonStatusBlock) ptChannel->ulDeviceCOSFlags = LE32_TO_HOST(HWIF_READ32(ptChannel->pvDeviceInstance, ptChannel->ptCommonStatusBlock->ulCommunicationCOS)); Index: version_history.txt =================================================================== --- version_history.txt (revision 6243) +++ version_history.txt (working copy) @@ -4,6 +4,11 @@ Known Problems: - Automatic file upload for PCI hardware not implemented +under development +----------------- + - xChannelSyncState may not work on flash-based devices (if not reset is done during initialization) + or after xSysdeviceReset + V1.1.5.0 ----------------- - DEV_TransferPacket() may drop unexpected packets