heinbali01 wrote on Sunday, March 24, 2019:
Hi Peter, the Network Interfaces tend to receive less attention than they need. They’re always on the edge between the TCP/IP driver ( with generic code ) and the actual hardware. The drivers are part of the distribution, but they all borrow code from the chip manufacturers.
During the last 2 years, the FreeRTOS+TCP library has become safer: many security issues have been fixed.
One of the fixes required a check on the packet length of the data received. And so a parameter uxBufferLength
was added to usGenerateProtocolChecksum()
:
-uint16_t usGenerateProtocolChecksum( const uint8_t * const pucEthernetBuffer, BaseType_t xOutgoingPacket )
+uint16_t usGenerateProtocolChecksum( const uint8_t * const pucEthernetBuffer, size_t uxBufferLength, BaseType_t xOutgoingPacket )
About GMAC_USES_TX_CALLBACK
: it is obligatory to define this macro as 1
. The alternative has not been realised or tested.
A missing ulApplicationGetNextSequenceNumber
: you could have googled that
This function is supposed to be provided by the application builder. Again it has to do with security: it helps against TCP spoofing.
Every TCP connection starts with some randomly chosen Sequence Number, from both sides. This sequence number should be chosen as randomly ( unpredictable ) as possible. If not, a third party might break in and take over the TCP conversation. Well, WikiPedia will explain this in a much smarter way.
Did anyone get this working ? (How?)
Of course, yes, I have many positive reports from people using the SAM4E port of FreeRTOS+TCP
You are supposed to deliver and maintain a configuration file called FreeRTOSIPConfig.h, and also FreeRTOSConfig.h. In the latter you will find the static declarations of MAC address and IP-address.
I recommend to start without DHCP ( #define ipconfigUSE_DHCP 0
in FreeRTOSIPConfig.h ), and use a fixed IP-address.
Then try to ping your device. If ping does not work, start up a capture program like WireShark.