JosephHewitt/wardriver_rev3

Device crashes when attempting to OTA update

JosephHewitt opened this issue · 3 comments

Running 1.2.0b1, an invalid checksum is generated for the firmware (#85) and then the device crashes right after online verification during the first phase of install_firmware

When attempting to update side B, the following is printed:

21:38:42.953 -> Firmware install requested: /B.bin82e50cc91daf02044bc6f1d3da8d5c7fef12d6cbf0dffc697cb33e29921a8f2Will install firmware
21:38:43.045 -> Validating firmware
21:39:27.675 -> Contacting OTA server -> /hashes/82e50cc91daf02044bc6f1d3da8d5c7fef12d6cbf0dffc697cb33e29921a8f2.txt
21:39:27.675 -> primary cert
21:39:28.365 -> Guru Meditation Error: Core 1 panic'ed (Unhandled debug exception).
21:39:28.411 -> Debug exception reason: Stack canary watchpoint triggered (loopTask)
21:39:28.411 -> Core 1 register dump:
21:39:28.411 -> PC : 0x400917ab PS : 0x00060336 A0 : 0x800939e0 A1 : 0x3ffb0320
21:39:28.411 -> A2 : 0x3ffb0300 A3 : 0xb33fffff A4 : 0x0000cdcd A5 : 0x00060323
21:39:28.411 -> A6 : 0x00060320 A7 : 0x0000abab A8 : 0xb33fffff A9 : 0xffffffff
21:39:28.411 -> A10 : 0x3ffb0540 A11 : 0x00000011 A12 : 0x00000000 A13 : 0x3ffe0684
21:39:28.411 -> A14 : 0x007b0300 A15 : 0x003fffff SAR : 0x00000019 EXCCAUSE: 0x00000001
21:39:28.411 -> EXCVADDR: 0x00000000 LBEG : 0x40089ed8 LEND : 0x40089ee3 LCOUNT : 0x00000000
21:39:28.456 ->
21:39:28.456 ->
21:39:28.456 -> Backtrace: 0x400917a8:0x3ffb0320 0x400939dd:0x3ffb0360 0x40093c75:0x3ffb0380 0x40083fb6:0x3ffb03a0 0x40084251:0x3ffb03d0 0x40085c9c:0x3ffb03f0 0x401312a5:0x3ffb0410 0x40126f6c:0x3ffb0430 0x401270a8:0x3ffb0450 0x4012782a:0x3ffb0470 0x40127add:0x3ffb0500 0x40127f92:0x3ffb0520 0x4012aa43:0x3ffb05c0 0x4012b351:0x3ffb0630 0x4012bd3b:0x3ffb0820 0x40129d41:0x3ffb0980 0x40129f40:0x3ffb09b0 0x40124a84:0x3ffb09d0 0x401224fd:0x3ffb0a70 0x40122537:0x3ffb0a90 0x400e10b9:0x3ffb0ab0 0x400e0991:0x3ffb0d30 0x400e0a07:0x3ffb0d70 0x400e0a96:0x3ffb0db0 0x400d6169:0x3ffb0dd0 0x400d694a:0x3ffb0eb0 0x400d6cea:0x3ffb0f40 0x400d9e65:0x3ffb1fc0 0x400db3bf:0x3ffb21c0 0x400e5492:0x3ffb2290
21:39:28.502 ->
21:39:28.502 ->
21:39:28.502 ->
21:39:28.502 ->
21:39:28.502 -> ELF file SHA256: 969ebbe44366f8fc
21:39:28.502 ->
21:39:28.688 -> Rebooting...
21:39:28.688 -> ets Jun 8 2016 00:22:57

Also happens after fixing #85 and happens when a valid OK response is returned from the OTA server, so this issue is likely unrelated.

Only appears to happen as part of the strict checking.

Also affects updates to A.

Workaround

Create a file named cfg.txt at the root of your SD card. This file should contain the following line:
enforce_checksums=no

This file should contain an empty line at the end.

If this has worked correctly, you should see ESP32 A printing cfgread: enforce_checksums eq no over serial during boot.

It is recommended to remove this line, or the whole file, once you have updated to 1.2.0b2.

Temporary fix implemented in #88 released in 1.2.0b2.