CC2640R2L调用SysCtrlSystemReset()或者HAL_SYSTEM_RESET()均出现死机无法复位重启,请问哪个api是可以实现复位重启的?
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.
CC2640R2L调用SysCtrlSystemReset()或者HAL_SYSTEM_RESET()均出现死机无法复位重启,请问哪个api是可以实现复位重启的?
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));
}
}
这可能与JTAG Halt In Boot有关
//SysCtrlSystemReset();
HAL_SYSTEM_RESET();
你在这句之后加上点亮LED的语句,用flash programmer2下载完拔掉cJTAG相关的跳帽或者使用外部供电
然后看一下LED状态会不会发生变化