I’ve been using FreeRTOS+TCP on a TM4C platform. The verison that shipped with TI’s SDK was old, and I was having lot of weird issues. I’m attempting to update my version in the hope of getting some support. Sadly the latest version is not working. Attempting to debug this I realized xNetworkInterfaceInitialise is never called! In fact I can’t find it called anywhere in the latest version. Naturally this means my MAC and PHY are not initialized which is at least my first problem. Could someone shed some light on this? Any help would be appreciated.
Hi @jprice
Are you using the latest version of the FreeRTOS+TCP TM4C interface
And you mean this line is not getting executed, when you run your application ?
Also , you can check these data to root cause the issue more accurately:
configEMAC_TASK_STACK_SIZE
Sufficient heap size is available to create the tasks in the application - You can verify that by stepping through the function in the debugger, or defining a malloc failed hook just to see if an allocation fails somewhere.
Which heap are you using ?
Can you check the xTaskCreate return value and see if the tasks are getting created.
configASSERT is defined in your configuration file.
Adding on to what @karahulx has suggested, with FreeRTOS+TCP version v4 and above, the stack added support for IPv6 and multiple interfaces & endpoints. Hence, for supporting multiple interfaces, the function xNetworkInterfaceInitialise (along with others) is now called through function pointer that is part of the network descriptor of that interface.
The TM4C network interface is not updated with these changes if you using the one thats part of the FreeRTOS+TCP repo. You can see the minimal changes required to update it to use it with the latest version of +TCP by checking the similar changes made to the Renesas network interface file. Once the changes are done, the application should call the interface specific fill interface descriptor before the stack is initialized (you should also change your stack initialization code similar to the example in the link) [example]:
extern NetworkInterface_t * pxTM4C_FillInterfaceDescriptor( BaseType_t xEMACIndex,
NetworkInterface_t * pxInterface );
/* Initialize the interface descriptor for TM4C. */
pxTM4C_FillInterfaceDescriptor(0, &(xInterfaces[0]));
You can ask questions here if you face issues with making these changes and please feel free to upstream your changes as a pull request to +TCP repo if you prefer.
Thank you @tony-josi-aws, this was indeed part of my issue. I implemented pxTM4C_FillInterfaceDescriptor as suggested. I left out EMACIndex for now as there’s only only one MAC. For others reference you also have to modify _process_received_packet() to fill in the endpoint. I cheated and used a global interface and passed that in like so: