Preprocessor include "sdkconfig.h"

mozufferey
Posts: 8
Joined: Thu Aug 10, 2017 7:21 pm

Preprocessor include "sdkconfig.h"

Postby mozufferey » Wed Nov 01, 2017 8:52 pm

I meet some strange problem with new ESP_IDF.
Basically I download the software from finger563 "esp32-wireless-display".
with the ESP_IDF 2.0 this was working fine. I change to ESP_IDF 2.1 and at that point it didn't compile anymore.
The error message is:
C:/msys32/home/mozuf/esp/esp-idf/components/freertos/include/freertos/FreeRTOS.h:244:3: error: #error configMAX_TASK_NAME_LEN must be set to a minimum of 1 in FreeRTOSConfig.h
#error configMAX_TASK_NAME_LEN must be set to a minimum of 1 in FreeRTOSConfig.h

After some analysis in found in the FreeRTOS.h line 244 the following command

Code: Select all

#if configMAX_TASK_NAME_LEN < 1
	#error configMAX_TASK_NAME_LEN must be set to a minimum of 1 in FreeRTOSConfig.h
#endif
Changing the condition to

#if configMAX_TASK_NAME_LEN >= 1

lead to the same result.

Actually it seem that evey test done on the configMAX_TASK_NAME_LEN is true.

Searching deeper I found the that this variable is defined in the FreeRTOSConfig.h in line 190

#define configMAX_TASK_NAME_LEN ( CONFIG_FREERTOS_MAX_TASK_NAME_LEN )

The variable CONFIG_FREERTOS_MAX_TASK_NAME_LEN is defined in the file sdkconfig.h

Actually it seems that every test inside the "FreeRTOSConfig.h" or "FreeRTOS.h" done on any variable defined in the sdkconfig.h results as true.

to sumarise here is a small structure to ilustrate the process.

"FreeRTOS.h"
Here inside "FreeRTOS.h"
include "FreeRTOSConfig.h"
Here inside "FreeRTOSConfig.h"
include "sdkconfig.h"
Here inside "sdkconfig.h"
defined variables here
Test variables here OK
back inside "FreeRTOSConfig.h"
test variables here "Not OK"
back inside "FreeRTOS.h"
test variables here "Not OK"


More strange is when we copy the "sdkconfig.h" to "sdkconfig_.h"
and change the include inside "FreeRTOSConfig.h" compilation seem to work again.

"FreeRTOS.h"
Here inside "FreeRTOS.h"
include "FreeRTOSConfig.h"
Here inside "FreeRTOSConfig.h"
include "sdkconfig_.h"
Here inside "sdkconfig_.h"
defined variables here
Test variables here OK
back inside "FreFreeRTOSConfigeRTOS.h"
test variables here OK
back inside "FreeRTOS.h"
test variables here OK

I think this could be related to some limitations such as number of level of includes, or something similar.
However it seems that GCC does not have such limits. Actually the line #include "sdkconfig" appears:
70 times in ESP_IDF 2.1
58 times in ESP_IDF 2.0

I have here no clue how to go further. I wander if somebody has seen something similar?

Who is online

Users browsing this forum: No registered users and 230 guests