Hello there,
I’ve spent some time debugging my TCP implementation. I’m using TMS570LC435 copy Ethernet driver for FreeRTOS**+**TCP V4.3.2 and static buffer allocation (BufferAllocation_1.c).
To test the integration. I implemented a simple echo server. When testing it the TCP handshake worked fine, but afterwards no payload was transported.
For me it seems like the error is in src\os\freertos\freertos-plus\freertos-plus-tcp\source\FreeRTOS_TCP_Transmission.c:prvTCPBufferResize().
- In
prvTCPBufferResize()I havexBufferAllocFixedSize != pdFALSEas I’m using BufferAllocation_1.c souxNeededisipTOTAL_ETHERNET_FRAME_SIZE ipTOTAL_ETHERNET_FRAME_SIZE is ( uint32_t ) ipconfigNETWORK_MTU ) + ( ( uint32_t ) ipSIZE_OF_ETH_HEADER ) + ipSIZE_OF_ETH_CRC_BYTES + ipSIZE_OF_ETH_OPTIONAL_802_1Q_TAG_BYTES )- That equals in my case 1500
A bit later pxGetNetworkBufferWithDescriptor() is called with uxNeeded as xRequestedSizeBytes
- This causes the check
if( ( xNetworkBufferSemaphore != NULL ) && ( xRequestedSizeBytes <= ( ipconfigNETWORK_MTU + ipSIZE_OF_ETH_HEADER ) ) ) {to fail as ipconfigNETWORK_MTU + ipSIZE_OF_ETH_HEADER is in my case 1514.
My solution was changing FreeRTOS_IP.h to
#define ipTOTAL_ETHERNET_FRAME_SIZE ( ( ( uint32_t ) ipconfigNETWORK_MTU ) + ( ( uint32_t ) ipSIZE_OF_ETH_HEADER ) )
Now it works. Do you now a better solution to fix this?
Best,
Sven