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.

退网时堆栈溢出

 osal_memset((uint8 *)&leaveReq,0,sizeof(NLME_LeaveReq_t));

      osal_memcpy(leaveReq.extAddr,NLME_GetExtAddr(),Z_EXTADDR_LEN);

        leaveReq.removeChildren =0;
        
        leaveReq.rejoin =1;
      
        leaveReq.silent = 0;
        
        NLME_LeaveReq( &leaveReq );

加上红色部分就会堆栈溢出,不加就不会。不过在函数SampleApp_Init( uint8 task_id )中我使用了这个函数,也没有堆栈溢出。

而现在的表现情况就是使用这个函数后有时不能入网有时可以入网。该函数在终端中使用。我怀疑是不是在退网程序中我没有加该函数的原因。不过如果加了由于发生了堆栈溢出就会出现很多奇怪的问题。