This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] TM4C1294NCPDT:RTOS:在运行期间检查堆层。

Guru**** 2616675 points

Other Parts Discussed in Thread: SYSBIOS

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1067245/tm4c1294ncpdt-rtos-checking-heap-level-over-time-during-the-run

部件号:TM4C1294NCPDT
“Thread:SysBIOS”中讨论的其它部件

基于设置

*:CCS 11.0或最新版本。
*:符合 TI x20.2.6.LTS 或最新版本。
*:XDCTools 3.32.2.25
*:Ti-RTOS for TiaC <tirtos_tivac_2_16_01_14>  
*:TiaWare_C_Series 2.1.71b  

我希望在运行时不时临时检查堆,然后将其删除。

我已经阅读 了关于 HeapTrack 和的 SPRUEX3P (第166页)  

文件://E:/010_WorkAOT/011MyGit20/106-TM4C_2021/tirtos_tivac_2_16_01_14/products/BIOS_6_45_02_31/docs/cdOC/ ti/SysBIOS/堆/HeapTrack.html  

我将代码放入 cfg 中

/* ================ Kernel (SYS/BIOS) configuration ================ */
var BIOS = xdc.useModule('ti.sysbios.BIOS');

//BIOS.assertsEnabled = true;
BIOS.assertsEnabled = false;

/*
* Specify default heap size for BIOS.
*/
//BIOS.heapSize = 5120; //ex 1024. 5120 for FATFS.
BIOS.heapSize = 10000; //Will it fix crashes?
BIOS.heapTrackEnabled = true; // RGP: 6Jan21: To debug Heap operation ,remove when not needed.

BIOS.includeXdcRuntime = false;
//BIOS.includeXdcRuntime = true;

//----------------------------------------------Heap Debug
#include <ti/sysbios/heaps/HeapTrack.h>         // to debug heaps. See SPRUEX3T, page 166.
#include <xdc/runtime/IHeap.h>
#include <xdc/runtime/Memory.h>
......

HeapTrack_Handle heap;
void RFD_Heap_Init(void)
{
    //-------------------------Heap Monitor
    HeapTrack_Params prms;
    //HeapTrack_Handle heap;
    Error_Block eb;
    
    Error_init(&eb);
    HeapTrack_Params_init(&prms);
    prms.heap = heapHandle;
    heap = HeapTrack_create(&prms, &eb);
    if (heap == NULL) {
    System_abort("HeapTrack create failed");
    }
}

我不确定“heapHandle”来自哪里?你能给出建议吗?

谢谢。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    你好,理查德,

    我对 TI-RTOS 中的此功能并不是很熟悉,但阅读文档时,似乎是在讨论将其与现有堆一起使用...因此,我认为  heapHandle 是如何将跟踪器与要跟踪的现有堆绑定在一起的。

    我还觉得该文档在示例中可能有一个排版,它应该是:

    HeapTrack_Params prms;
    HeapTrack_Handle heapHandle;
    Error_Block eb;
    
    Error_init(&eb);
    HeapTrack_Params_init(&prms);
    prms.heap = heapHandle;
    heap = HeapTrack_create(&prms, &eb);
    if (heap == NULL) {
     System_abort("HeapTrack create failed");
    }
    

    很抱歉,我没有更明确的答案,但如果答案不足以让您前进,我会尝试帮助您进一步集思广益。

    此致,

    拉尔夫·雅各比