Xmodem issues

瀏覽次數:401 次
跳到第一則未讀訊息

Bob Kircher

未讀,
2023年5月1日 下午6:46:492023/5/1
收件者:retro-comp
I recently completed an RC2014 Pro kit.  CP/M 2.2 seems to be working fine, so I now I want to add some programs to the system.  Grant Searle's download.com can get the job done, but I'd rather use a protocol such as xmodem.  However I can't get cmodem to work in either direction.

I am using minicom on a linux system.  The file transfer setup looks like this:
+------------------------------------------------------------------------------+          
|     Name             Program                 Name U/D FullScr IO-Red. Multi  |          
| A  zmodem     /usr/bin/sz -vv -b              Y    U    N       Y       Y    |          
| B  ymodem     /usr/bin/sb -vv                 Y    U    N       Y       Y    |          
| C  xmodem     /usr/bin/sx -X -vv              Y    U    N       Y       N    |          
| D  zmodem     /usr/bin/rz -vv -b -E           N    D    N       Y       Y    |          
| E  ymodem     /usr/bin/rb -vv                 N    D    N       Y       Y    |          
| F  xmodem     /usr/bin/rx -vv                 Y    D    N       Y       N    |          
| G  kermit     /usr/bin/kermit -i -l %l -b %b  Y    U    Y       N       N    |          
| H  kermit     /usr/bin/kermit -i -l %l -b %b  N    D    Y       N       N    |          
| I  ascii      /usr/bin/ascii-xfr -svn         Y    U    N       Y       N    |          
| J  ihex       /usr/bin/ascii-xfr -svn -c 5 -l Y    U    N       Y       N    |          
| K    -                                                                       |          
| L    -                                                                       |          
| M  Zmodem download string activates... D                                     |          
| N  Use filename selection window...... Yes                                   |          
| O  Prompt for download directory...... Yes                                   |          
|                                                                              |          
|   Change which setting? (SPACE to delete)                                    |          
+------------------------------------------------------------------------------+          

I issue this xmodem command on the CP/M machine: xmodem filename.ext /r /x0
Xmodem responds with:
File created
Receiving via CON

I then start the xmodem transfer in minicom.

The xmodem transfer progress window shows several (ten?) lines thus:
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: Retry Count Exceeded
Transfer incomplete

Any hints on what's wrong?

Derek Cooper

未讀,
2023年5月2日 凌晨2:25:462023/5/2
收件者:retro-comp
I don't see anything wrong with your settings, here are my settings from minicom on linux. (if you on a mac then you have to reconfigure these because SX/RX are in different locations) the -X should not be needed but does not change xmodem as such.

I do know that many linux distros do not install the external programs that minicom uses by default. Check you have installed lrzsz package. But it looks like it is present in you messages.
| C  xmodem     sx -vv                          Y    U    N       Y       N    |
| F  xmodem     rx -vv                          Y    D    N       Y       N    |

The Xmodem protocol says the sender (minicom) sits and waits for the receiver (xmodem) to send a NAK to start the transfer, like this:
SENDER                                      RECEIVER

                                        <-- NAK
SOH 01 FE Data[128] CSUM                -->
                                        <-- ACK
SOH 02 FD Data[128] CSUM                -->
                                        <-- ACK
SOH 03 FC Data[128] CSUM                -->
                                        <-- ACK
SOH 04 FB Data[128] CSUM                -->
                                        <-- ACK
SOH 05 FA Data[100] CPMEOF[28] CSUM     -->
                                        <-- ACK
EOT                                     -->
                                        <-- ACK

You seem to be getting the NAK but sx is not responding. In the past I have seen two main causes for that:

1, timing, xmodem has given up waiting while you have been looking for the file to send! You only get around 20 seconds before this happens.
2, hardware flow control is not setup correctly. ie your USB/serial adapter does not support or you have not connected RTS/CTS correctly.

Try turning off hardware flow control, just to see if you get a different message. Don't forget to put it back.

You could also try using SCREEN to see if you get a different/same issue (you can google search for this)

Using “screen” as terminal emulator under UNIX/LINUX
To start a session, type “screen” followed by the serial device name and baud rate:
Unix prompt> screen /dev/ttyUSB0 115200
To get to screen commands, type ctrl-a followed by a command character. To see a list of commands,
type ctrl-a : (no space after ctrl-a, ctrl is not held for : , yes it's a colon!).
other examples of ctrl-a
To exit the current screen, type ctrl-a k
To exit all screens (if multiple started by mistake), type ctrl-a \
Some versions of screen may require ctrl-a ctrl-\

To send a file with XMODEM, type ctrl-a : (colon is the command character), then at the prompt, type:
exec !! sx [-a] filename

(Use –a to convert single new-line characters to CR/LF pairs.)
To receive a file with XMODEM, type ctrl-a : (colon is the command character), then at the prompt,
type:
exec !! rx [-a] filename
(Note: The first ! tells sx/rx to get stdin through screen’s input connection. The second ! tells sx/rx to
route stdout through screen’s output connection.)

you can also receive files this way. 

Hope some of this helps
Have fun

Derek

Bob Kircher

未讀,
2023年5月2日 晚上8:35:542023/5/2
收件者:retro-comp
Thanks for the reply, Derek, but screen isn't working either.  Here's a transcript of the result:

A>c:xmodem testfile /r /x0

File created
Receiving via CONSending UU, 9 blocks: Give your local XMODEM receive command now.                      
Xmodem sectors/kbytes sent:   0/ 0kRetry 0: Got 52 for sector ACK

Retry 0: NAK on sector
Retry 0: Got 73 for sector ACK

Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: Retry Count Exceeded

Transfer incomplete

ABORT: 10 block errors
Empty file deleted
A>

I should mention that yes I do have sz and rz (which sx and rx are symlinked to).  Furthermore, xmodem does work fine with Lee Hart's Z80 Membership Card but does not work on Donn Stewart's CPUville Z80 system.  Donn included a pair of alternates to xmodem, pcget.com and pcput.com, which work with minicom (sx/rx).  Not sure why he felt the need to include those utilities, but I wonder if it's because of issues with xmodem.com.  I haven't looked at the source to pcget.com and pcput.com, but it might be worthwhile for me to do so.  I have some playing around to do, I think

-Bob

Derek Cooper

未讀,
2023年5月3日 中午12:59:142023/5/3
收件者:retro-comp
I had another play with screen, and my transfers failed as well. However if I type the exec command line into a text editor the cut and past it - it works fine? No idea why.

I think it's more likely a handshake issue i think. Did you compile your own version of xmodem? Ages ago I found a couple of programs written for the esp32 running a cp/m emulator. The author had a couple of bugs in them but I fixed those and noe have them on github, Give them a try.


Derek

Pellatonian

未讀,
2023年5月3日 下午2:48:452023/5/3
收件者:retro-comp
PCGET.COM & PCPUT.COM came from Mike Douglas and were part of the early software distributed with his Altair Clone. The code is a bit of a lash up based on XMODEM.COM according to the comments.

I've used it on all my systems since 2016. It is relatively simple to get going. You alter it to talk to directly whatever serial chip you are using and adjust the timing loops to produce the correct timout detection for the target system. Absolutely non-portable at the object code level.

It doesn't use interrupts or hardware flow control and, on my systems at least, never needs character or line delays from the system it talks to. Used by me successfully on Z80s from 4MHz up to Z180s clock doubled to 36MHz at 115200.

Bob Kircher

未讀,
2023年5月9日 下午1:19:442023/5/9
收件者:retro-comp
After much thrashing around and checking out several xmodem alternatives, I simply lowered the baud rate from 115200 to 38400 and now all works fine.
回覆所有人
回覆作者
轉寄
0 則新訊息