# IAR compiler errors in FreeRTOS

**URL:** <https://forums.freertos.org/t/iar-compiler-errors-in-freertos/12024>\
**Category:** Libraries\
**Created:** [March 18, 2021, 7:55am UTC](https://forums.freertos.org/t/iar-compiler-errors-in-freertos/12024 "2021-03-18T07:55:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![eduardo-semcon](https://avatars.discourse-cdn.com/v4/letter/e/85e7bf/32.png) [@eduardo-semcon](https://forums.freertos.org/u/eduardo-semcon)\
**Post date:** [March 18, 2021, 7:55am UTC](https://forums.freertos.org/t/iar-compiler-errors-in-freertos/12024/1 "2021-03-18T07:55:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![htibosch](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/htibosch/32/62_2.png) [@htibosch](https://forums.freertos.org/u/htibosch)\
**Post date:** [March 18, 2021, 8:09am UTC](https://forums.freertos.org/t/iar-compiler-errors-in-freertos/12024/2 "2021-03-18T08:09:35Z")

</div>

Please find documentation [here](https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Ethernet_Buffer_Management.html).  
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.

---

<div class="post-metadata">

**Author:** ![eduardo-semcon](https://avatars.discourse-cdn.com/v4/letter/e/85e7bf/32.png) [@eduardo-semcon](https://forums.freertos.org/u/eduardo-semcon)\
**Post date:** [March 18, 2021, 8:13am UTC](https://forums.freertos.org/t/iar-compiler-errors-in-freertos/12024/3 "2021-03-18T08:13:00Z")

</div>

thanks.

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

---

<div class="post-metadata">

**Author:** ![htibosch](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/htibosch/32/62_2.png) [@htibosch](https://forums.freertos.org/u/htibosch)\
**Post date:** [March 18, 2021, 8:15am UTC](https://forums.freertos.org/t/iar-compiler-errors-in-freertos/12024/4 "2021-03-18T08:15:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![eduardo-semcon](https://avatars.discourse-cdn.com/v4/letter/e/85e7bf/32.png) [@eduardo-semcon](https://forums.freertos.org/u/eduardo-semcon)\
**Post date:** [March 18, 2021, 8:47am UTC](https://forums.freertos.org/t/iar-compiler-errors-in-freertos/12024/5 "2021-03-18T08:47:48Z")

</div>

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…)

---

<div class="post-metadata">

**Author:** ![PaulB-AWS](https://avatars.discourse-cdn.com/v4/letter/p/a183cd/32.png) [@PaulB-AWS](https://forums.freertos.org/u/PaulB-AWS)\
**Post date:** [April 28, 2021, 7:02am UTC](https://forums.freertos.org/t/iar-compiler-errors-in-freertos/12024/8 "2021-04-28T07:02:57Z")

</div>

> [@eduardo-semcon](#):
>
> 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.
