espressif / esp-hosted

Hosted Solution (Linux/MCU) with ESP32 (Wi-Fi + BT + BLE)
Other
706 stars 169 forks source link

esp_reset esp_EN is low #304

Open hustzju opened 11 months ago

hustzju commented 11 months ago

Hi, I have a question, at host side, after exec esp_reset function, the ESP_EN is LOW, so esp32 is powered off, why?

I don't understand why the code is just like this:

        /* HOST's resetpin set to OUTPUT, HIGH */
        gpio_direction_output(resetpin, true);

        /* HOST's resetpin set to LOW */
        gpio_set_value(resetpin, 0);
        udelay(200);

        /* HOST's resetpin set to INPUT */
        gpio_direction_input(resetpin);

        esp_dbg("Triggering ESP reset.\n");
mantriyogesh commented 11 months ago

High-> delay-> low-> delay->high should also have same effect

hustzju commented 11 months ago

I have followed your suggestion,High-> delay-> low-> delay->high. ESP32 is enabled , but have not got any event,the espsta0 doesn't appear.

host side log : [50226.809747] esp32_spi:esp_reset: Triggering ESP reset. [50227.046728] esp32_spi:spi_dev_init: ESP32 peripheral is registered to SPI bus [0],chip select [0], SPI Clock [10]

ESP32 side log: ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0030,len:7096 load:0x40078000,len:15584 load:0x40080400,len:4 ho 8 tail 4 room 4 load:0x40080404,len:3876 entry 0x4008064c I (31) boot: ESP-IDF v5.1.1-1-gd3c99ed-dirty 2nd stage bootloader I (31) boot: compile time Dec 15 2023 16:58:37 I (33) boot: Multicore bootloader I (37) boot: chip revision: v1.0 I (41) boot.esp32: SPI Speed : 40MHz I (45) boot.esp32: SPI Mode : DIO I (50) boot.esp32: SPI Flash Size : 4MB I (54) boot: Enabling RNG early entropy source... I (60) boot: Partition Table: I (63) boot: ## Label Usage Type ST Offset Length I (71) boot: 0 nvs WiFi data 01 02 00009000 00004000 I (78) boot: 1 otadata OTA data 01 00 0000d000 00002000 I (85) boot: 2 phy_init RF data 01 01 0000f000 00001000 I (93) boot: 3 factory factory app 00 00 00010000 00100000 I (100) boot: 4 ota_0 OTA app 00 10 00110000 00100000 I (108) boot: 5 ota_1 OTA app 00 11 00210000 00100000 I (116) boot: End of partition table I (120) boot: Defaulting to factory image I (124) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=20860h (133216) map I (181) esp_image: segment 1: paddr=00030888 vaddr=3ffbdb60 size=05430h ( 21552) load I (190) esp_image: segment 2: paddr=00035cc0 vaddr=40080000 size=0a358h ( 41816) load I (207) esp_image: segment 3: paddr=00040020 vaddr=400d0020 size=8c878h (575608) map I (415) esp_image: segment 4: paddr=000cc8a0 vaddr=4008a358 size=14cc0h ( 85184) load I (467) boot: Loaded app from partition at offset 0x10000 I (467) boot: Disabling RNG early entropy source... I (478) cpu_start: Multicore app I (479) cpu_start: Pro cpu up. I (479) cpu_start: Starting app cpu, entry point is 0x40081448 I (0) cpu_start: App cpu up. I (497) cpu_start: Pro cpu start user code I (497) cpu_start: cpu freq: 240000000 Hz I (497) cpu_start: Application information: I (501) cpu_start: Project name: network_adapter I (507) cpu_start: App version: release/ng-v1.0.2-134-gce3c50a- I (514) cpu_start: Compile time: Dec 15 2023 16:58:28 I (520) cpu_start: ELF file SHA256: b1d8f6e4525c260a... I (526) cpu_start: ESP-IDF: v5.1.1-1-gd3c99ed-dirty I (532) cpu_start: Min chip rev: v0.0 I (537) cpu_start: Max chip rev: v3.99  I (542) cpu_start: Chip rev: v1.0 I (547) heap_init: Initializing. RAM available for dynamic allocation: I (554) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM I (560) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM I (566) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM I (572) heap_init: At 3FFC72D0 len 00018D30 (99 KiB): DRAM I (578) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM I (585) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM I (591) heap_init: At 4009F018 len 00000FE8 (3 KiB): IRAM I (599) spi_flash: detected chip: generic I (602) spi_flash: flash io: dio I (607) coexist: coex firmware version: 80b0d89 I (612) app_start: Starting scheduler on CPU0 [0;32I (616) app_start: Starting scheduler on CPU1 mI (616) main_task: Started on CPU0 I (624) main_task: Calling app_main() I (626) stats:  I (632) stats: ESP-Hosted Firmware version :: 1.0.2  I (640) stats: Transport used :: SPI only  I (646) stats:  I (652) FW_MAIN: Supported features are: I (656) FW_MAIN: - WLAN over SPI I (660) FW_BT: - BT/BLE I (662) FW_BT: - HCI Over SPI I (666) FW_BT: - BT/BLE dual mode I (668) FW_MAIN: Capabilities: 0xf8 I (682) wifi:wifi driver task: 3ffbd5f0, prio:23, stack:6656, core=1 I (684) wifi:wifi firmware version: fddc5e5 I (684) wifi:wifi certification version: v7.0 I (686) wifi:config NVS flash: disabled I (688) wifi:config nano formating: disabled I (692) wifi:Init data frame dynamic rx buffer num: 32 I (696) wifi:Init management frame dynamic rx buffer num: 32 I (700) wifi:Init management short buffer num: 32 I (702) wifi:Init dynamic tx buffer num: 64 I (706) wifi:Init static rx buffer size: 1600 I (710) wifi:Init static rx buffer num: 16 I (712) wifi:Init dynamic rx buffer num: 32 I (716) wifi_init: rx ba win: 6 I (718) wifi_init: tcpip mbox: 32 I (722) wifi_init: udp mbox: 6 I (724) wifi_init: tcp mbox: 6 I (728) wifi_init: tcp tx win: 5744 I (730) wifi_init: tcp rx win: 5744 I (734) wifi_init: tcp mss: 1440 I (738) wifi_init: WiFi IRAM OP enabled I (742) wifi_init: WiFi RX IRAM OP enabled I (746) BTDM_INIT: BT controller compile version [946b762] I (750) BTDM_INIT: Bluetooth MAC: 84:cc:a8:63:13:1a I (756) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07 I (1074) FW_MAIN: ESP Bluetooth MAC addr: 84-cc-a8-63-13-1a  I (1076) FW_SPI: Using SPI interface I (1076) gpio: GPIO[2]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0  I (1082) gpio: GPIO[4]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0  I (2092) FW_MAIN: Initial set up done I (2092) main_task: Returned from app_main()

Could you give me some advice?

mantriyogesh commented 10 months ago

@kapilkedawat