Can I get Heap Info in MQX?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Can I get Heap Info in MQX?

ソリューションへジャンプ
1,593件の閲覧回数
kalaiyarasansel
Contributor II

Hi,

I am using MQX for my project, Where i want to check the heap usage priority.  I know that we have function "_mem_get_highwater"  which will give highest allocated memory but  I need the percentage of memory used in the heap.

I need to start address and size of the heap(default memory pool). 

Please update me if any,

Thanks,

Kalaiyarasan.

タグ(1)
0 件の賞賛
返信
1 解決策
1,221件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

Hi KALAIYARASAN

Unfortunately MQX does not implement a tool that calculate the amount of heap available .

The heap is defined inside the kernel memory area.

START_OF_KERNEL_AREA, END_OF_KERNEL_ARREA: an area with restricted access for user-mode tasks. It covers the KERNEL_DATA structure, default memory heap and other privileged MQX RTOS structures and data, including the kernel-owned globals.

These values are defined in the linker files as starting after all the other RAM variables, and going to end_of_kd (which is the address at the end of RAM). So the size and starting address depends on the application. The source files pick this up in

C:\Freescale\Freescale_MQX_4_2\mqx\source\bsp\<board_name>\<board_name>.h with

 

#define BSP_DEFAULT_START_OF_KERNEL_MEMORY                    ((void *)__KERNEL_DATA_START)

#define BSP_DEFAULT_END_OF_KERNEL_MEMORY                      ((void *)__KERNEL_DATA_END)

If you look up the map file that gets generated and search for KERNEL_DATA_START you will find where it starts explicitly.


Have a great day,
Daniel

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,222件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

Hi KALAIYARASAN

Unfortunately MQX does not implement a tool that calculate the amount of heap available .

The heap is defined inside the kernel memory area.

START_OF_KERNEL_AREA, END_OF_KERNEL_ARREA: an area with restricted access for user-mode tasks. It covers the KERNEL_DATA structure, default memory heap and other privileged MQX RTOS structures and data, including the kernel-owned globals.

These values are defined in the linker files as starting after all the other RAM variables, and going to end_of_kd (which is the address at the end of RAM). So the size and starting address depends on the application. The source files pick this up in

C:\Freescale\Freescale_MQX_4_2\mqx\source\bsp\<board_name>\<board_name>.h with

 

#define BSP_DEFAULT_START_OF_KERNEL_MEMORY                    ((void *)__KERNEL_DATA_START)

#define BSP_DEFAULT_END_OF_KERNEL_MEMORY                      ((void *)__KERNEL_DATA_END)

If you look up the map file that gets generated and search for KERNEL_DATA_START you will find where it starts explicitly.


Have a great day,
Daniel

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信
1,221件の閲覧回数
kalaiyarasansel
Contributor II

Hi Daniel,

Thanks for the answer,

0 件の賞賛
返信