Page 1 of 1

adding traceQUEUE_CREATE to freeRTOS

Posted: Fri Aug 13, 2021 2:10 pm
by mfawzy79
Hello,

I want to add trace function for the queue create "traceQUEUE_CREATE" without changing the IDF, Any idea?

Thanks,

Re: adding traceQUEUE_CREATE to freeRTOS

Posted: Fri Aug 13, 2021 10:58 pm
by Victoria Nope
As long as the FreeRTOS.h header will be included sooner than any of your own, you will need to either copy FreeRTOS component into your project, or modify that IDF header to define your own tracing macro.

It's been discussed e.g. in this thread.

Re: adding traceQUEUE_CREATE to freeRTOS

Posted: Sat Aug 14, 2021 7:32 pm
by mfawzy79
Thank you very much Victoria!, do you know where can I find an example which is demo using another copy of the freeRTOS?

Re: adding traceQUEUE_CREATE to freeRTOS

Posted: Sat Aug 14, 2021 10:02 pm
by Victoria Nope
I cannot link you one. But the process can be (and it is by default, or when you know what have you changed in the build system configuration) as easy as copying <esp-idf>\components\freertos component directory e.g. into your project's <your-project>\components\freertos directory (directory name matters, but can be structured in subdirectories) and modifying headers there.

Build system will pick the component which finds as last during the component search process which is well described in the build system manual, section Multiple components with the same name (emphasized by me):
Multiple components with the same name

When ESP-IDF is collecting all the components to compile, it will do this in the order specified by COMPONENT_DIRS; by default, this means ESP-IDF’s internal components first (IDF_PATH/components), then any components in directories specified in EXTRA_COMPONENT_DIRS, and finally the project’s components (PROJECT_DIR/components). If two or more of these directories contain component sub-directories with the same name, the component in the last place searched is used. This allows, for example, overriding ESP-IDF components with a modified version by copying that component from the ESP-IDF components directory to the project components directory and then modifying it there. If used in this way, the ESP-IDF directory itself can remain untouched.