开发板运行一段时间后死机,如何定位死机原因?
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.
硬件:官方开发板LAUNCHXL-CC26X2R1
工程:multi_role_CC26X2R1_LAUNCHXL_tirtos7_ticlang
修改项:
一、修改角色为Observer,在case GAP_DEVICE_INIT_DONE_EVENT事件完成后打开 GapScan_enable(0, 0, 30);持续扫描,并在MR_EVT_ADV_REPORT事件中打印扫描到的MAC和RSSI,运行3分钟后出现卡住,类似死机现象。(去掉扫描结果打印后,在定时器(3S)中加打印字符串,但是在后续挂机中定时器中打印也出现死机现象只不过运行90分钟才出现。,怀疑是UART打印速率过高导致死机?)
二、去除了官方打印和界面,自己添加打印,修改代码如下,Printf为向外部task调用打印接口(单Task调用)
创建一个Uart任务
Uart初始化
任务实体
给外部提供的打印接口
如图高亮部分,buf为Static时不死机,去掉static时死机,当为局部buf时减小size为32时也不会死机,是不是芯片堆栈管理的问题?
case MR_EVT_ADV_REPORT:
{
GapScan_Evt_AdvRpt_t* pAdvRpt = (GapScan_Evt_AdvRpt_t*) (pMsg->pData);
static int8_t buf[128] = {0};
memset(buf, 0, sizeof(buf));
snprintf(buf, sizeof(buf), "MAC: %s, RSSI: %d\r\n", Util_convertBdAddr2Str(pAdvRpt->addr), pAdvRpt->rssi);
DoPrint(gPrintHand, "Discovered: %s", buf);
if (pAdvRpt->pData != NULL)
{
ICall_free(pAdvRpt->pData);
}
break;
}