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.

CC3200 LPDS模式无法退出



Hi all

我写了一个小应用程序, 使用到的资源大致如下

GPIO使用了pin64作为led, pin04作为按键, pin59作为AD引脚.

建立了4个线程, 栈都是1024. 使用了timer Framework 里面的高精度timer和RTC.

遇到的问题如下:

配置系统在vApplicationIdleHook调用cc_idle_task_pm(), 之前设置好了进入lp3p0_setup_power_policy(POWER_POLICY_STANDBY) 进入LPDS.

有关RTC唤醒的配置如下

static void TimerTask(void *pvParameters)
{
    int ret;
    unsigned char sig = 0;

    while (1) {
        osi_MsgQRead(&g_timer_signal_queue, &sig, OSI_WAIT_FOREVER);
        BatterySample();
        if (device_status_get(DEVICE_STATUS_NET_ONLINE) &&
            device_status_get(DEVICE_STATUS_NET_SOCK_OPEN)) {
            ret = net_send_heartbeat();
            if (ret < 0)
                ERR_PRINT(ret);
        }
    }
}

static void rtc_timer_cb(void *vParam)
{
    unsigned char timer_sig = 1;
    osi_MsgQWrite(&g_timer_signal_queue, &timer_sig, OSI_NO_WAIT);
}
static int rtc_timer_set(void)
{
    struct cc_timer_cfg sRealTimeTimer;
    struct u64_time sInitTime;
    int iRetVal;

    sInitTime.secs = 0;
    sInitTime.nsec = 0;
    cc_rtc_set(&sInitTime);

    sRealTimeTimer.source = HW_REALTIME_CLK;
    sRealTimeTimer.timeout_cb = rtc_timer_cb;
    sRealTimeTimer.cb_param = NULL;
    g_rtc_hndl = cc_timer_create(&sRealTimeTimer);

    iRetVal = osi_MsgQCreate(&g_timer_signal_queue, NULL, sizeof(unsigned char), TIMER_SIGNAL_QUEUE_LEN);
    if (iRetVal < 0) {
        UART_PRINT("unable to create timer signal queue\n\r");
        return iRetVal;
    }
    iRetVal = osi_TaskCreate(TimerTask,
                (const signed char *)"Timer Task",
                OSI_STACK_SIZE, NULL, 2, NULL );
    if (iRetVal < 0) {
        UART_PRINT("unable to create timer task\n\r");
        return iRetVal;
    }

    return 0;
}
static int rtc_timer_start(void)
{
    struct u64_time sIntervalTimer;

    sIntervalTimer.secs = NET_HEARTBEAT_INTERVAL_S;
    sIntervalTimer.nsec = 0;
    cc_timer_start(g_rtc_hndl, &sIntervalTimer, OPT_TIMER_PERIODIC);
    return 0;
}

大致是参照idle_profile例程做的. 这样子系统可以顺利从LPDS唤醒.

但是当我想加入按键作为LPDS作为唤醒中断, 配置如下

static void set_gpio_as_wakeup_pin()
{
    cc_hndl tGPIOHndl;

    tGPIOHndl = cc_gpio_open(BUT_GPIO, GPIO_DIR_INPUT);
    cc_gpio_enable_notification(tGPIOHndl, BUT_GPIO, (enum gpio_int_type)BUT_ACTIVE_EDGE,
                                (GPIO_TYPE_NORMAL | GPIO_TYPE_WAKE_SOURCE));
}

配置后, 系统就无法从LPDS唤醒了, RTC也唤醒不了了. 

请问这个可能的原因是什么? 是否有建议我从哪里排查问题呢?