W5100 TCP send 오류 문의드립니다

안녕하세요.
W5100으로 제품을 개발하여 시험중에 있습니다.
그런데 간혹 송신한 tcp data를 상대방이 받지 못하는 현상이 있습니다.
상대방이 전혀 받지를 못하거나 시작 data는 맞는데 size가 무척 큰 데이터가 들어 오기도 합니다.
이 문제를 debugging중 아래와 같이 send() function내에 w5100에 data와 point를 write후 Sn_CR_SEND cmd를 set하기 전에 약간의 delay를 넣으니 문제가 사라졌습니다.
그런데 이렇게 해결하는 것은 정상적인 방법이 아닌듯하여 문의드립니다.
이렇한 현상이 발생할 가능성은 무엇이고 어느 부분을 중점 debugging 해야 할까요?

참고로 CPU는 stm32게열이고 tcp server mode이고 direct access방식입니다.

u16 send(
	SOCKET s,	 		/**< the socket index */
	const int8 * buf, 	/**< a pointer to data */
	u16 len			/**< the data size to be send */
	)
{
	u8	status=0;
	u16	ret=0;
	u16	freesize=0;
#ifdef __DEF_IINCHIP_DBG__
	printf("send()\r\n");
#endif

	if (len > getIINCHIP_TxMAX(s)) ret = getIINCHIP_TxMAX(s); // check size not to exceed MAX size.
	else ret = len;

	// if freebuf is available, start.
	do
	{
		freesize = getSn_TX_FSR(s);
		status = IINCHIP_READ(Sn_SR(s));
		if ((status != SOCK_ESTABLISHED) && (status != SOCK_CLOSE_WAIT))
		{
			ret = 0;
			break;
		}
#ifdef __DEF_IINCHIP_DBG__
		if (freesize < ret) printf("socket %d freesize(%d) requestlen(%d) error\r\n", s, freesize, ret);
#endif
	} while (freesize < ret);

	// copy data
	send_data_processing(s, (u8 *)buf, ret);
        //printf("send_data_processing\n"); //for test
        
        osDelay(1); //insert by hskim for fix send error
        
	IINCHIP_WRITE(Sn_CR(s), Sn_CR_SEND);

	/* wait to process the command... */
	while( IINCHIP_READ(Sn_CR(s)) );

No immediate idea why it happens - requires further troubleshooting.

Please use Wireshark to capture what that other party actually receives. I suspect that it receives correct data followed by a lot of wrong data from W5100, and if it is the case, then there’s some problem with W5100 TX pointers.