I am using EK-RA6M3 to test TCPIP communication with FreeRTOS + TCP.
The following functions are executed repeatedly.
FreeRTOS_accept()
FreeRTOS_setsockopt()
FreeRTOS_recv()
FreeRTOS_send()
FreeRTOS_shutdown()
vPortFree()
FreeRTOS_closesocket()
If the client disconnects during FreeRTOS_recv(), it jumps to prvTaskExitError().
If I stop debugging and run it again, I cannot connect with FreeRTOS_accept().
When I stop debugging and then run it again, I cannot connect with FreeRTOS_accept().
I cannot connect even when I power cycle the board, but I can connect by restarting the PC.
Please let me know if you know the correct procedure for stopping.
Please let me know if you know the correct procedure for stopping.
After calling FreeRTOS_shutdown(), are you making sure that shutdown is completed by calling FreeRTOS_recv to see if it returns -pdFREERTOS_ERRNO_EINVAL.
Yes, pdFREERTOS_ERRNO_ENOTCONN is returned if either the connection has been closed or in the process of closing, ie, waiting for a connection termination request or waiting for a connection termination request acknowledgement from the remote TCP.
void TaskFunction( void * params )
{
( void ) params;
/* Perform task functions. */
/* Delete the task as we no longer need it. */
vTaskDelete( NULL );
}
One of the break statements in your code causes it to exit the task function which is the cause of the error. Here is the updated code - new_thread0_entry.c (5.9 KB). Hope that helps.