From e4a2677de460d8d462dd8147d8137777260e29bd Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Sat, 19 Jan 2019 16:50:17 +0100 Subject: [PATCH] ESP8266 Better Exception Code Names (#358) --- esphomeyaml/platformio_api.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/esphomeyaml/platformio_api.py b/esphomeyaml/platformio_api.py index df29491644..3892b4a76a 100644 --- a/esphomeyaml/platformio_api.py +++ b/esphomeyaml/platformio_api.py @@ -63,7 +63,7 @@ def get_idedata(config): # ESP logs stack trace decoder, based on https://github.com/me-no-dev/EspExceptionDecoder ESP8266_EXCEPTION_CODES = { - 0: "Illegal instruction", + 0: "Illegal instruction (Is the flash damaged?)", 1: "SYSCALL instruction", 2: "InstructionFetchError: Processor internal physical address or data error during " "instruction fetch", @@ -71,7 +71,7 @@ ESP8266_EXCEPTION_CODES = { 4: "Level1Interrupt: Level-1 interrupt as indicated by set level-1 bits in the INTERRUPT " "register", 5: "Alloca: MOVSP instruction, if caller's registers are not in the register file", - 6: "IntegerDivideByZero: QUOS, QUOU, REMS, or REMU divisor operand is zero", + 6: "Integer Divide By Zero", 7: "reserved", 8: "Privileged: Attempt to execute a privileged operation when CRING ? 0", 9: "LoadStoreAlignmentCause: Load or store to an unaligned address", @@ -96,10 +96,8 @@ ESP8266_EXCEPTION_CODES = { 26: "LoadStorePrivilege: A load or store referenced a virtual address at a ring level less " "than ", 27: "reserved", - 28: "LoadProhibited: A load referenced a page mapped with an attribute that does not permit " - "loads", - 29: "StoreProhibited: A store referenced a page mapped with an attribute that does not permit " - "stores", + 28: "Access to invalid address: LOAD (wild pointer?)", + 29: "Access to invalid address: STORE (wild pointer?)", } @@ -126,7 +124,7 @@ def _parse_register(config, regex, line): _decode_pc(config, match.group(1)) -STACKTRACE_ESP8266_EXCEPTION_TYPE_RE = re.compile(r'Exception \(([0-9]*)\):') +STACKTRACE_ESP8266_EXCEPTION_TYPE_RE = re.compile(r'[eE]xception \((\d+)\):') STACKTRACE_ESP8266_PC_RE = re.compile(r'epc1=0x(4[0-9a-fA-F]{7})') STACKTRACE_ESP8266_EXCVADDR_RE = re.compile(r'excvaddr=0x(4[0-9a-fA-F]{7})') STACKTRACE_ESP32_PC_RE = re.compile(r'PC\s*:\s*(?:0x)?(4[0-9a-fA-F]{7})')