I’m using FreeRTOS with two 3rd party libraries: One from Tracealyzer, and one from Memfault. Both libraries define the same Trace Hook Macros used for heap monitoring: “traceTASK_CREATE”, “traceTASK_DELETE”, “traceFREE”, and “traceMALLOC”. I would like FreeRTOS to call the macros from both libraries sequentially, but would ideally not want to modify any of the Tracealyzer, Memfault, or FreeRTOS libraries.
Is this possible? If not, are there solutions that keep the changes minimal and maintainable as the libraries are updated?
I’m using FreeRTOS “tskKERNEL_VERSION_NUMBER” “V10.5.0”.
The libraries can’t directly insert the macros into FreeRTOS, as those are normally added in with your FreeRTOSConfig.h file. If they have you add an include file to their source of them into that, you can look at the definitions of the two macros, and build a single macro that does the contents of both of them.
Thus, the only thing you need to modify, is your own FreeRTOSconfig.h file
Yes, that should work. Make sure to put the new macro definitions after #include “trcRecorder.h” in your FreeRTOSConfig.h, otherwise it will override them.
You may need to add #undef:s as well before redefining the trace macros, to avoid warnings.