You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2020/03/17 23:58:35 UTC

[GitHub] [mynewt-core] nkaje commented on a change in pull request #2239: dialog_da1469x: enhance otp and serial loader tools.

nkaje commented on a change in pull request #2239: dialog_da1469x: enhance otp and serial loader tools.
URL: https://github.com/apache/mynewt-core/pull/2239#discussion_r394037207
 
 

 ##########
 File path: hw/bsp/dialog_da1469x-dk-pro/da1469x_serial.py
 ##########
 @@ -51,21 +52,32 @@ def load(infile, uart):
     # - If XOR matches, host sends 0x6 as final ack
     # - board boots image after receiving ACK from host
 
-#    if len(msg) == 0:
-#        raise SystemExit("Read timed out, exiting")
-
-    print("Please reset board to enter ROM uart recovery")
+    som_detected = False
+    reset_triggered = False
+    now = datetime.datetime.now()
+    reset_delay_us = 250000
 
     while True:
+        elapsed = datetime.datetime.now() - now
+        if elapsed.seconds >= 15:
+            raise SystemExit("Failed to receive SOM, aborting")
+        if not som_detected and not reset_triggered:
+            if elapsed.microseconds >= reset_delay_us:
+                print("Triggering SWD reset...")
+                os.system("./reset.sh &")
 
 Review comment:
   For some reason, the serial read from the device after the reset doesn't receive expected data. I addressed all other comments except for switching os.system -> subprocess.call()

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services