Hi,

On 08/01/2018 03:15 AM, Alexander Sverdlin wrote:

This commit breaks YMODEM SPL->U-Boot boot on Beagle Bone,
transfer is aborted (because of timeout) after 497kb
(u-boot.img is around 570kb).
Reverting the commit repairs YMODEM boot.

Is the timeout a watchdog timeout or some communication freeze?
In case watchdog is correctly configured, kicking should still
happen.

Tomas

---
  common/xyzModem.c | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/common/xyzModem.c b/common/xyzModem.c
index 5656aac..e0d87db 100644
--- a/common/xyzModem.c
+++ b/common/xyzModem.c
@@ -71,12 +71,12 @@ typedef int cyg_int32;
  static int
  CYGACC_COMM_IF_GETC_TIMEOUT (char chan, char *c)
  {
-#define DELAY 20
-  unsigned long counter = 0;
-  while (!tstc () && (counter < xyzModem_CHAR_TIMEOUT * 1000 / DELAY))
+
+  ulong now = get_timer(0);
+  while (!tstc ())
      {
-      udelay (DELAY);
-      counter++;
+      if (get_timer(now) > xyzModem_CHAR_TIMEOUT)
+        break;
      }
    if (tstc ())
      {


_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to