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: CC2640R2L是否有哪个api可以实现软件复位或者硬件复位重启的?

Part Number: CC2640R2L

CC2640R2L调用SysCtrlSystemReset()或者HAL_SYSTEM_RESET()均出现死机无法复位重启,请问哪个api是可以实现复位重启的?

  • 复位的API就是你上面所列的两个

    说明更详细的信息以便更好地做出判断,包括SDK版本以及代码片段和其他描述

  • CC2640R2L芯片使用SDK版本:simplelink_cc2640r2_sdk_5_10_00_02在project_zero.c中使用上述的API:SysCtrlSystemReset()或者HAL_SYSTEM_RESET()均出现死机不重启现象。

  • 具体在哪里使用的,附上相关代码

    单步运行看卡在哪一步

  • 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));
    }
    }

  • 以下是代码部分,就是运行到SysCtrlSystemReset()或者HAL_SYSTEM_RESET()就会出现死机停止运行了

  • 这可能与JTAG Halt In Boot有关

    //SysCtrlSystemReset();
    HAL_SYSTEM_RESET();

    你在这句之后加上点亮LED的语句,用flash programmer2下载完拔掉cJTAG相关的跳帽或者使用外部供电

    然后看一下LED状态会不会发生变化