FreeRTOS-TCP - declaration problems in version 4.x?

If I set ipconfigIPv4_BACKWARD_COMPATIBLE to 1,
there seems to be conflict with the pxFillInterfaceDescriptor declarations.

in FreeRTOS_IP.h:
NetworkInterface_t * pxFillInterfaceDescriptor( BaseType_t xEMACIndex,
struct xNetworkInterface * pxInterface );

In FreeRTOS_IP.c:
pxFillInterfaceDescriptor( 0, &( xInterfaces[ 0 ] ) );
(note, no return result, although I don’t see why this function needs a return value, it’s never used)…

And in the example folder DriverSAM, NetworkInterface.c

NetworkInterface_t * pxFillInterfaceDescriptor( BaseType_t xEMACIndex,
                                                NetworkInterface_t * pxInterface )
{
    pxSAM_FillInterfaceDescriptor( xEMACIndex, pxInterface );
}

GCC Compile error:

FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/source/FreeRTOS_IP.c:932: undefined reference to `pxFillInterfaceDescriptor’

Hi @gordwait,

Which NetworkInterface.c implementation are you using?

FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/source/FreeRTOS_IP.c:932: undefined reference to `pxFillInterfaceDescriptor’

The error seems like there is no definition available for pxFillInterfaceDescriptor.

no return result

The example network interface implementation of pxFillInterfaceDescriptor needs to return the pointer to the interface, though the return value is not used, which seems not to be the case.

I’m trying to get my own port running on an Altera Nios II CPU, referring to the existing examples of NetworkInterface.c in the portable folder. This one I show here is the “SAM” one.

You need to have a definition for pxFillInterfaceDescriptor in your NetworkInterface.c file, if you are creating your own , along the similar lines as “DriverSAM”

NetworkInterface_t * pxFillInterfaceDescriptor( BaseType_t xEMACIndex,
                                                NetworkInterface_t * pxInterface )
{
    return pxNIOS_FillInterfaceDescriptor( xEMACIndex, pxInterface );
}

Does the compilation issue persist, even after this definition?

@gordwait Please refer to the Getting Started guide https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/GettingStarted.md for the same.
The sections " Backward Compatibility Mode:" and " API changes in 4.0.0:" talk about the same.

Change 4:
Existing API: pxFillInterfaceDescriptor
It is there for backward compatibility. The function FreeRTOS_IPInit() will call it to initialise the interface and end-point objects
New API: prefix_pxFillInterfaceDescriptor
where prefix = Network Interface Name
E.g pxWinPcap_FillInterfaceDescriptor
New function with the same functionality

Yes. Just try to compile with the “SAM” edition.