Part Number:CC2640R2L
CC2640R2L调用SysCtrlSystemReset()或者HAL_SYSTEM_RESET()均出现死机无法复位重启,请问哪个api是可以实现复位重启的?
Kevin Qiu1:
复位的API就是你上面所列的两个
说明更详细的信息以便更好地做出判断,包括SDK版本以及代码片段和其他描述
,
song xiaoxia:
CC2640R2L芯片使用SDK版本:simplelink_cc2640r2_sdk_5_10_00_02在project_zero.c中使用上述的API:SysCtrlSystemReset()或者HAL_SYSTEM_RESET()均出现死机不重启现象。
,
Kevin Qiu1:
具体在哪里使用的,附上相关代码
单步运行看卡在哪一步
,
song xiaoxia:
static void buttonDebounceSwiFxn(UArg buttonId)
{ // Used to send message to app button_state_t buttonMsg = { .pinId = buttonId }; uint8_t sendMsg = FALSE; // Get current value of the button pin after the clock timeout uint8_t buttonPinVal = PIN_getInputValue(buttonId);
Log_info1("Button == %s", (IArg)((buttonId == Board_BUTTON0)?"Button 0":"Button 1")); // Set interrupt direction to opposite of debounced state // If button is now released (button is active low, so release is high) if (buttonPinVal) { // Enable negative edge interrupts to wait for press PIN_setConfig(buttonPinHandle, PIN_BM_IRQ, buttonId | PIN_IRQ_NEGEDGE); } else { // Enable positive edge interrupts to wait for relesae PIN_setConfig(buttonPinHandle, PIN_BM_IRQ, buttonId | PIN_IRQ_POSEDGE); }
switch(buttonId) { case Board_BUTTON0: // If button is now released (buttonPinVal is active low, so release is 1) // and button state was pressed (buttonstate is active high so press is 1) if (buttonPinVal && button0State) //released { // Button was released Log_info0("released~~~~~"); buttonMsg.state = button0State = 0; sendMsg = TRUE; } else if (!buttonPinVal && !button0State) //pressed { // Button was pressed Log_info0("pressed~~~~~"); buttonMsg.state = button0State = 1; sendMsg = TRUE; } else { // Button was pressed buttonMsg.state = button0State = 0; sendMsg = TRUE; Log_info0("Board_BUTTON0 pressed~~~~~"); } break;
case Board_BUTTON1: // If button is now released (buttonPinVal is active low, so release is 1) // and button state was pressed (buttonstate is active high so press is 1) if (buttonPinVal) { // Button was released buttonMsg.state = 0; sendMsg = TRUE; } else { // Button was pressed buttonMsg.state = 1; sendMsg = TRUE; //SysCtrlSystemReset(); HAL_SYSTEM_RESET(); } break; }
if (sendMsg == TRUE) { user_enqueueRawAppMsg(APP_MSG_BUTTON_DEBOUNCED, (uint8_t *)&buttonMsg, sizeof(buttonMsg)); }}
,
song xiaoxia:
以下是代码部分,就是运行到SysCtrlSystemReset()或者HAL_SYSTEM_RESET()就会出现死机停止运行了
,
Kevin Qiu1:
这可能与JTAG Halt In Boot有关
song xiaoxia 说://SysCtrlSystemReset(); HAL_SYSTEM_RESET();
你在这句之后加上点亮LED的语句,用flash programmer2下载完拔掉cJTAG相关的跳帽或者使用外部供电
然后看一下LED状态会不会发生变化