stlinkv2 fixes
authorNIIBE Yutaka <gniibe@fsij.org>
Tue, 25 Sep 2012 00:00:10 +0000 (09:00 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Tue, 25 Sep 2012 00:00:10 +0000 (09:00 +0900)
ChangeLog
tool/stlinkv2.py

index 8261f7c..9816961 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-09-25  Niibe Yutaka  <gniibe@fsij.org>
+
+       * tool/stlinkv2.py (main): Print out option bytes value.
+       Call reset_sys before blank_check.
+
 2012-09-18  Niibe Yutaka  <gniibe@fsij.org>
 
        * tool/stlinkv2.py (stlinkv2.option_bytes_erase)
index a14a986..8a2023f 100755 (executable)
@@ -523,12 +523,13 @@ def main(show_help, erase_only, no_protect, spi_flash_check,
         print "ON"
     else:
         print "off"
-        option_bytes = stl.option_bytes_read()
-        print "Option bytes: %08x" % option_bytes
-        if (option_bytes & 0xff) == RDP_KEY:
-            ob_protection_enable = False
-        else:
-            ob_protection_enable = True
+
+    option_bytes = stl.option_bytes_read()
+    print "Option bytes: %08x" % option_bytes
+    if (option_bytes & 0xff) == RDP_KEY:
+        ob_protection_enable = False
+    else:
+        ob_protection_enable = True
 
     stl.enter_debug()
     status = stl.get_status()
@@ -543,6 +544,7 @@ def main(show_help, erase_only, no_protect, spi_flash_check,
             raise OperationFailure("Flash ROM is protected")
     else:
         if not skip_blank_check:
+            stl.reset_sys()
             blank = stl.blank_check()
             print "Flash ROM blank check: %s" % blank
         else: