Hello everyone,
I am working with the EC200U_EU_AA module and trying to enable Sleep Mode using the API provided in power_demo.c
. To achieve this, I am using the ql_autosleep_enable()
function.
I have ensured that:
- There are no active wakelocks.
- USB is disconnected.
- All other threads are disabled, and only the power-related thread is running.
Despite this, the module continuously enters the ql_enter_sleep_cb
interrupt and immediately exits via ql_exit_sleep_cb
. This process keeps repeating in a loop.
Questions:
- What could be causing the module to continuously wake up from Sleep Mode?
- Additionally, when I try to suspend another thread using
ql_rtos_task_suspend()
, the module resets.
- Is there any special consideration or requirement when suspending a task?
My Code:
Power Demo Thread
static void ql_power_demo_thread(void *param)
{
ql_event_t event;
int err;
// Register sleep callback function
ql_sleep_register_cb(ql_enter_sleep_cb);
// Register wakeup callback function
ql_wakeup_register_cb(ql_exit_sleep_cb);
#ifdef QL_APP_FEATURE_USB
// Register USB hotplug callback function
ql_usb_bind_hotplug_cb(usb_hotplug_cb);
#endif
while(1)
{
if(Enter_SLEEP_Mode == true)
{
Enter_SLEEP_Mode = false;
ql_uart_write(QL_UART_PORT_1, "autosleepex Enabled\r\n", 19);
ql_autosleep_enable(QL_ALLOW_SLEEP);
}
}
}
Sleep Mode Callback
void ql_enter_sleep_cb(void* ctx)
{
ql_uart_write(QL_UART_PORT_1, "Entered Sleep Mode\r\n", 20);
#ifdef QL_APP_FEATURE_GNSS
ql_pin_set_func(QL_PIN_NUM_KEYOUT_5, QL_FUN_NUM_UART_2_CTS);
ql_gpio_set_level(GPIO_12, LVL_HIGH);
ql_gpio_set_level(GPIO_11, LVL_LOW);
#endif
}
Wakeup Callback
void ql_exit_sleep_cb(void* ctx)
{
ql_uart_write(QL_UART_PORT_1, "exit sleep cb\r\n", 15);
#ifdef QL_APP_FEATURE_GNSS
ql_pin_set_func(QL_PIN_NUM_KEYOUT_5, QL_FUN_NUM_UART_3_TXD);
#endif
}
Any insights or suggestions would be greatly appreciated.
Thanks in advance for your help!