esp32-s3进入深度睡眠后快速重启
Posted: Tue Nov 15, 2022 6:49 am
基本信息
芯片: esp32-s3r2
esp-idf版本: release/v4.4 commit-id: 76caa64286b0e93207ad06f68830a223be49cc88
外接32MB flash
现象:
长按关机后,芯片立即重启,重启原因USB_UART_CHIP_RESET
相关日志:
相关代码:
芯片: esp32-s3r2
esp-idf版本: release/v4.4 commit-id: 76caa64286b0e93207ad06f68830a223be49cc88
外接32MB flash
现象:
长按关机后,芯片立即重启,重启原因USB_UART_CHIP_RESET
相关日志:
- I (31484) app-button: button long press
- read failed: [Errno 6] Device not configured
- Waiting for the device to reconnect
- ESP-ROM:esp32s3-20210327
- Build:Mar 27 2021
- rst:0x15 (USB_UART_CHIP_RESET),boot:0x29 (SPI_FAST_FLASH_BOOT)
- Saved PC:0x4201b2ba
- 0x4201b2ba: esp_pm_impl_waiti at /Users/robbietree/IdeaProjects/git/github/esp-idf/components/esp_pm/pm_impl.c:839
- SPIWP:0xee
- mode:DIO, clock div:1
- load:0x3fce3808,len:0x1674
- load:0x403c9700,len:0xbb8
- load:0x403cc700,len:0x2f10
- entry 0x403c9954
- I (24) boot: ESP-IDF v4.4.3-145-g76caa64286-dirty 2nd stage bootloader
- I (25) boot: compile time 17:11:41
- I (25) boot: chip revision: 0
- I (28) boot.esp32s3: Boot SPI Speed : 80MHz
- I (33) boot.esp32s3: SPI Mode : DIO
- I (38) boot.esp32s3: SPI Flash Size : 32MB
- I (42) boot: Enabling RNG early entropy source...
- I (48) boot: Partition Table:
- I (51) boot: ## Label Usage Type ST Offset Length
- I (59) boot: 0 nvs WiFi data 01 02 00009000 00004000
- I (66) boot: 1 phy_init RF data 01 01 0000d000 00001000
- I (74) boot: 2 factory factory app 00 00 00010000 00300000
- I (81) boot: 3 storage Unknown data 01 82 00320000 00100000
- I (89) boot: End of partition table
- I (93) esp_image: segment 0: paddr=00010020 vaddr=3c020020 size=09e20h ( 40480) map
- I (108) esp_image: segment 1: paddr=00019e48 vaddr=3fc93ab0 size=02b8ch ( 11148) load
- I (112) esp_image: segment 2: paddr=0001c9dc vaddr=40374000 size=0363ch ( 13884) load
- I (121) esp_image: segment 3: paddr=00020020 vaddr=42000020 size=1c2e8h (115432) map
- I (147) esp_image: segment 4: paddr=0003c310 vaddr=4037763c size=0c474h ( 50292) load
- I (159) esp_image: segment 5: paddr=0004878c vaddr=600fe000 size=0002ch ( 44) load
- I (165) boot: Loaded app from partition at offset 0x10000
- I (166) boot: Disabling RNG early entropy source...
- I (179) spiram: Found 16MBit SPI RAM device
- I (179) spiram: SPI RAM mode: sram 40m
- I (179) spiram: PSRAM initialized, cache is in normal (1-core) mode.
- I (184) cpu_start: Pro cpu up.
- I (188) cpu_start: Starting app cpu, entry point is 0x403753fc
- 0x403753fc: call_start_cpu1 at /Users/git/github/esp-idf/components/esp_system/port/cpu_start.c:148
- I (0) cpu_start: App cpu up.
- I (613) spiram: SPI SRAM memory test OK
- I (622) cpu_start: Pro cpu start user code
- I (622) cpu_start: cpu freq: 160000000
- I (622) cpu_start: Application information:
- I (625) cpu_start: Project name: fusion_glasses_medical
- I (631) cpu_start: App version: 261c361-dirty
- I (637) cpu_start: Compile time: Nov 15 2022 14:21:44
- I (643) cpu_start: ELF file SHA256: 44162d5beda2077b...
- I (649) cpu_start: ESP-IDF: v4.4.3-145-g76caa64286-dirty
- I (655) heap_init: Initializing. RAM available for dynamic allocation:
- I (663) heap_init: At 3FC972A0 len 00052470 (329 KiB): D/IRAM
- I (669) heap_init: At 3FCE9710 len 00005724 (21 KiB): STACK/DRAM
- I (676) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
- I (682) heap_init: At 600FE02C len 00001FD4 (7 KiB): RTCRAM
- I (688) spiram: Adding pool of 2048K of external SPI memory to heap allocator
- I (697) spi_flash: detected chip: gd
- I (700) spi_flash: flash io: dio
- I (705) sleep: Configure to isolate all GPIO pins in sleep state
- I (711) sleep: Enable automatic switching of GPIO sleep configuration
- I (718) coexist: coexist rom version e7ae62f
- I (723) cpu_start: Starting scheduler on PRO CPU.
- I (0) cpu_start: Starting scheduler on APP CPU.
- I (734) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations
- I (744) app-deep-sleep: init deep sleep on pin 5
- wakeup cause: 0
- Not a deep sleep reset
- #define FEATURE_TOGGLE_PIN 5
- static void button_long_press_hold_cb(void *arg1, void *arg2)
- {
- ESP_LOGI(TAG, "button long press");
- enter_deep_sleep();
- }
- static void setup_gpio_button()
- {
- ESP_LOGI(TAG, "gpio button init on pin %d", FEATURE_TOGGLE_PIN);
- button_config_t cfg = {
- .type = BUTTON_TYPE_GPIO,
- .gpio_button_config = {
- .gpio_num = FEATURE_TOGGLE_PIN,
- .active_level = 1,
- },
- };
- button_handle_t btn = iot_button_create(&cfg);
- iot_button_register_cb(btn, BUTTON_LONG_PRESS_START, button_long_press_hold_cb, "hold");
- }
- #define WAKEUP_PIN FEATURE_TOGGLE_PIN
- #define WAKEUP_LEVEL 1
- void init_deep_sleep(void)
- {
- ESP_LOGI(TAG, "init deep sleep on pin %d", WAKEUP_PIN);
- esp_sleep_enable_ext0_wakeup(WAKEUP_PIN, WAKEUP_LEVEL);
- printf("wakeup cause: %d\n", esp_sleep_get_wakeup_cause());
- switch (esp_sleep_get_wakeup_cause()) {
- case ESP_SLEEP_WAKEUP_EXT0: {
- printf("Wake up from ext0\n");
- break;
- }
- default: {
- printf("Not a deep sleep reset\n");
- }
- }
- }
- void enter_deep_sleep(void)
- {
- esp_deep_sleep_start();
- }