Configuring FreeRTOS

Hey all I’m sorry if this question is obvious or dumb..I am rather new to this!

I’ll keep this simple. Coming from other languages the build systems seem hard to understand. I’m currently working on a large project with framework = arduino,espidf. It has been going fine so far, but I would like to use features such as: xSemaphoreGetMutexHolder - FreeRTOS™ (amongst others). From the documentation:

INCLUDE_xSemaphoreGetMutexHolder must be set to 1 in FreeRTOSConfig.h for this function to be available.

To keep things simple, after a lot of fruitless googling I can’t find anything on how to set freertos configuration options. I am guessing I need to have freertos recompiled as a component with these settings…not just to change what is visible externally via header files

With the espidf build system it seems that a lot is abstracted away from me. I am guessing it has something to do with CMake, but my understanding of the espidf build system is super patchy and it doesn’t look like it can be done in menuconfig. Changing sdkconfig in the root of the project generated by espidf doesn’t seem to yield anything either. Frustratingly, I can see what i want in the freertos headers but I don’t want to start changing global installs just for this project.

Thanks for any help

It’s already on. The ESP-IDF holds the FreeRTOSConfig.h, only a few parameters of which can be tweaked through the menuconfig, which are the CONFIG_... macros.

I think you’re just not getting access to that function because the arduino,espidf combination in the official https://github.com/platformio/platform-espressif32/releases platform is using ancient versions. It’s Arduino-ESP32 2.0.17 with ESP-IDF 4.4.7. The regular one is 5.x with 6.x having just come out.

Use pioarduino as your platform in the platformio.ini and you will get a much more recent version.

Hello,

Thanks for quick reply, I wasn’t expecting such speed!

I have now had a chance to install pioarduino. However, I really need the combined set up of both frameworks for my work. I can’t find any examples or info in pioarduino on a hybrid set up. When I try and do it I get:

The exact error mentioned here, for which the solution is allegedly to abandon the hybrid build which I need. From what I can see there is mention of hybrid builds in the pioarduino platform you sent….so I am very, very confused:

I also don’t really understand how the error with a https_server.crt.S could have anything at all to do with whether my build is hybrid or not….:frowning:

Thanks for any help!

Please start of by purely copying and compiling the official

https://github.com/pioarduino/platform-espressif32/tree/main/examples/espidf-arduino-blink

example. That should build. Then do your modifications on top, if any are needed at all.

This flag being by default on in newer ESP-IDF versions also means that it should be on in the newer Arduino cores (3.x) as well, so with pioarduino, you may even get away with the much much simpler framework = arduino.

Hello, I went to the link for the example - which is what I ultimately based my project off of in with the first platform I had. Unfortunately, it doesn’t appear to work anymore. I downloaded it and followed the instructions exactly as written in the git repos to ensure nothing could conflict with it

Archiving .pio\build\espea32\esp-idf\espressif__esp-modbus\libespressif__esp-modbus.a
Compiling .pio\build\espea32\managed_components\espressif__esp_insights\src\esp_insights_transport.c.o
Compiling .pio\build\espea32\managed_components\espressif__esp_insights\src\esp_insights_client_data.c.o
Compiling .pio\build\espea32\managed_components\espressif__esp_insights\src\esp_insights_encoder.c.o
Compiling .pio\build\espea32\managed_components\espressif__esp_insights\src\esp_insights_cmd_resp.c.o
Compiling .pio\build\espea32\managed_components\espressif__esp_insights\src\esp_insights_cbor_decoder.c.o
Compiling .pio\build\espea32\managed_components\espressif__esp_insights\src\esp_insights_cbor_encoder.c.o
*** [.pio\build\espea32.pio\build\espea32\https_server.crt.S.o] Source .pio\build\espea32\https_server.crt.S' not found, needed by target .pio\build\espea32.pio\build\espea32\https_server.crt.S.o’.
======================================================================================================================== [FAILED] Took 131.39 seconds ========================================================================================================================

There appears to be something very wrong with hybrid builds with pioarduino :frowning:

Ok, i have gotten in compiling with this:

board_build.esp-idf.preserve_source_file_extension = yes
board_build.embed_txtfiles =
    managed_components/espressif__esp_insights/server_certs/https_server.crt
    managed_components/espressif__esp_rainmaker/server_certs/rmaker_mqtt_server.crt
    managed_components/espressif__esp_rainmaker/server_certs/rmaker_claim_service_server.crt
    managed_components/espressif__esp_rainmaker/server_certs/rmaker_ota_server.crt

However, with previously working code I now have a slew of runtime errors relating to gpio pins, it’s rather frustrating that all of this is so fragile :frowning:

It seems also there are now compatability errors between Arduino I2C internal library and the new espidf I2C driver.