IAR compiler errors in FreeRTOS

I’m using FreeRTOS+IP and I get these IAR compiler errors:

Error[Li006]: duplicate definitions for “pxGetNetworkBufferWithDescriptor”; in “C:\dev\bootloader\Bootloader\Debug\Obj\BufferAllocation_1.o”, and “C:\dev\bootloader\Bootloader\Debug\Obj\BufferAllocation_2.o”
Error[Li006]: duplicate definitions for “pxResizeNetworkBufferWithDescriptor”; in “C:\dev\bootloader\Bootloader\Debug\Obj\BufferAllocation_1.o”, and “C:\dev\bootloader\Bootloader\Debug\Obj\BufferAllocation_2.o”
Error[Li006]: duplicate definitions for “uxGetMinimumFreeNetworkBuffers”; in “C:\dev\bootloader\Bootloader\Debug\Obj\BufferAllocation_1.o”, and “C:\dev\bootloader\Bootloader\Debug\Obj\BufferAllocation_2.o”
Error[Li006]: duplicate definitions for “uxGetNumberOfFreeNetworkBuffers”; in “C:\dev\bootloader\Bootloader\Debug\Obj\BufferAllocation_1.o”, and “C:\dev\bootloader\Bootloader\Debug\Obj\BufferAllocation_2.o”
Error[Li006]: duplicate definitions for “vReleaseNetworkBufferAndDescriptor”; in “C:\dev\bootloader\Bootloader\Debug\Obj\BufferAllocation_1.o”, and “C:\dev\bootloader\Bootloader\Debug\Obj\BufferAllocation_2.o”
Error[Li006]: duplicate definitions for “xBufferAllocFixedSize”; in “C:\dev\bootloader\Bootloader\Debug\Obj\BufferAllocation_1.o”, and “C:\dev\bootloader\Bootloader\Debug\Obj\BufferAllocation_2.o”
Error[Li006]: duplicate definitions for “xNetworkBuffersInitialise”; in “C:\dev\bootloader\Bootloader\Debug\Obj\BufferAllocation_1.o”, and “C:\dev\bootloader\Bootloader\Debug\Obj\BufferAllocation_2.o”

Anyone knows how to solve this?

thanks

Please find documentation here.
You only need to link 1 module called BufferAllocation_x.
Use version 1 for projects with a lot of RAM and high demands for speeds.
Version 2 uses pvPortMalloc() and is often used on platforms with less RAM.

thanks.

Yes I had both files enabled on the project… Now I’m only using BufferAllocation1.c

in which case you will provide a function vNetworkInterfaceAllocateRAMToBuffers().
Make sure that ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS gets a reasonable value: the determines the total number of network buffers.

WOuld

#ifndef ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS
#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 45
#endif

be a reasonable number? We are using a STM32F767ZI which should have 512Kbytes of RAM (although splited into different types…)

It really depends on your application and how much RAM you can dedicate to network buffers. Each buffer is ipconfigNETWORK_MTU bytes long (usually 1500 bytes), so 45 * 1500 = 67.5k. This seems like more that enough for most applications, but the only way to be sure is to stress test your device.