RetroBSD

2.11BSD operating system for microcontrollers
It is currently Tue Apr 07, 2020 6:05 am

All times are UTC




Post new topic Reply to topic  [ 16 posts ] 
Author Message
 Post subject: ZMODEM debugging
PostPosted: Sat Dec 21, 2013 2:35 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
I've done following experiment:
1. in console (first TTerm window, uart2) I run rz with:
Code:
rz < /dev/tty0 > /dev/tty0

2. the tty0 is uart1 (115k2) in second TTerm window I send the actual file via zmodem.
In the console I see following (for example):
Code:
# rz < /dev/tty0 > /dev/tty0
rz ready. To begin transfer, type "sz file ..." to your modem program

Incoming: gmp-5.1.3.tar.bz2 2196480 12245716246 100644
Receiving gmp-5.1.3.tar.bz2 BIN w
  32776 ZMODEM    Retry 0: Bad CRC
  48558 ZMODEM    Readline:TIMEOUT
Retry 0: TIMEOUT
  81477 ZMODEM    Retry 0: Bad CRC
 114333 ZMODEM    Retry 0: Bad CRC
 147361 ZMODEM
 180306 ZMODEM    Retry 0: Bad escape sequence 71
Retry 0: Garbled data subpacket
 213404 ZMODEM    Retry 0: Bad CRC
 246530 ZMODEM
 279472 ZMODEM    Retry 0: Bad CRC
 296070 ZMODEM    Retry 0: Bad CRC
 329216 ZMODEM    Retry 0: Bad CRC
 362030 ZMODEM    Retry 0: Bad CRC
 395071 ZMODEM    Retry 0: Bad CRC
 428083 ZMODEM    Retry 0: Bad CRC
 461016 ZMODEM    Retry 0: Bad CRC
 493980 ZMODEM    Retry 0: Bad escape sequence f0
Retry 0: Garbled data subpacket
 512909 ZMODEM    Retry 0: Bad escape sequence 24
Retry 0: Garbled data subpacket
 540804 ZMODEM    Retry 0: Bad CRC
 573848 ZMODEM    Retry 0: Bad escape sequence 6e
Retry 0: Garbled data subpacket
 606876 ZMODEM    Retry 0: Bad CRC
 639654 ZMODEM    Retry 0: Bad escape sequence 74
Retry 0: Garbled data subpacket
 672677 ZMODEM    Retry 0: Bad escape sequence 71
Retry 0: Garbled data subpacket
 705611 ZMODEM    Retry 0: Bad CRC
 738766 ZMODEM    Retry 0: Bad escape sequence 7d
Retry 0: Garbled data subpacket
 771784 ZMODEM    Retry 0: Bad CRC
 793250 ZMODEM    Retry 0: Bad escape sequence b2
Retry 0: Garbled data subpacket
 826178 ZMODEM    Retry 0: Bad escape sequence f2
Retry 0: Garbled data subpacket
 859065 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
 859065 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
Retry 0: Got ERROR
 859065 ZMODEM    Retry 0: Bad CRC
 860298 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
Retry 0: Got ERROR
 860298 ZMODEM    Retry 0: Bad CRC
 861540 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
 861540 ZMODEM    Retry 0: Bad CRC
 894470 ZMODEM    Retry 0: Bad CRC
 927412 ZMODEM    Retry 0: Bad CRC
 960344 ZMODEM    Retry 0: Bad escape sequence a4
Retry 0: Garbled data subpacket
Retry 0: Got ERROR
 960344 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
Retry 0: Got ERROR
 960344 ZMODEM    Retry 0: Bad CRC
 961520 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
Retry 0: Got ERROR
 961520 ZMODEM    Retry 0: Bad CRC
 962711 ZMODEM    Retry 0: Bad CRC
 995532 ZMODEM    Retry 0: Bad CRC
 999188 ZMODEM    Retry 0: Bad CRC
1030032 ZMODEM    Retry 0: Bad escape sequence f1
Retry 0: Garbled data subpacket
1062915 ZMODEM    Retry 0: Bad CRC
1095910 ZMODEM    Retry 0: Bad escape sequence a4
Retry 0: Garbled data subpacket
1128777 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
1128777 ZMODEM    Retry 0: Bad CRC
1161713 ZMODEM    Retry 0: Bad CRC
1194529 ZMODEM    Retry 0: Bad escape sequence e9
Retry 0: Garbled data subpacket
1227651 ZMODEM    Retry 0: Bad escape sequence ac
Retry 0: Garbled data subpacket
Retry 0: Got ERROR
1227651 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
1227651 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
1227651 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
1227651 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
1227651 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
1227651 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
1227651 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
1227651 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
1227651 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
1227651 ZMODEM    Retry 0: Bad CRC
*** 0x7f00d96c: bus error
Bus error - core dumped
#


The uart1 is connected via wire (not via BT) - it seems to me we have still a bug somewhere in the zmodem source. That is a typical crash scenario.
The TTerm is set for 512b packets and 2k window..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: ZMODEM debugging
PostPosted: Sat Dec 21, 2013 2:50 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Code:
# rz < /dev/tty0 > /dev/tty0
rz ready. To begin transfer, type "sz file ..." to your modem program

Incoming: PIC32MZ_Harmony_help.pdf 18226780 12242405006 100644
Receiving PIC32MZ_Harmony_help.pdf BIN w
  32815 ZMODEM    Retry 0: Bad CRC
  65886 ZMODEM    Retry 0: Bad CRC
  74590 ZMODEM    Retry 0: Bad escape sequence fa
Retry 0: Garbled data subpacket
 107686 ZMODEM    Retry 0: Bad CRC
 140852 ZMODEM    Retry 0: Bad CRC
 173806 ZMODEM    Retry 0: Bad CRC
 206703 ZMODEM    Retry 0: Bad CRC
 239626 ZMODEM    Retry 0: Bad escape sequence 64
Retry 0: Garbled data subpacket
...
1220406 ZMODEM     Readline:TIMEOUT
Retry 0: TIMEOUT
1253306 ZMODEM    Retry 0: Bad escape sequence 76
Retry 0: Garbled data subpacket
1286364 ZMODEM    Retry 0: Bad CRC
1319433 ZMODEM    Retry 0: Bad CRC
1352447 ZMODEM    Retry 0: Bad escape sequence ff
Retry 0: Garbled data subpacket
1370809 ZMODEM     Readline:TIMEOUT
Retry 0: TIMEOUT
1403835 ZMODEM    Retry 0: Bad CRC
1436679 ZMODEM    Retry 0: Bad escape sequence 35
Retry 0: Garbled data subpacket
1469726 ZMODEM    Retry 0: Bad CRC
1502678 ZMODEM    Retry 0: Bad CRC
1535480 ZMODEM    Readline:TIMEOUT
Retry 0: TIMEOUT
1601575 ZMODEM    Retry 0: Bad escape sequence b2
Retry 0: Garbled data subpacket
1614705 ZMODEM    Retry 0: Bad CRC
1633830 ZMODEM    Retry 0: Bad escape sequence 65
Retry 0: Garbled data subpacket
..
2775601 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
2775997 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
2776401 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
2776401 ZMODEM    Retry 0: Bad CRC
2809370 ZMODEM    Retry 0: Bad escape sequence b4
Retry 0: Garbled data subpacket
2842460 ZMODEM    Retry 0: Bad escape sequence 73
Retry 0: Garbled data subpacket
Retry 0: Got ERROR
2842460 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
Retry 0: Got ERROR
2842460 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
Retry 0: Got ERROR
2842460 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
Retry 0: Got ERROR
2842460 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
Retry 0: Got ERROR
2842460 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
Retry 0: Got ERROR
2842460 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
Retry 0: Got ERROR
2842460 ZMODEM    Retry 0: Bad CRC
*** 0x7f00d96c: bus error
Bus error - core dumped
#

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: ZMODEM debugging
PostPosted: Sat Dec 21, 2013 2:57 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
This file has been uploaded successfully:
Code:
# rz < /dev/tty0 > /dev/tty0
rz ready. To begin transfer, type "sz file ..." to your modem program

Incoming: doc2589-1.pdf 331632 12241247002 100644
Receiving doc2589-1.pdf BIN w
  33137 ZMODEM    Retry 0: Bad CRC
  66200 ZMODEM    Retry 0: Bad CRC
  99216 ZMODEM    Retry 0: Bad CRC
 132012 ZMODEM    Retry 0: Bad CRC
 165056 ZMODEM    Retry 0: Bad CRC
 231448 ZMODEM
 264276 ZMODEM    Retry 0: Bad CRC
 266746 ZMODEM    Retry 0: Bad escape sequence a4
Retry 0: Garbled data subpacket
 288805 ZMODEM    Retry 0: Bad CRC
 321939 ZMODEM     Retry 0: Bad CRC
 331487 ZMODEM    Please read the manual page BUGS chapter!
# ls -l
total 2833
...
-rw-r--r--  1 root       331632 Nov 14 14:26 doc2589-1.pdf

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: ZMODEM debugging
PostPosted: Sat Dec 21, 2013 3:30 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Running in /tmp (ramdisk):
Code:
# rz < /dev/tty0 > /dev/tty0
rz ready. To begin transfer, type "sz file ..." to your modem program

Incoming: gmp-5.1.3.tar.bz2 2196480 12245716246 100644
Receiving gmp-5.1.3.tar.bz2 BIN w
 121934 ZMODEM    Retry 0: Bad CRC
 138209 ZMODEM     Readline:TIMEOUT
Retry 0: TIMEOUT
 171163 ZMODEM    Retry 0: Bad CRC
 314621 ZMODEM     Readline:TIMEOUT
Retry 0: TIMEOUT
 380350 ZMODEM    Retry 0: Bad CRC
 464613 ZMODEM    Retry 0: Bad CRC
 489276 ZMODEM    Retry 0: Bad escape sequence b7
Retry 0: Garbled data subpacket
 588370 ZMODEM    Retry 0: Bad CRC
 687133 ZMODEM    Retry 0: Bad CRC
 753494 ZMODEM    Retry 0: Bad CRC
 918731 ZMODEM    Retry 0: Bad CRC
 984526 ZMODEM    Retry 0: Bad CRC
 985747 ZMODEM    Retry 0: Bad escape sequence e0
Retry 0: Garbled data subpacket
1010528 ZMODEM    Retry 0: Bad CRC
1043660 ZMODEM    Retry 0: Bad CRC
1208213 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
1208213 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
1208213 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
1208213 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
1208213 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
1208213 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
1208213 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
1208213 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
1208213 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
1208213 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
1208213 ZMODEM    Retry 0: Bad CRC
*** 0x7f00d96c: bus error
Bus error - core dumped
#


I am quite sure the pic32 @ 80MHz and fs on the ramdisk can do a zmodem upload @115k2 baud, though ;)

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: ZMODEM debugging
PostPosted: Sat Dec 21, 2013 7:13 am 
Contributor

Joined: Mon Apr 29, 2013 1:56 am
Posts: 196
Pito wrote:
I am quite sure the pic32 @ 80MHz and fs on the ramdisk can do a zmodem upload @115k2 baud, though ;)


Is this the regular RS232 or over USB? Is there any flow control?

I've had problems using the emulated RS232 over USB on the Maximite. And in the little time I spent researching the reliability of file transfers over this link I couldn't figure out the details (what's enabled/emulated, what's not, and the data path and all buffers and data processors between the tty and the hardware). I even wrote a pair of tiny file transfer tools (rx, running on Retro, would echo all received data back to tx, running on the PC, so tx can detect errors, tx would send bytes (2 ASCII chars per byte: 2 hex digits) with significant additional delays inbetween (some milliseconds, AFAIR)). While I managed to make them work over here, the speed is unbearably low (something like 30 minues for 50KB).

Also, there's probably some scheduling occurring. It could affect transmissions.


Top
 Profile  
 
 Post subject: Re: ZMODEM debugging
PostPosted: Sat Dec 21, 2013 10:26 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
I am using the zmodem intensively last few months and it works basically for smaller files like 25k. But I think there is a bug somewhere in it (based on the above logs. A kind of overflow of counters or memory allocation issue.
The zmodem (or other utility) is key for retrobsd.
@alex: do you think we can compile ie. lrzsz? Wouid it fit into?
https://ohse.de/uwe/software/lrzsz.html
http://e2e.ti.com/support/embedded/linu ... spx#365477

Kermit for embedded (a nice small source):
http://www.columbia.edu/kermit/ek.html
EK is not an application itself, it's a subroutine to be called from your master application. It is useful only to developers, who must supply the master application or calling environment as well as the file and communications i/o routines.

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: ZMODEM debugging
PostPosted: Sat Dec 21, 2013 9:55 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
This is @4800baud via uart1 (console uart2) - the same mess:
Code:
# rz < /dev/tty0 > /dev/tty0
rz ready. To begin transfer, type "sz file ..." to your modem program

Readline:TIMEOUT
Retry 0: Got TIMEOUT
Retry 0: Got ERROR
Incoming: doc2589-1.pdf 331632 12241247002 100644
Receiving doc2589-1.pdf BIN w
   3915 ZMODEM    Retry 0: Bad CRC
  10113 ZMODEM    Retry 0: Bad CRC
  19984 ZMODEM    Retry 0: Bad CRC
  24091 ZMODEM    Retry 0: Bad CRC
  30225 ZMODEM    Retry 0: Bad CRC
  40878 ZMODEM    Retry 0: Bad CRC
  45421 ZMODEM    Retry 0: Bad escape sequence 35
Retry 0: Garbled data subpacket
Retry 0: Bad CRC
Retry 0: Got ERROR
  46230 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
Retry 0: Bad CRC
Retry 0: Got ERROR
  47046 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
  47046 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
  47867 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
  48697 ZMODEM    Retry 0: Bad escape sequence 2a
Retry 0: Garbled data subpacket
Retry 0: Bad CRC
Retry 0: Got ERROR
  49119 ZMODEM    Retry 0: Bad CRC
  52788 ZMODEM    Retry 0: Bad CRC
  62942 ZMODEM    Retry 0: Bad CRC
  66200 ZMODEM    Retry 0: Bad CRC
  71540 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
  72369 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
Retry 0: Bad CRC
Retry 0: Got ERROR
Retry 0: Got ERROR
  72777 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
Retry 0: Bad CRC
Retry 0: Got ERROR
  72777 ZMODEM    Retry 0: Bad CRC
  73185 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
  73606 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
  73606 ZMODEM    Retry 0: Bad CRC
  76453 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
  77283 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
  78100 ZMODEM    Retry 0: Bad escape sequence 2a
Retry 0: Garbled data subpacket
Retry 0: Bad CRC
Retry 0: Got ERROR
  78100 ZMODEM    Retry 0: Bad CRC
  78518 ZMODEM    Retry 0: Bad CRC
  86729 ZMODEM    Retry 0: Bad CRC
  90862 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
Retry 0: Bad CRC
Retry 0: Got ERROR
  90862 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
Retry 0: Bad CRC
Retry 0: Got ERROR
  90862 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
Retry 0: Bad CRC
Retry 0: Got ERROR
  90862 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
Retry 0: Bad CRC
Retry 0: Got ERROR
  90862 ZMODEM    Retry 0: Bad CRC
  90862 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
Retry 0: Bad CRC
Retry 0: Got ERROR
  91264 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
Retry 0: Bad CRC
Retry 0: Got ERROR
  91264 ZMODEM    Retry 0: Bad CRC
  97088 ZMODEM    Retry 0: Bad CRC
 104087 ZMODEM    Retry 0: Bad CRC
 114043 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
 114453 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
 114453 ZMODEM    Retry 0: Bad CRC
 121168 ZMODEM    Retry 0: Bad CRC
 130783 ZMODEM    Retry 0: Bad CRC
 134146 ZMODEM    Retry 0: Bad CRC
 139986 ZMODEM    Retry 0: Bad CRC
 150894 ZMODEM    Retry 0: Bad CRC
 154986 ZMODEM    Retry 0: Bad escape sequence e7
Retry 0: Garbled data subpacket
 161261 ZMODEM    Retry 0: Bad CRC
 172461 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
 172875 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
 173281 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
 173281 ZMODEM    Retry 0: Bad CRC
 177323 ZMODEM    Retry 0: Bad escape sequence 75
Retry 0: Garbled data subpacket
 181122 ZMODEM    Retry 0: Bad CRC
 188257 ZMODEM    Retry 0: Bad CRC
 191536 ZMODEM    Retry 0: Bad escape sequence 34
Retry 0: Garbled data subpacket
Retry 0: Bad CRC
Retry 0: Got ERROR
 192355 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
 193176 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
 193652 ZMODEM    Retry 0: Bad CRC
Retry 0: Got ERROR
Retry 0: Got ERROR
 193652 ZMODEM    Retry 0: Bad CRC
 194075 ZMODEM    Retry 0: Data subpacket too long
Retry 0: Got ERROR
Retry 0: Got ERROR
 194075 ZMODEM    Retry 0: Bad CRC
 195704 ZMODEM    Retry 0: Bad escape sequence b2
Retry 0: Garbled data subpacket
 197813 ZMODEM    Retry 0: Bad CRC
 201226 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
 201226 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
Retry 0: Bad CRC
Retry 0: Got ERROR
 201226 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
 202035 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
Retry 0: Bad CRC
Retry 0: Got ERROR
 202450 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
 207049 ZMODEM    Retry 0: Bad CRC
 210827 ZMODEM    Retry 0: Bad CRC
 214573 ZMODEM    Retry 0: Bad CRC
 220324 ZMODEM    Retry 0: Bad CRC
 231032 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
 231448 ZMODEM    Retry 0: Bad escape sequence 2a
Retry 0: Garbled data subpacket
 232765 ZMODEM    Retry 0: Bad escape sequence e5
Retry 0: Garbled data subpacket
 238634 ZMODEM    Retry 0: Bad CRC
 249835 ZMODEM    Retry 0: Bad escape sequence b5
Retry 0: Garbled data subpacket
Retry 0: Bad CRC
Retry 0: Got ERROR
 250665 ZMODEM    Retry 0: Bad CRC
Retry 0: Bad CRC
Retry 0: Got ERROR
 251076 ZMODEM    Retry 0: Bad CRC
 256467 ZMODEM    Retry 0: Bad CRC
 267154 ZMODEM    Retry 0: Bad CRC
 271619 ZMODEM    Retry 0: Bad escape sequence b4
Retry 0: Garbled data subpacket
 277772 ZMODEM    Retry 0: Bad CRC
 288389 ZMODEM    Retry 0: Bad escape sequence 39
Retry 0: Garbled data subpacket
 292055 ZMODEM    Retry 0: Bad escape sequence 75
Retry 0: Garbled data subpacket
 297816 ZMODEM    Retry 0: Bad CRC
 308465 ZMODEM    Retry 0: Bad escape sequence 72
Retry 0: Garbled data subpacket
Retry 0: Bad CRC
Retry 0: Got ERROR
 308465 ZMODEM    Retry 0: Bad CRC
 309280 ZMODEM    Retry 0: Bad CRC
 315415 ZMODEM    Retry 0: Bad escape sequence ae
Retry 0: Garbled data subpacket
 326065 ZMODEM    Retry 0: Bad escape sequence 61
Retry 0: Garbled data subpacket
 329778 ZMODEM    Retry 0: Bad CRC
 331487 ZMODEM    Please read the manual page BUGS chapter!
#


Why is the "Retry" always 0??

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: ZMODEM debugging
PostPosted: Sun Dec 22, 2013 11:26 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
With
Code:
rz -vvvvvvvv < /dev/tty0 > /dev/tty0


zmodem logs a lot of debug information into /tmp/rzlog.
Interesting. Almost all entries there:
Code:
..
Calling read: alarm=10  Readnum=133 Read returned 2 bytes
Calling read: alarm=10  Readnum=133 Read returned 2 bytes
Calling read: alarm=10  Readnum=133 Read returned 1 bytes
Calling read: alarm=10  Readnum=133 Read returned 2 bytes
Calling read: alarm=10  Readnum=133 Read returned 2 bytes
Calling read: alarm=10  Readnum=133 Read returned 2 bytes
Calling read: alarm=10  Readnum=133 Read returned 1 bytes
Calling read: alarm=10  Readnum=133 Read returned 2 bytes..


and the last message before bus error:
Code:
..
Calling read: alarm=10  Readnum=133 Read returned 2 bytes
zgethdr: D 362 f798e018
rzfile: zgethdr returned 362

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: ZMODEM debugging
PostPosted: Sun Dec 22, 2013 12:11 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
A successful (8 'v's there)
Code:
rz -vvvvvvvv

of a 31.9kB large file generated an 1.25MB large rzlog, filled mostly with
Code:
..
Calling read: alarm=10  Readnum=133 Read returned 2 bytes
Calling read: alarm=10  Readnum=133 Read returned 1 bytes
Calling read: alarm=10  Readnum=133 Read returned 2 bytes
Calling read: alarm=10  Readnum=133 Read returned 2 bytes
..


wc shows

Code:
# wc rzlog
   22002  173170 1254579 rzlog
#


that is 22k lines of mostly the above message, with an average of "Read returned 1.5bytes" it gives 31.9kB of the file size transferred.. :shock:

On the first glance it seems the input buffer of size 133bytes
rz.c:
Code:
/*
 * Max value for HOWMANY is 255.
 *   A larger value reduces system overhead but may evoke kernel bugs.
 *   133 corresponds to an XMODEM/CRC sector
 */
#ifndef HOWMANY
#define HOWMANY 133
#endif

gets filled only with few bytes in average.. :cry:

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: ZMODEM debugging
PostPosted: Sun Dec 22, 2013 12:39 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
With 10vs
Code:
rz -vvvvvvvvvv

and an another rz attempt with the same file as above I get 3.5 bytes in an average per read line, each line shows probably the bytes transferred:

Code:
..
Calling read: alarm=10  Readnum=133 Read returned 6 bytes 3f d0 77 ff 18 c3
Calling read: alarm=10  Readnum=133 Read returned 4 bytes 18 47 ca 18
Calling read: alarm=10  Readnum=133 Read returned 4 bytes 5f 6e a0 18
Calling read: alarm=10  Readnum=133 Read returned 3 bytes cc ca ff
Calling read: alarm=10  Readnum=133 Read returned 3 bytes 37 f5 18
Calling read: alarm=10  Readnum=133 Read returned 3 bytes c3 57 18
..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: ZMODEM debugging
PostPosted: Sun Dec 22, 2013 5:42 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Not sure I do understand this readline() function. It is called 10x in rz.c with readline(1), thus the n=3 and it reads 2 bytes in an average (see above) what most probably is not good..
rz.c:
Code:
/*
 * This version of readline is reasoably well suited for
 * reading many characters.
 *  (except, currently, for the Regulus version!)
 *
 * timeout is in tenths of seconds
 */
readline(timeout)
int timeout;
{
   register n;
   static char *cdq;   /* pointer for removing chars from linbuf */

   if (--Lleft >= 0) {
      if (Verbose > 8) {
         fprintf(stderr, "%02x ", *cdq&0377);
      }
      return (*cdq++ & 0377);
   }
   n = timeout/10;
   if (n < 2)
      n = 3;
   if (Verbose > 5)
      fprintf(stderr, "Calling read: alarm=%d  Readnum=%d ",
        n, Readnum);
   if (setjmp(tohere)) {
#ifdef TIOCFLUSH
/*      ioctl(0, TIOCFLUSH, 0); */
#endif
      Lleft = 0;
      if (Verbose>1)
         fprintf(stderr, "Readline:TIMEOUT\n");
      return TIMEOUT;
   }
   signal(SIGALRM, alrm); alarm(n);
   Lleft=read(0, cdq=linbuf, Readnum);
   alarm(0);
   if (Verbose > 5) {
      fprintf(stderr, "Read returned %d bytes\n", Lleft);
   }
   if (Lleft < 1)
      return TIMEOUT;
   --Lleft;
   if (Verbose > 8) {
      fprintf(stderr, "%02x ", *cdq&0377);
   }
   return (*cdq++ & 0377);
}


Especially these lines (with n=3 with most calls):
Code:
..
   signal(SIGALRM, alrm); alarm(n);
   Lleft=read(0, cdq=linbuf, Readnum);
   alarm(0);..

Any clue?

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: ZMODEM debugging
PostPosted: Sun Dec 22, 2013 11:46 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
18MB uploaded @921kbaud:
uart2 115k2 - console, Teraterm
uart1 921k6 - HyperTerminal - Zmodem with Crash recovery

rz.c: HOWMANY = 255, SEGMENTS = 8, readline(50)

Code:
# rz < /dev/tty0 > /dev/tty0
rz ready. To begin transfer, type "sz file ..." to your modem program

Incoming: PIC32MZ_Harmony_help.pdf 18226780 12242134210 0
Receiving PIC32MZ_Harmony_help.pdf BIN w
 386048 ZMODEM    Retry 0: Bad CRC
1595392 ZMODEM    Retry 0: Bad CRC
1607680 ZMODEM    Readline:TIMEOUT
Retry 0: TIMEOUT
2557952 ZMODEM    Readline:TIMEOUT
Retry 0: Got TIMEOUT
Readline:TIMEOUT
Retry 0: TIMEOUT
3028992 ZMODEM    Retry 0: Data subpacket too long
3045376 ZMODEM    Readline:TIMEOUT
Retry 0: Got TIMEOUT
Readline:TIMEOUT
Retry 0: TIMEOUT
3416064 ZMODEM    Retry 0: Data subpacket too long
4834304 ZMODEM    Retry 0: Bad escape sequence f1
Retry 0: Garbled data subpacket
4853760 ZMODEM    Retry 0: Bad CRC
7670784 ZMODEM    Retry 0: Bad CRC
7692288 ZMODEM    Retry 0: Bad CRC
9090048 ZMODEM    Retry 0: Bad CRC
10507264 ZMODEM    Readline:TIMEOUT
Retry 0: TIMEOUT
11453440 ZMODEM    Retry 0: Bad CRC
12862464 ZMODEM    Readline:TIMEOUT
Retry 0: Got TIMEOUT
Readline:TIMEOUT
Retry 0: TIMEOUT
13332480 ZMODEM    Retry 0: Data subpacket too long
14768128 ZMODEM    Retry 0: Data subpacket too long
16143360 ZMODEM    Retry 0: Bad escape sequence 97
Retry 0: Garbled data subpacket
18027520 ZMODEM    Retry 0: Bad CRC
18226176 ZMODEM    Please read the manual page BUGS chapter!
# ls -l
total 17881
-rw-r--r--  1 root          176 Dec  5  2012 .profile
-rw-r-----  1 root     18226780 Nov 17 04:37 PIC32MZ_Harmony_help.pdf

The faster the better.. :)
It seems the TeraTerm's zmodem cannot recover from errors..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: ZMODEM debugging
PostPosted: Mon Dec 23, 2013 12:11 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
But still, the verbose log into rzlog shows tons of 3bytes reads - there must be a bug somewhere..
Code:
fb 40 55 Calling read: alarm=10  Readnum=255 Read returned 3 bytes
0b 85 0d Calling read: alarm=10  Readnum=255 Read returned 3 bytes
4b 61 b3 Calling read: alarm=10  Readnum=255 Read returned 3 bytes
55 d5 e2 Calling read: alarm=10  Readnum=255 Read returned 3 bytes


Also, the upload stops from time to time for 10-30secs, then continues. Why?

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: ZMODEM debugging
PostPosted: Tue Dec 24, 2013 7:16 am 
Committer

Joined: Thu Nov 08, 2012 3:55 am
Posts: 177
Code:
signal(SIGALRM, alrm);

Arranges for the function alrm() to be called if the SIGALRM signal is raised.

Code:
alarm(n);

Arranges for the SIGALRM signal to be raised in n seconds.

Code:
read...

...

Code:
alarm(0);

Cancels the previous request for the SIGALRM signal to be raised.

This implements a timeout on the call to the read function, ending in the "Readline:TIMEOUT" message in the trace when the timeout occurs. At least, that is what I gather from the alarm() docs.


Top
 Profile  
 
 Post subject: Re: ZMODEM debugging
PostPosted: Tue Dec 24, 2013 3:10 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Hi madscifi, thanks, The Q is whether it works as advertised :)
After a lot of experiments:
1. the best results are with upload via a separate channel, ie uart1 and with HyperTerminal (I did several successful rz uploads of 18MB large file)
2. it does not matter what is the baud speed - it works with 1Mbit/sec fine (and ~39kBytes/sec upload speed at 1MBbit/sec, 8N1)
3. It does not matter what is the HOWMANY, the same behavior/speed for 24, 32, 133, 255
4. It does matter what is the SEGMENT
a. without -DSEGMENTS=x in makefile it is slow (it repeats each packet sent then)
b. with -DSEGMENTS=1..16 it buffers incoming data into blocks (x*1024), and the average upload speed is higher with larger block, saturated at -DSEGMENTS=4
5. I see no impact of -DNFGVMIN
6. Behavior - in each case it stops from time to time for 10-60secs and waits then continues (or stops forever) - this needs to be understood somehow..

PS: I've found two newer source codes for the zmodem:
1. lrzsz_dm6467t.tar.gz (2011) https://ohse.de/uwe/software/lrzsz.html
2. rzsz.zip (2010/11) ftp://omen.com/pub/zmodem/
Both are some "improvements" of the classic zmodem source code from the bsd tape we have got.

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: ZMODEM debugging
PostPosted: Tue Dec 24, 2013 5:23 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Btw, our rz offers more options than advertised:
edit in rz.c:
Code:
usage()
{
   cucheck();
   fprintf(stderr,"Usage:   rz [-+abDepqtuvy]      (ZMODEM)\n");
   fprintf(stderr,"or   rb [-abuvy]      (YMODEM)\n");
   fprintf(stderr,"or   rx [-abcv] file   (XMODEM or XMODEM-1k)\n");
   fprintf(stderr,"     -+ append transmitted data to an existing file\n");
   fprintf(stderr,"     -a ASCII transfer (strip CR)\n");
   fprintf(stderr,"     -b Binary transfer for all files\n");
#ifndef vax11c
   fprintf(stderr,"     -c Use 16 bit CRC   (XMODEM)\n");
#endif
    fprintf(stderr,"     -D Output file to /dev/null\n");
   fprintf(stderr,"     -e Escape control characters   (ZMODEM)\n");
    fprintf(stderr,"     -p Skip file if destination exists\n");
    fprintf(stderr,"     -q Quiet suppresses verbosity\n");
    fprintf(stderr,"     -t tim Change Rxtimeout to tim tenths of seconds (10-1000)\n");
   fprintf(stderr,"     -u Do not make file pathnames lower case \n");
   fprintf(stderr,"     -w n Rx window size to n bytes (ZMODEM)\n");
   fprintf(stderr,"     -v Verbose more v's give more info\n");
   fprintf(stderr,"     -y Yes, clobber existing file if any\n");
   fprintf(stderr,"%s %s for %s by Chuck Forsberg, Omen Technology INC\n",
     Progname, VERSION, OS);
   fprintf(stderr, "\t\t\042The High Reliability Software\042\n");
   exit(SS_NORMAL);
}


The -D option is interesting for testing - it writes to /dev/null..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron




Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission