public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Angelo Dureghello <sysamfw@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] common/xyzmodem.c, ymodem, slow behavior receiving bytes
Date: Tue, 13 Nov 2012 01:16:52 +0100	[thread overview]
Message-ID: <20121113001651.GA21177@angel3> (raw)
In-Reply-To: <20121110134007.GA5009@angel3>

Hi all,

seems that mcf5307, working at 90Mhz, is not fast enough when "-Os -g" 
compile options are set.

I changed for test config.mk from

DBGFLAGS= -g # -DDEBUG
OPTFLAGS= -Os #-fomit-frame-pointer

into

DBGFLAGS= #-g # -DDEBUG
OPTFLAGS= -O2 #-Os #-fomit-frame-pointer

common compiles now with -O2 and ymodem works fine again at 115200.

Also, i don't understand why "-g" is set by default. 
Is there a way to override/customize this options for this cpu ?
Or i have to definitely step down to 57600 ?

Best Regards,
Angelo Dureghello


On Sat, Nov 10, 2012 at 02:40:07PM +0100, Angelo Dureghello wrote:
> 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

  reply	other threads:[~2012-11-13  0:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-10 13:40 [U-Boot] common/xyzmodem.c, ymodem, slow behavior receiving bytes Angelo Dureghello
2012-11-13  0:16 ` Angelo Dureghello [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121113001651.GA21177@angel3 \
    --to=sysamfw@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox