QUEUE_LENGTH and NUM_NETWORK_BUFFER_DESCRIPTORS

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

You should provide your tailored network stack configuration FreeRTOSIPConfig.h.

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?

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

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

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

…and this page describes how to tailor for RAM or throughput, as required.

Now it makes sense. :ok_hand:

thanks