# QUEUE\_LENGTH and NUM\_NETWORK\_BUFFER\_DESCRIPTORS

**URL:** <https://forums.freertos.org/t/queue-length-and-num-network-buffer-descriptors/12028>\
**Category:** Libraries\
**Created:** [March 18, 2021, 2:23pm UTC](https://forums.freertos.org/t/queue-length-and-num-network-buffer-descriptors/12028 "2021-03-18T14:23:36Z")\
**Posts on this page:** 7\
**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, 2:23pm UTC](https://forums.freertos.org/t/queue-length-and-num-network-buffer-descriptors/12028/1 "2021-03-18T14:23:36Z")

</div>

I’m having several errors regarding:

#if ( ipconfigEVENT\_QUEUE\_LENGTH \< ( ipconfigNUM\_NETWORK\_BUFFER\_DESCRIPTORS + 5 ) )  
#error The ipconfigEVENT\_QUEUE\_LENGTH parameter must be at least ipconfigNUM\_NETWORK\_BUFFER\_DESCRIPTORS + 5  
#endif

Fatal Error[Pe035]: #error directive: The ipconfigEVENT\_QUEUE\_LENGTH parameter must be at least ipconfigNUM\_NETWORK\_BUFFER\_DESCRIPTORS + 5 C:\dev\bootloader\Bootloader\FreeRTOSv202012.00\FreeRTOSIPConfig.h 98

However I cannot find any definitions for ipconfigEVENT\_QUEUE\_LENGTH and ipconfigNUM\_NETWORK\_BUFFER\_DESCRIPTORS.

Any help, please?

thanks

---

<div class="post-metadata">

**Author:** ![hs2](https://avatars.discourse-cdn.com/v4/letter/h/a4c791/32.png) [@hs2](https://forums.freertos.org/u/hs2)\
**Post date:** [March 18, 2021, 2:39pm UTC](https://forums.freertos.org/t/queue-length-and-num-network-buffer-descriptors/12028/2 "2021-03-18T14:39:50Z")

</div>

You should provide your tailored network stack configuration [FreeRTOSIPConfig.h](https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_IP_Configuration.html).

---

<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, 2:49pm UTC](https://forums.freertos.org/t/queue-length-and-num-network-buffer-descriptors/12028/3 "2021-03-18T14:49:45Z")

</div>

do you include here my FreeRTOSIPConfig.h?  
I cannot see any attachments button…

By the way,

This test that causes the error, is on line 97  
#if ( ipconfigEVENT\_QUEUE\_LENGTH \< ( ipconfigNUM\_NETWORK\_BUFFER\_DESCRIPTORS + 5 ) )  
#error The ipconfigEVENT\_QUEUE\_LENGTH parameter must be at least ipconfigNUM\_NETWORK\_BUFFER\_DESCRIPTORS + 5  
#endif

But the definitions are on line 316…

#ifndef ipconfigNUM\_NETWORK\_BUFFER\_DESCRIPTORS  
#define ipconfigNUM\_NETWORK\_BUFFER\_DESCRIPTORS 45  
#endif

#ifndef ipconfigEVENT\_QUEUE\_LENGTH  
#define ipconfigEVENT\_QUEUE\_LENGTH ( ipconfigNUM\_NETWORK\_BUFFER\_DESCRIPTORS + 5 )  
#endif

Can this be correct?

---

<div class="post-metadata">

**Author:** ![hs2](https://avatars.discourse-cdn.com/v4/letter/h/a4c791/32.png) [@hs2](https://forums.freertos.org/u/hs2)\
**Post date:** [March 18, 2021, 3:06pm UTC](https://forums.freertos.org/t/queue-length-and-num-network-buffer-descriptors/12028/4 "2021-03-18T15:06:52Z")

</div>

Seems you’re referring to the `FreeRTOSIPConfigDefaults.h` which indeed could be polished here and there.  
However, e.g. my (custom) `FreeRTOSIPConfig.h` contains just the required/desired `#defines`

---

<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, 3:12pm UTC](https://forums.freertos.org/t/queue-length-and-num-network-buffer-descriptors/12028/5 "2021-03-18T15:12:27Z")

</div>

Somthing more like this:

#ifndef FREERTOS\_IP\_CONFIG\_H  
#define FREERTOS\_IP\_CONFIG\_H

#define ipconfigNUM\_NETWORK\_BUFFER\_DESCRIPTORS 32  
#define ipconfigEVENT\_QUEUE\_LENGTH (ipconfigNUM\_NETWORK\_BUFFER\_DESCRIPTORS + 8)  
#define ipconfigNETWORK\_MTU 1024  
#define ipconfigIP\_TASK\_STACK\_SIZE\_WORDS 1024  
#define ipconfigIP\_TASK\_PRIORITY 6  
#define ipconfigUSE\_TCP 1  
#define ipconfigUSE\_DNS 0  
#define ipconfigUSE\_DHCP 0  
#define ipConfigDRIVER\_INCLUDED\_TX\_IP\_CHECKSUM 1  
#define ipConfigDRIVER\_INCLUDED\_RX\_IP\_CHECKSUM 1  
#define ipconfigSUPPORT\_SELECT\_FUNCTION 1

#define ipconfigTCP\_KEEP\_ALIVE 1  
#define ipconfigTCP\_KEEP\_ALIVE\_INTERVAL 5  
#define ipconfigTCP\_HANG\_PROTECTION 1  
#define ipconfigTCP\_HANG\_PROTECTION\_TIME 10

#endif

The problem is that I want to use the latest release and this file I believe may have come from release 8…

Since the compiler gives an error, because the definitions are after the test, I guess this is an error.  
Could you tell me how I should proceed? What is the correct way of customising the FreeRTOSIPConfigDefaults.h file in order to generate a proper FreeRTOSIPConfig.h?

thanks

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [March 18, 2021, 3:19pm UTC](https://forums.freertos.org/t/queue-length-and-num-network-buffer-descriptors/12028/6 "2021-03-18T15:19:39Z")

</div>

FreeRTOSIPConfigDefaults.h is not a user editable file as it should be the same for all FreeRTOS+TCP projects. You customise +TCP for your application by providing a FreeRTOSIPConfig.h file. Anything that is not defined in FreeRTOSIPConfig.h will be defaulted by the values in FreeRTOSIPConfigDefaults.h. This is the same as in the FreeRTOS kernel - whereby you customise the kernel for your application by providing FreeRTOSConfig.h and anything not defined in there will either trigger a #error message or get set to a default value.

The following links may help:

First you can look at the [FreeRTOSIPConfig.h](https://github.com/FreeRTOS/FreeRTOS/blob/master/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Minimal_Windows_Simulator/FreeRTOSIPConfig.h) used in the example found in the main FreeRTOS download. Note the one I have linked to is for the Windows port, so its settings are not suitable for devices with limited RAM. There are other examples around - also in Hein’s git repo.

The constants are defined on [this](https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_IP_Configuration_Examples.html) page…

…and [this](https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_IP_Configuration_Examples.html) page describes how to tailor for RAM or throughput, as required.

---

<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, 3:40pm UTC](https://forums.freertos.org/t/queue-length-and-num-network-buffer-descriptors/12028/7 "2021-03-18T15:40:03Z")

</div>

Now it makes sense. 👌

thanks
