cancel
Showing results for 
Search instead for 
Did you mean: 

How to get heap usage working on FreeRTOS Task Aware Debugger plugin?

luuk
Associate II

I am working on FreeRTOS based firmware on a STM32F103 MCU in STM32CubeIDE. I have the NXP Task Aware Debugger installed, which works fine on displaying the Task List info, but the Heap Usage display does not work. It does show the following error after attempting to load the data:

0693W000000TaXZQA0.png

In the TAD log file it shows this message:

"10:35:50.998 INFO: [Benchmark] Loading data for "Heap Usage" has started.

10:35:55.53 INFO: [HeapFactory] TAD will try to determine heap type (memory scheme) from available variables.

Please add "static const uint8_t freeRTOSMemoryScheme = <heap_type_used>;" (or use macro configFRTOS_MEMORY_SCHEME, if defined)

variable into your project for TAD to know which heap type is used.

10:35:55.53 INFO: [FreeRTOS] FreeRTOS macro "configFRTOS_MEMORY_SCHEME" is disabled.

10:35:55.53 INFO: [HeapFactory] Heap variable ucHeap is equal to "0x20000494".

10:35:56.63 INFO: [HeapFactory] Heap type (memory allocation scheme) has been identified from available heap variables as Heap type #1. "

I am using heap 4 and to I have tried adding the macro "#define configFRTOS_MEMORY_SCHEME 4" as well as the variable "static const uint8_t freeRTOSMemoryScheme = 4;" I have tried thsoe one by one and simultaneously. Whatever I try, the error message stay the same and apparently it keeps assuming heap 1 allocation scheme. This is driving me nuts.

I'm sure I'm overlooking something obvious. Can anyone help me out?

1 ACCEPTED SOLUTION

Accepted Solutions
luuk
Associate II

Of course, after searching for two days, giving up and asking the question here, I spend a few more minutes searching and found the answer. Turns out I needed to set the macro "#define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H    1" and add the file "freertos_tasks_c_additions.h" as described here: https://www.nxp.com/docs/en/quick-reference-guide/MCUXpresso_IDE_FreeRTOS_Debug_Guide.pdf

After doing so it works just fine!

View solution in original post

1 REPLY 1
luuk
Associate II

Of course, after searching for two days, giving up and asking the question here, I spend a few more minutes searching and found the answer. Turns out I needed to set the macro "#define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H    1" and add the file "freertos_tasks_c_additions.h" as described here: https://www.nxp.com/docs/en/quick-reference-guide/MCUXpresso_IDE_FreeRTOS_Debug_Guide.pdf

After doing so it works just fine!