hendrixjl
Posts: 50
Joined: Sun Nov 04, 2012 9:22 pm
Location: Huntsville, Alabama, USA

Screen as a serial terminal

Tue Nov 27, 2012 5:20 pm

I've connected the usb to serial cable assembly sold by adafruit (http://www.adafruit.com/products/954) to my mac and my pi.
I'm trying to use screen as the terminal to to upload files for dwelch67's bootloader05 (https://github.com/dwelch67/raspberrypi ... otloader05). I don't seem to know what I'm doing. I've don this in a former life, though.

screen /dev/tty.PL2303-00004126 115200

At this point I'm stuck. I thought I should be able to issue an upload command using sx, but screen seems hung.

hendrixjl
Posts: 50
Joined: Sun Nov 04, 2012 9:22 pm
Location: Huntsville, Alabama, USA

Re: Screen as a serial terminal

Tue Nov 27, 2012 5:51 pm

I never seem to make progress until I make a post asking a question.

1) disconnect the power to the raspberry pi.
2) connect the usb-to-serial to the raspberry pi: just ground, tx and rx.
3) Plug the usb-to-serial into you computer
4) type "ls /dev/tty.*" and identify the usb-to-serial device
5) type, for example, "screen /dev/tty.PL2303-00004326 115200"
6) Connect the power to the raspberry pi.
7) Notice numbers received on the display from the raspberry pi.
8) Issue the upload command using Ctrl-A followed by ": sx -kb blinker.bin"

Now I'm stuck because the transfer is failing:Transfer incomplete
Sending blinker.bin, 1 blocks: Give your local XMODEM receive command now.
Xmodem sectors/kbytes sent: 0/ 0kRetry 0: NAK on sector
Xmodem sectors/kbytes sent: 1/ 0kRetry 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: NAK on sector
Retry 0: Retry Count Exceeded

Transfer incomplete

hendrixjl
Posts: 50
Joined: Sun Nov 04, 2012 9:22 pm
Location: Huntsville, Alabama, USA

Re: Screen as a serial terminal

Tue Nov 27, 2012 8:46 pm

The command is ": exec !! sx -kb blinker.bin"
Haven't got past the transfer error, though.

tufty
Posts: 1456
Joined: Sun Sep 11, 2011 2:32 pm

Re: Screen as a serial terminal

Wed Nov 28, 2012 8:57 am

From distant memory of using xmodem, that looks like a flow control issue. Maybe try kicking screen off with flow control off (-fn commandline switch)?

you might also want to try sx -b -X (which will reduce overall performance)

Simon

hendrixjl
Posts: 50
Joined: Sun Nov 04, 2012 9:22 pm
Location: Huntsville, Alabama, USA

Re: Screen as a serial terminal

Thu Nov 29, 2012 12:02 am

The "-b -X" did not make a difference. I did not find a "no flow control" switch (using "sx --help").
I was hoping dwelch67 would chime in. (Can't figure out how to send a private message.)

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Screen as a serial terminal

Thu Nov 29, 2012 1:13 am

In general, file transfers (through an **modem protocol) don't work through the "screen" connection.

I think there are various add-ons that function as workarounds for this.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

Vassius
Posts: 25
Joined: Sun Jun 03, 2012 7:56 pm

Re: Screen as a serial terminal

Thu Nov 29, 2012 8:13 pm

I wrote a very simple xmodem sender for exactly this purpose. It still only has the most basic functionality, but it works. Try it out if you like, just download the code from https://github.com/Vassius/xmUtil

hendrixjl
Posts: 50
Joined: Sun Nov 04, 2012 9:22 pm
Location: Huntsville, Alabama, USA

Re: Screen as a serial terminal

Fri Nov 30, 2012 5:04 pm

I'll give it a try. I succeeded in getting the xmodem transfer to work using minicom.
Thanks for the help.

Return to “Bare metal, Assembly language”