public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] common/xyzmodem.c, ymodem, slow behavior receiving bytes
@ 2012-11-10 13:40 Angelo Dureghello
  2012-11-13  0:16 ` Angelo Dureghello
  0 siblings, 1 reply; 12+ messages in thread
From: Angelo Dureghello @ 2012-11-10 13:40 UTC (permalink / raw)
  To: u-boot

Dear all,

i am experiencing a strange behavior on the u-boot ymodem protocol.
I am running u-boot, (pulled from origin/head yesterday) on a mcf5307 based 
board. I am currently working to include this board/cpu as supported into 
u-boot.

cpu runs at 90Mhz (bus clock at 45), baud rate 115200.

On an older u-boot (2011.09.00122), i was able to upload files through ymodem 
at 115200 without any issue.

Once pulled yesterday head, and installed on the board, i am no more able to
upload files. U-boot times out when the first 128 bytes block is sent, and
sends SYN (C) again, so i started some debugging on xyzmodem.c:

Protocol times-out here, from line 434

  ....
  xyz.len = (c == SOH) ? 128 : 1024;
  xyz.bufp = xyz.pkt;
  for (i = 0; i < xyz.len; i++)
    {
      res = CYGACC_COMM_IF_GETC_TIMEOUT (*xyz.__chan, &c);
      ZM_DEBUG (zm_save (c));
      if (res)
	{
	  xyz.pkt[i] = c;
	}
      else
	{
	  ZM_DEBUG (zm_dump (__LINE__));
---->>    return xyzModem_timeout;
	}
    }


Echoing received char back to PC, i see about 1 every 3 received chars seems 
lost somewhere, so the first 128bytes block is never completely received 
(time out).

I measured baudrate through oscilloscope, 
from PC to u-boot board, i have 115600
from u-boot board to PC, i have 117180 (still inside 2% tolerance)

Also verified timer/delay functions works properly in new u-boot build.
As clients i used minicom and other, and have the same result.

So from a first look, seems the receive routine from line 434 is no more fast 
enough to receive the whole block. I moved speed down to 57600, upload works 
fine again.

What do you think about ?

Best Regards,
Angelo Dureghello

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-11-23 23:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-10 13:40 [U-Boot] common/xyzmodem.c, ymodem, slow behavior receiving bytes Angelo Dureghello
2012-11-13  0:16 ` Angelo Dureghello
2012-11-13  1:41   ` Marek Vasut
2012-11-13  7:09   ` Wolfgang Denk
2012-11-14  9:47     ` Angelo Dureghello
2012-11-14 10:28       ` Henrik Nordström
2012-11-14 11:05       ` Wolfgang Denk
2012-11-19 21:54         ` Angelo Dureghello
2012-11-19 22:58           ` Wolfgang Denk
2012-11-22 14:38             ` Angelo Dureghello
2012-11-23 22:57             ` Angelo Dureghello
2012-11-23 23:04               ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox