So I think my issue is similar to the one discussed with the title: STM32H743 FreeRTOS+TCP issue with ZERO Copy (apparently I can’t create a link to the discussion?), but thought I’d ask anyway, as I’m running on an MSP432 which might introduce/change some of the issues.
I’ve successfully integrated the +TCP libraries into my project, and seem to have a fairly stable stack. My project was started and developed with ipconfigZERO_COPY_TX_DRIVER set to 0.
However, during testing my project almost always eventually fails, and seems to fail at the following location:
Line 838 of MSP432E4NetworkInterface.c, in xNetworkInterfaceOutput():
/* When the following assert is hit, please make sure that * ipconfigZERO_COPY_TX_DRIVER is defined as '1' in your * FreeRTOSIPConfig.h header file. */ configASSERT(xReleaseAfterSend != pdFALSE)
What’s weird is that it usually takes several hours/million packets to get to the point where it fails at this assert. So I’m not sure why it takes so long to achieve the fail condition, or what’s changing. We’re not actively processing any received packets, and there shouldn’t be any traffic directed at us on the network, although we do have an open receive socket, as we’d like the ability to receive and process some packets in the future. At this point we’re purely creating and sending packets, and we’re able to send millions before this occurs. Both sockets (send & receive) are configured as UDP with FREE_RTOS_SOCK_DGRAM & FREERTOS_IPPROTO_UDP used during the FreeRTOS_socket() call.
My call stack shows the following:
xNetworkInterfaceOutput() @ MSP432ENetworkInterface.c : 838
prvTCPReturnPacket() @ FreeRTOS_TCP_Transmission.c : 536
prvTCPSendSpecialPacketHelper() @ FreeRTOS_TCP_Transmission.c:1475
prvTCPSendReset() @ FreeRTOS_TCP_Transmission.c:1505
xProcessReceivedTCPPacket() @ FreeRTOS_TCP_IP.c:686
...
So I’m not sure why we’re calling TCPSendReset(), or what the purpose of TCPSendSpecialPacketHelper() is - I’m actually a bit confused as why we would need to reset anything, given that both our sockets should be UDP, so there shouldn’t be any connection to reset?
Anyway, in complying with the rest above the assert, I set ipconfigZERO_COPY_TX_DRIVER to 1. I also updated my calls to
FreeRTOS_sendto() to include the FREERTOS_ZERO_COPY flag.
When doing this, my project compiles and runs, and produces absolutely no ethernet traffic, despite FreeRTOS_sendto() returning the appropriate size for bytes sent.
In looking at the discussion referenced, the first thing that stands out to me is my use of Bufferallocation_2.c instead of Bufferallocation_1.c, so that’s near the top of the list to try.
I’m curious if anyone has any other thoughts on what might be going on, either with the eventual stoppage when not using Zero Copy, or with the lack of packets entirely while using Zero Copy.
Thanks,
Ian