Question
nx_tcp_socket_send Cannot send continuously in while
while(1)
{
TX_MEMSET(data_buffer, '\0', sizeof(data_buffer));
/* allocate the packet to send over the TCP socket */
ret = nx_packet_allocate(&AppPool, &data_packet, NX_IPv4_TCP_PACKET, TX_WAIT_FOREVER);
if (ret != NX_SUCCESS)
{
printf("aaaa1\r\n");
break;
}
/* append the message to send into the packet */
ret = nx_packet_data_append(data_packet, (VOID *)data_buffer, sizeof(data_buffer), &AppPool, TX_WAIT_FOREVER);
if (ret != NX_SUCCESS)
{
printf("aaaa2\r\n");
// nx_packet_release(data_packet);
break;
}
ret = nx_tcp_socket_send(&TCPSocket, data_packet, 30000 );
if (ret != NX_SUCCESS)
{
printf("tcp send error:%#x\r\n",ret);
break;
}
}hardware:STM32H747I-DISCO
i want send TCP data continuously in a while ;
but this is a problem; Error message after sending 5 data;errcode is 0x38 ;But I'm sure the Internet is good;
so i check code i find ;
HAL_ETH_Transmit_IT -- > ETH_Prepare_Tx_Descriptors return HAL_ETH_ERROR_BUSY;
if((READ_BIT(dmatxdesc->DESC3, ETH_DMATXNDESCWBF_OWN) == ETH_DMATXNDESCWBF_OWN) || (dmatxdesclist->PacketAddress[descidx] != NULL))
{
return HAL_ETH_ERROR_BUSY;
}so How to solve this problem?
