[U-Boot] common/xyzmodem.c, ymodem, slow behavior receiving bytes

Angelo Dureghello sysamfw at gmail.com
Tue Nov 13 01:16:52 CET 2012


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


More information about the U-Boot mailing list