diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-04-14 18:54:11 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-04-14 18:54:11 +0300 |
commit | 272fad6d9c2261d35088866f544797fd77ff51e3 (patch) | |
tree | 9b18ea90826c0d542d15be923af8b4d3b77cf061 /esp8266/scripts | |
parent | a649d726063d548bbf5f05aef8c4420ddf0cfe6e (diff) | |
download | micropython-272fad6d9c2261d35088866f544797fd77ff51e3.tar.gz micropython-272fad6d9c2261d35088866f544797fd77ff51e3.zip |
esp8266/scripts/port_diag.py: Module to collect diagnostic info.
A shortcut for users to provide background diagnostic info for bug
reports.
Diffstat (limited to 'esp8266/scripts')
-rw-r--r-- | esp8266/scripts/port_diag.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/esp8266/scripts/port_diag.py b/esp8266/scripts/port_diag.py new file mode 100644 index 0000000000..fd7ee52d14 --- /dev/null +++ b/esp8266/scripts/port_diag.py @@ -0,0 +1,19 @@ +import esp +import uctypes + + +def main(): + + ROM = uctypes.bytearray_at(0x40200000, 16) + fid = esp.flash_id() + + print("Flash ID: %x (Vendor: %x Device: %x)" % (fid, fid & 0xff, fid & 0xff00 | fid >> 16)) + + print("Flash bootloader data:") + SZ_MAP = {0: "512KB", 1: "256KB", 2: "1MB", 3: "2MB", 4: "4MB"} + FREQ_MAP = {0: "40MHZ", 1: "26MHZ", 2: "20MHz", 0xf: "80MHz"} + print("Byte @2: %02x" % ROM[2]) + print("Byte @3: %02x (Flash size: %s Flash freq: %s)" % (ROM[3], SZ_MAP.get(ROM[3] >> 4, "?"), FREQ_MAP.get(ROM[3] & 0xf))) + + +main() |