问题1:在唤醒后,Pipe报了这个错误:W (53056) USB_HCDC: line 1030 Pipe: bulk_out HCD_PIPE_EVENT_ERROR_XFER。之后再进行联网,一直连接不上。
问题2:在进入休眠时,需要对USB进行什么操作吗?
代码:
Code: Select all
#ifdef CONFIG_DUMP_SYSTEM_STATUS
/* Configure the button GPIO as input, enable wakeup */
const int button_gpio_num = 0;
const int button_enter_low_power_gpio_num = 41;
const int wakeup_level = 0;
gpio_config_t config = {
.pin_bit_mask = BIT64(button_gpio_num)|BIT64(button_enter_low_power_gpio_num),
.mode = GPIO_MODE_INPUT
};
ESP_ERROR_CHECK(gpio_config(&config));
gpio_wakeup_enable(button_gpio_num, wakeup_level == 0 ? GPIO_INTR_LOW_LEVEL : GPIO_INTR_HIGH_LEVEL);
while (1) {
//_system_dump();
esp_sleep_enable_gpio_wakeup();
if(gpio_get_level(button_enter_low_power_gpio_num) == 1){
ESP_LOGI(TAG, "Waiting for GPIO%d to go high...", button_enter_low_power_gpio_num);
do{
vTaskDelay(pdMS_TO_TICKS(10));
}while(gpio_get_level(button_enter_low_power_gpio_num) == 1);
}
ESP_LOGW(TAG, "Entering light sleep");
esp_wifi_stop();
/* To make sure the complete line is printed before entering sleep mode,
* need to wait until UART TX FIFO is empty:
*/
uart_wait_tx_idle_polling(CONFIG_ESP_CONSOLE_UART_NUM);
/* Enter sleep mode */
esp_light_sleep_start();
/* Determine wake up reason */
const char* wakeup_reason;
switch (esp_sleep_get_wakeup_cause()) {
case ESP_SLEEP_WAKEUP_TIMER:
wakeup_reason = "timer";
break;
case ESP_SLEEP_WAKEUP_GPIO:
wakeup_reason = "pin";
break;
default:
wakeup_reason = "other";
break;
}
esp_wifi_start();
ESP_LOGI(TAG, "Returned from light sleep, reason: %s", wakeup_reason);
}
#endif
Code: Select all
I (11715) modem_wifi: softap ssid: esp_4g_router password: 12345678
I (11722) modem_wifi: NAT is enabled
I (11726) gpio: GPIO[0]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (11735) gpio: GPIO[41]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (11745) main: Waiting for GPIO41 to go high...
W (16660) main: Entering light sleep
W (16660) wifi:age timer already deinit
W (16660) modem_wifi: ESP WIFI STOP
I (16661) wifi:flush txq
I (16663) wifi:stop sw txq
I (16665) wifi:lmac stop hw txq
Code: Select all
[color=#FFFF80]W (17684) USB_HCDC: line 1030 Pipe: bulk_out HCD_PIPE_EVENT_ERROR_XFER[/color]
I (24190) wifi:mode : softAP (7c:df:a1:4f:29:79)
I (24192) wifi:Total power save buffer number: 16
W (24196) modem_wifi: ESP WIFI START
I (24199) main: Returned from light sleep, reason: pin
I (24205) main: Waiting for GPIO41 to go high...