Device bricked on OTA update when esp-idf is updated from v3.1 to v4.0 [IDFGH-3384]

amruta
Posts: 18
Joined: Mon Aug 21, 2017 10:03 am

Device bricked on OTA update when esp-idf is updated from v3.1 to v4.0 [IDFGH-3384]

Postby amruta » Wed May 27, 2020 12:01 pm

## Environment

- Development Kit: [none, custom product using wrover module.]
- Module or chip used: [ESP32-WROVER 32Mbit]
- Operating System: [Windows]
- Power Supply: [on-board 3.3V]
- IDF version: v3.1

Application uses custom partition table as follows
  1. # additional nvs data
  2. otadata,  data, ota,     0xd000,  0x2000,
  3. phy_init, data, phy,     0xf000,  0x1000,
  4. factory,  app,  ota_0,   0x10000, 0x178000,
  5. ota_1,    app,  ota_1,   ,        0x178000,
  6. nvs,      data, nvs,     ,        0x10000,

## Issue
Updated IDF to version: 4.0 and performed OTA (followed native_ota_example from idf).
Initially I was getting error something similar to this viewtopic.php?t=13750
So, I checked bootloader using following command and it was intact

Code: Select all

esptool.py --chip esp32 image_info bootloader.bin
But now I am unable to reproduce that error and all I am getting is Guru meditation error.
Below are the logs:
  1. ets Jun  8 2016 00:22:57
  2.  
  3. rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
  4. configsip: 0, SPIWP:0xee
  5. clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
  6. mode:DIO, clock div:1
  7. load:0x3fff0018,len:4
  8. load:0x3fff001c,len:6008
  9. load:0x40078000,len:8428
  10. load:0x40080000,len:6476
  11. 0x40080000: _WindowOverflow4 at E:/ESP32/toolchain/v4.0/esp-idf/components/freertos/xtensa_vectors.S:1778
  12.  
  13. entry 0x40080330
  14. 0x40080330: _KernelExceptionVector at ??:?
  15.  
  16. I (29) boot: ESP-IDF v3.1-dirty 2nd stage bootloader
  17. I (29) boot: compile time 15:40:22
  18. I (29) boot: Enabling RNG early entropy source...
  19. I (34) qio_mode: Enabling default flash chip QIO
  20. I (39) boot: SPI Speed      : 80MHz
  21. I (43) boot: SPI Mode       : QIO
  22. I (47) boot: SPI Flash Size : 4MB
  23. I (51) boot: Partition Table:
  24. I (55) boot: ## Label            Usage          Type ST Offset   Length
  25. I (62) boot:  0 otadata          OTA data         01 00 0000d000 00002000
  26. I (70) boot:  1 phy_init         RF data          01 01 0000f000 00001000
  27. I (77) boot:  2 factory          OTA app          00 10 00010000 00178000
  28. I (85) boot:  3 ota_1            OTA app          00 11 00190000 00178000
  29. I (92) boot:  4 nvs              WiFi data        01 02 00308000 00010000
  30. I (100) boot: End of partition table
  31. I (104) esp_image: segment 0: paddr=0x00190020 vaddr=0x3f400020 size=0x1f22c (127532) map
  32. I (147) esp_image: segment 1: paddr=0x001af254 vaddr=0x3ffbdb60 size=0x00dbc (  3516) load
  33. I (148) esp_image: segment 2: paddr=0x001b0018 vaddr=0x400d0018 size=0xd2810 (862224) map
  34. 0x400d0018: _stext at ??:?
  35.  
  36. I (381) esp_image: segment 3: paddr=0x00282830 vaddr=0x3ffbe91c size=0x05410 ( 21520) load
  37. I (387) esp_image: segment 4: paddr=0x00287c48 vaddr=0x40080000 size=0x00400 (  1024) load
  38. 0x40080000: _WindowOverflow4 at E:/ESP32/toolchain/v4.0/esp-idf/components/freertos/xtensa_vectors.S:1778
  39.  
  40. I (388) esp_image: segment 5: paddr=0x00288050 vaddr=0x40080400 size=0x12234 ( 74292) load
  41. I (432) boot: Loaded app from partition at offset 0x190000
  42. I (432) boot: Disabling RNG early entropy source...
  43. Guru Meditation Error: Core  0 panic'ed (StoreProhibited). Exception was unhandled.
  44. Core 0 register dump:
  45. PC      : 0x40121fc5  PS      : 0x00060f30  A0      : 0x80080fd9  A1      : 0x3ffe3bd0
  46. 0x40121fc5: esp_flash_init_default_chip at E:/ESP32/toolchain/v4.0/esp-idf/components/spi_flash/esp_flash_spi_init.c:205
  47.  
  48. A2      : 0xffffffff  A3      : 0x3ffc1f64  A4      : 0x3ffbdc14  A5      : 0x3ffc9a98
  49. A6      : 0x40092634  A7      : 0x00000000  A8      : 0x00400000  A9      : 0x00400000
  50. A10     : 0x00000000  A11     : 0x3ffc1f64  A12     : 0x00000108  A13     : 0x3ffc9a60
  51. A14     : 0x00000000  A15     : 0x00000400  SAR     : 0x0000001f  EXCCAUSE: 0x0000001d
  52. EXCVADDR: 0xffffffff  LBEG    : 0x4000c2e0  LEND    : 0x4000c2f6  LCOUNT  : 0xffffffff
  53.  
  54. ELF file SHA256: ffffffffffffffffffffffffffffffff0000000000000000000222bfffffffff
  55.  
  56. Backtrace: 0x40121fc2:0x3ffe3bd0 0x40080fd6:0x3ffe3c10 0x400810d3:0x3ffe3c60 0x40078da1:0x3ffe3ca0 |<-CORRUPTED
  57. 0x40121fc2: esp_flash_init_default_chip at E:/ESP32/toolchain/v4.0/esp-idf/components/spi_flash/esp_flash_spi_init.c:205
  58.  
  59. 0x40080fd6: start_cpu0_default at E:/ESP32/toolchain/v4.0/esp-idf/components/esp32/cpu_start.c:400
  60.  
  61. 0x400810d3: call_start_cpu0 at E:/ESP32/toolchain/v4.0/esp-idf/components/esp32/cpu_start.c:260

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Device bricked on OTA update when esp-idf is updated from v3.1 to v4.0 [IDFGH-3384]

Postby ESP_Angus » Thu May 28, 2020 3:12 am

Thanks for the comprehensive report. I've edited this topic with an internal ID as we're tracking this issue internally.

Will get back to you ASAP.

ESP_michael
Posts: 37
Joined: Mon Aug 28, 2017 10:25 am

Re: Device bricked on OTA update when esp-idf is updated from v3.1 to v4.0 [IDFGH-3384]

Postby ESP_michael » Thu May 28, 2020 3:32 am

Hi amruta,

Sorry to hear that.. We are trying to reproduce that..

At the same time, could you provide your flash chip model? It's one of the regression for the new API of 4.0 compared to the legacy one. We have a fix for MXIC chip in commit 61ce037fc1f3c5747ee35328e3cd9cdfd2b8b86f, but it's not backported to 4.0 yet.

Michael

amruta
Posts: 18
Joined: Mon Aug 21, 2017 10:03 am

Re: Device bricked on OTA update when esp-idf is updated from v3.1 to v4.0 [IDFGH-3384]

Postby amruta » Thu May 28, 2020 6:13 am

Currently I am working with ESP32 S node mcu dev board. You may test with the same

amruta
Posts: 18
Joined: Mon Aug 21, 2017 10:03 am

Re: Device bricked on OTA update when esp-idf is updated from v3.1 to v4.0 [IDFGH-3384]

Postby amruta » Thu May 28, 2020 6:18 am

Additional update:
Tried same thing by updating to idf v3.3.2 as well as v4.0.1
Same issues. I can provide additional logs if required.
Basically, I would like to update to either v3.3.2 or v4.0.1 as they contain MQTT module with lot of bug fixes.

ESP_michael
Posts: 37
Joined: Mon Aug 28, 2017 10:25 am

Re: Device bricked on OTA update when esp-idf is updated from v3.1 to v4.0 [IDFGH-3384]

Postby ESP_michael » Thu May 28, 2020 10:38 am

Hi @amruta,

It's very helpful to know the model of your dev board! But unluckily I don't have that dev board in hand, so I can't debug easily.

I'm guessing it's related to the flash in the module, could you please help to run `esptool.py flash_id` to get the flash ID of the module, and post it here?

Michael

amruta
Posts: 18
Joined: Mon Aug 21, 2017 10:03 am

Re: Device bricked on OTA update when esp-idf is updated from v3.1 to v4.0 [IDFGH-3384]

Postby amruta » Fri May 29, 2020 6:10 am

Hi @xiaoxufeng

I ran the command but I guess I am doing something wrong
Following is the output
  1. esptool.py v2.8
  2. Found 1 serial ports
  3. Serial port COM3
  4. Connecting........_____.
  5. Detecting chip type... ESP32
  6. Chip is ESP32D0WDQ6 (revision 1)
  7. Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
  8. Crystal is 40MHz
  9. MAC: cc:50:e3:b6:c8:d0
  10. Uploading stub...
  11. Running stub...
  12. Stub running...
  13. Manufacturer: 20
  14. Device: 4016
  15. Detected flash size: 4MB
  16. Hard resetting via RTS pin...

ESP_michael
Posts: 37
Joined: Mon Aug 28, 2017 10:25 am

Re: Device bricked on OTA update when esp-idf is updated from v3.1 to v4.0 [IDFGH-3384]

Postby ESP_michael » Fri May 29, 2020 8:24 am

Thanks amruta,

The result is correct, this is an XMC chip.

Thanks for your information, though I haven't got a clue...

Who is online

Users browsing this forum: No registered users and 104 guests