AdamKGoddard / XiaomiIR_ESPHome

Custom ESPHome Firmware for the Xiaomi IR Controller
GNU General Public License v3.0
22 stars 7 forks source link

Getting the esp32 into Flashmode #6

Closed rapco closed 1 year ago

rapco commented 2 years ago

Hi,

I'm trying to flash my MI Universal Remote, but I am having problems getting into Flash Mode.

I currently wire everything into my USB Serial conv. I can "see" some dates displayed in a Putty Session. However I don't think I am doing the steps right to get it into Flash mode as with in ESPHOME shows a the error "Failed to initialize. Try resetting your device or holding the BOOT button while selecting your serial port until it starts preparing the installation."

In the instructions you provided you said:

Press and hold Reset whilst plugging in MicroUSB power. Flash the unit with the ESPHome Flasher software.

In the press and hold reset; how long should I keep it pressed?

Thank you.

rapco commented 2 years ago

` ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_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:0x3fff0018,len:4 load:0x3fff001c,len:5804 load:0x40078000,len:0 load:0x40078000,len:14296 entry 0x400791f0 I (28) boot: ESP-IDF v1.0-3169-g79af9a5-dirty 2nd stage bootloader I (29) boot: compile time 10:22:51 I (29) boot: Enabling RNG early entropy source... I (35) boot: SPI Flash RID : 0xB188E I (39) boot: SPI Flash MF : 0x8E I (43) boot: SPI Flash ID : 0x180B I (48) boot: SPI Speed : 40MHz I (52) boot: SPI Mode : DIO I (56) boot: SPI Flash Size : 4MB 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 (86) boot: 2 phy_init RF data 01 01 0000f000 00001000 I (93) boot: 3 miio_fw1 OTA app 00 10 00010000 00160000 I (101) boot: 4 miio_fw2 OTA app 00 11 00170000 00160000 I (108) boot: 5 test test app 00 20 002d0000 00013000 I (116) boot: 6 mimcu Unknown data 01 fd 002e3000 00100000 I (123) boot: 7 coredump Unknown data 01 03 003e3000 00010000 I (131) boot: 8 minvs Unknown data 01 fe 003f8000 00004000 I (138) boot: End of partition table I (143) boot: No factory image, trying OTA 0 I (148) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x24a78 (15 0136) map I (209) esp_image: segment 1: paddr=0x00034aa0 vaddr=0x3ffc0000 size=0x03840 ( 1 4400) load I (215) esp_image: segment 2: paddr=0x000382e8 vaddr=0x40080000 size=0x00400 ( 1024) load I (216) esp_image: segment 3: paddr=0x000386f0 vaddr=0x40080400 size=0x07920 ( 3 1008) load I (237) esp_image: segment 4: paddr=0x00040018 vaddr=0x400d0018 size=0xcdf78 (84 3640) map 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:0x3fff0018,len:4 load:0x3fff001c,len:5804 load:0x40078000,len:0 load:0x40078000,len:14296 entry 0x400791f0 I (28) boot: ESP-IDF v1.0-3169-g79af9a5-dirty 2nd stage bootloader I (28) boot: compile time 10:22:51 I (29) boot: Enabling RNG early entropy source... I (35) boot: SPI Flash RID : 0xB188E I (39) boot: SPI Flash MF : 0x8E I (43) boot: SPI Flash ID : 0x180B I (47) boot: SPI Speed : 40MHz I (51) boot: SPI Mode : DIO I (55) boot: SPI Flash Size : 4MB I (59) boot: Partition Table: I (63) boot: ## Label Usage Type ST Offset Length I (70) 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 miio_fw1 OTA app 00 10 00010000 00160000 I (100) boot: 4 miio_fw2 OTA app 00 11 00170000 00160000 I (108) boot: 5 test test app 00 20 002d0000 00013000 I (115) boot: 6 mimcu Unknown data 01 fd 002e3000 00100000 I (123) boot: 7 coredump Unknown data 01 03 003e3000 00010000 I (130) boot: 8 minvs Unknown data 01 fe 003f8000 00004000 I (138) boot: End of partition table I (142) boot: No factory image, trying OTA 0 I (147) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x24a78 (15 0136) map I (208) esp_image: segment 1: paddr=0x00034aa0 vaddr=0x3ffc0000 size=0x03840 ( 1 4400) load I (214) esp_image: segment 2: paddr=0x000382e8 vaddr=0x40080000 size=0x00400 ( 1024) load I (215) esp_image: segment 3: paddr=0x000386f0 vaddr=0x40080400 size=0x07920 ( 3 1008) load I (237) esp_image: segment 4: paddr=0x00040018 vaddr=0x400d0018 size=0xcdf78 (84 3640) map I (530) esp_image: segment 5: paddr=0x0010df98 vaddr=0x40087d20 size=0x0cb88 ( 5 2104) load I (552) esp_image: segment 6: paddr=0x0011ab28 vaddr=0x400c0000 size=0x00000 ( 0) load I (564) boot: Loaded app from partition at offset 0x10000 I (564) boot: Disabling RNG early entropy source... I (564) cpu_start: Pro cpu up. I (568) cpu_start: Single core mode I (573) heap_init: Initializing. RAM available for dynamic allocation: I (579) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM I (585) heap_init: At 3FFD2B50 len 0000D4B0 (53 KiB): DRAM I (591) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM I (598) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM I (604) heap_init: At 400948A8 len 0000B758 (45 KiB): IRAM I (610) cpu_start: Pro cpu start user code I (181) esp_core_dump: Init core dump to flash I (181) esp_core_dump: Found partition 'coredump' @ 3e3000 65536 bytes I (182) cpu_start: Starting scheduler on PRO CPU. I (195) wifi: wifi firmware version: f204566 I (195) wifi: config NVS flash: enabled I (195) wifi: config nano formating: disabled I (205) system_api: Base MAC address is not set, read default base MAC address f rom BLK0 of EFUSE E (215) system_api: Base MAC address from BLK0 of EFUSE CRC error, efuse_crc = 0 x2e; calc_crc = 0xb3 I (225) system_api: Base MAC address is not set, read default base MAC address f rom BLK0 of EFUSE E (235) system_api: Base MAC address from BLK0 of EFUSE CRC error, efuse_crc = 0 x2e; calc_crc = 0xb3 I (245) wifi: Init dynamic tx buffer num: 32 I (245) wifi: Init data frame dynamic rx buffer num: 64 I (245) wifi: Init management frame dynamic rx buffer num: 64 I (255) wifi: wifi driver task: 3ffda718, prio:23, stack:4096 I (265) wifi: Init static rx buffer num: 10 I (265) wifi: Init dynamic rx buffer num: 0 I (265) wifi: wifi power manager task: 0x3ffdf374 prio: 21 stack: 2560

| | ||| ||| || || || | | | | | | | | | | | | | | | | | | | ||| ||| |_| 08:00:00.100 [I] OTP read OK JENKINS BUILD NUMBER: N/A BUILD TIME: Oct 22 2018,11:16:15 BUILT BY: N/A MIIO APP VER: 1.3.1 MIIO MCU VER: N/A ESP SDK VER: v1.0-3169-g79af9a5-dirty MIIO DID: 00000000077218cc MIIO WIFI MAC: 04cf8c34ce23 last byte of key is 51 08:00:00.120 [I] MINVS partition @ 3f8000 16384 bytes 08:00:00.130 [I] token is already existed and do not need to regenerated 08:00:00.130 [W] get uid cfg in psm error 08:00:00.140 [I] COREDUMP partition 'coredump' @ 3e3000 65536 bytes 08:00:00.140 [I] COREDUMP magic_start not found! 08:00:00.140 [I] mi_otn:net bind(54321) 08:00:00.150 [I] [mi_otn] registed. get force_led=0 get_force_led_off ok set_indicator_led_recovery led_ctrl->0,0,0 08:00:00.250 [I] hostname: chuangmi-remote-v2_miiocc,len=25 I (445) system_api: Base MAC address is not set, read default base MAC address f rom BLK0 of EFUSE E (455) system_api: Base MAC address from BLK0 of EFUSE CRC error, efuse_crc = 0 x2e; calc_crc = 0xb3 E (625) system_api: Base MAC address from BLK0 of EFUSE CRC error, efuse_crc = 0 x2e; calc_crc = 0xb3 I (635) phy: phy_version: 366.0, ba9923d, Oct 31 2017, 18:06:17, 0, 0 08:00:00.470 [I] mible_init -- address = 04:cf:8c:34:ce:25 08:00:00.470 [I] mible_evtRule_restore: restoring event table 08:00:00.470 [I] [mible scanServer] Init success. 08:00:00.470 [I] BLE Scan on, instance:1 led_ctrl->2,100,0 period_ms=100 W (675) wifi: ap start fail

E (675) system_api: Base MAC address from BLK0 of EFUSE CRC error, efuse_crc = 0 x2e; calc_crc = 0xb3 I (685) wifi: mode : softAP (06:cf:8c:34:ce:23) event->event_id 13 Wifi ap start chuangmi app buildtime: Oct 22 2018,11:16:14 chuangmi app version=1.3.1_0014 manufacture_ir_iocheck level low before btn init, heap: 70308 I (705) gpio: GPIO[0]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldow n: 0| Intr:3 after btn init, heap: 69592 arch_os_mutex_create ok 0 system memory left: 64604 08:00:00.530 [I] MIMCU partition @ 2e3000 1048576 bytes 08:00:00.530 [I] No valid mcu fw found. Skip... 08:00:00.530 [E] mcu fw not found or ota error rmt_config mode 1 rmt_example_nec_rx_task start App thread started. rmt_config mode 0 RMT_MODE_TX 1 RMT_MODE_TX 2 RMT_MODE_TX 3 Rmt Tx Channel 1|Gpio 26|Sclk_Hz 80000000|Div 100|Carrier_Hz 38000|Duty 50system memory left: 65892 system memory left: 65896 system memory left: 65896 recv ir data err system memory left: 65896 `

AdamKGoddard commented 2 years ago

I never had any issues with the bootloader, just press and hold until ESPHome Flasher detected it. Have you checked your wiring and tried a different USB TTL serial adaptor?

AdamKGoddard commented 1 year ago

How did you go with this? Can I close this issue?

rapco commented 1 year ago

How did you go with this? Can I close this issue?

Yes please-