Search code examples
fileuploadembeddedhyperterminalxmodem

Receiving a file via XModem on HyperTerminal


I have to send a file via serial port to my program that is running on an embedded device using HyperTerminal and XMODEM protocol. The serial communication is OK (9600 baud, 1 StopBit, No parity, 8 data bits, no flow control), because both sending commands and receiving answers work properly.

When I send the command "upload", the device answers when it's ready and waits for the file. In HyperTerminal, I then go to Transfer->Send File..., select a file and XMODEM protocol, then click "Send". After clicking send, the upload doesn't begin and appears a timeout message.

While debugging, I see that the program doesn't receive any byte from the serial port, but if I send a byte clicking a key the program receives it. Can I assume that the problem is that HyperTerminal doesn't send anything? Why is that?


Solution

  • XMODEM transfer is initiated by the receiver rather than the sender. The transfer starts when the receiving device sends an SOH (XMODEM) or 'C' (XMODEM-CRC/1K). If the receiving end does not initiate the transfer, no transfer will occur.

    You may find that you have to start the transfer from the sending end, then initiate the transfer at the receiver. Alternatively when waiting for the transfer the receiving end may repeatedly send teh start character until it gets a response (or times-out).