FreeRTOS Heap Usage in MCUXpresso V11.2 works correctly, but for the same project in MCUXpresso V11.5, I get this message:
Could not load data for "Heap Usage" view probably due to missing heap related variable (try to define heap variables as "volatile" so they are not optimized out) or due to incorrect heap type identification (detected heap #1).
Make sure you have correctly defined "configFRTOS_MEMORY_SCHEME" macro in FreeRTOSConfig.h. TAD determines heap type either from MCUXPRESSO IDE's "FreeRTOSDEBUGConfig" structure (which uses "configFRTOS_MEMORY_SCHEME" define) or user defined variable "static const uint8_t freeRTOSMemoryScheme = <heap_type_used>;".
I have upgraded the IDE to get less bugs!
Solved! Go to Solution.
Well, it seems that the linker excludes the initialization of FreeRTOSDebugConfig[] from the final binary code since it cannot find any reference to this array in the project; as a work around we can use a linker option to force gcc to include the debug configuration data in the binary, regardless.
Specifically in MCUXpresso V11.5, we can go to the project properties >> C/C++ build >> Settings >> Tool Settings >> MCU Linker >> Miscellaneous and then add the following option for the linker:
--undefined=FreeRTOSDebugConfig
For more info see this
Not sure why this was not a problem in previous versions!
Thanks
Well, it seems that the linker excludes the initialization of FreeRTOSDebugConfig[] from the final binary code since it cannot find any reference to this array in the project; as a work around we can use a linker option to force gcc to include the debug configuration data in the binary, regardless.
Specifically in MCUXpresso V11.5, we can go to the project properties >> C/C++ build >> Settings >> Tool Settings >> MCU Linker >> Miscellaneous and then add the following option for the linker:
--undefined=FreeRTOSDebugConfig
For more info see this
Not sure why this was not a problem in previous versions!
Thanks
Yes, this is what I use:
On a side note: I'm using the McuLib FreeRTOS port, but that should not matter?
Thanks
I do use heap #4 a lot, and don't see any problems on my side:
Could you check if that FreeRTOSConfig data structure had been linked with your application and is present?
I hope this helps,
Erich
In my side, the debug info is not what it should be. e.g. FreeRTOSDebugConfig[5] which represent the heap type is always 1 not 4!
Is your screenshot from V11.5 ?
Thanks
What heap version are you using?
I was a aware that a previous (11.3?) had an issue with some heap types, but that got fixed (at least it was for me)?
Would be good if you could post more details to reproduce?
I hope this helps,
Erich
I use heap_4:
#define configFRTOS_MEMORY_SCHEME (4)
Thanks
I had another (maybe stupid) reason why Heap Usage view was not working.
The following line must be added in FreeRTOSConfig.h:
#define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H 1
Hi @SpoonMan ,
that makro alone does not help. What you need to have present in your application is a special structure with information for the debugger as in https://github.com/ErichStyger/McuOnEclipseLibrary/blob/master/lib/FreeRTOS/Source/include/freertos_...
Erich
Hi @ErichStyger
that macro alone doesn't help, but without that macro other suggestions alone does not help too...
If nobody is defining and setting configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H macro, then tasks.c is not including task C additions header... then nobody else is including such structure you're mentioning.
This is what I was pointing out, maybe my "I had another (maybe stupid) reason" wasn't clear?
All code changes are already described in the FreeRTOS UG - see ch. 2.2.
Regards,
MCUXpresso IDE Support
Right. Thanks for make it clear.