MCUXpresso V11.5 FreeRTOS Heap Usage not working any more

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

MCUXpresso V11.5 FreeRTOS Heap Usage not working any more

跳至解决方案
4,149 次查看
ali2
Contributor II

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!

0 项奖励
回复
1 解答
4,040 次查看
ali2
Contributor II

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

在原帖中查看解决方案

12 回复数
4,041 次查看
ali2
Contributor II

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

4,102 次查看
ErichStyger
Specialist I

Yes, this is what I use:

ErichStyger_0-1645641307963.png

On a side note: I'm using the McuLib FreeRTOS port, but that should not matter?

0 项奖励
回复
4,101 次查看
ali2
Contributor II

Thanks

0 项奖励
回复
4,112 次查看
ErichStyger
Specialist I

I do use heap #4 a lot, and don't see any problems on my side:

ErichStyger_0-1645637840699.png

Could you check if that FreeRTOSConfig data structure had been linked with your application and is present?

ErichStyger_1-1645638385783.png

 

I hope this helps,

Erich

0 项奖励
回复
4,106 次查看
ali2
Contributor II

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

0 项奖励
回复
4,128 次查看
ErichStyger
Specialist I

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

0 项奖励
回复
4,119 次查看
ali2
Contributor II

I use heap_4:

#define configFRTOS_MEMORY_SCHEME  (4)

Thanks

0 项奖励
回复
3,173 次查看
SpoonMan
Contributor IV

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

3,149 次查看
ErichStyger
Specialist I

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

0 项奖励
回复
3,123 次查看
SpoonMan
Contributor IV

Hi @ErichStyger 

that macro alone doesn't help, but without that macro other suggestions alone does not help too...

SpoonMan_0-1676881236025.png

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?

 

0 项奖励
回复
3,087 次查看
lpcxpresso_supp
NXP Employee
NXP Employee

All code changes are already described in the FreeRTOS UG - see ch. 2.2.

Regards,
MCUXpresso IDE Support

0 项奖励
回复
3,118 次查看
ErichStyger
Specialist I

Right. Thanks for make it clear.

0 项奖励
回复