Difference between revisions of "Serial Transfer"

From ArmadeusWiki
Jump to: navigation, search
 
(Microcom)
 
(32 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Instructions to use the serial port of your Armadeus board to communicate with your PC
+
Instructions to use the serial port of your Armadeus board to transfer files from/to your PC.
 +
{{Note|This page explains how to transfer files on the board when the Linux system has started, '''not from U-Boot !'''.
 +
To know how to configure serial link for U-Boot communication, [[Connection_with_U-Boot_on_Linux|it's here]].}}
  
 
==Introduction==
 
==Introduction==
  
When you only have a serial port to connect to your devt PC, then you can use Zmodem protocol to send/receive files to/from your Armadeus board
+
When you only have a serial link (RS232/USB) as connection with your devt PC (ie no Ethernet available), then you can use Zmodem protocol to send/receive files to/from your Shell/Console of your Armadeus board.
  
==Installation==
+
== Linux ==
  
when you build your root filessytem with buildroot, then modify your configuration:
+
===Installation===
[user@toto]$ make menuconfig
+
to add lrzsz package and then rebuild your rootfs
+
[user@toto]$ make
+
Check that lrz and lsz executable are present in your rootfs and if not copy them to there:
+
[user@toto]$ cp ./build_arm_nofpu/lrzsz-0.12.20/src/lsz ./build_arm_nofpu/root/usr/bin/
+
end then rebuild your rootfs
+
[user@toto]$ make
+
  
==Usage==
+
====Target (APF)====
 +
Modify your Buildroot configuration:
 +
<pre class="host">
 +
$ make menuconfig
 +
</pre>
 +
to add lrzsz package:
 +
<pre class="config">
 +
Package Selection for the target  --->
 +
    Networking applications  --->
 +
        [*]  lrzsz
 +
</pre>
 +
and then rebuild your rootfs:
 +
<pre class="host">
 +
$ make
 +
</pre>
  
You must use minicom as serial terminal and not kermit sorry ! :-(
+
Reflash it or manually copy ''rz'' and ''sz'' executables found in ''$ARMADEUS_ROOTFS_DIR/usr/bin/''.
After having booted your Armadeus system, launch lrz for receiving and lsz to send files:
+
  
Host --> Target
+
====Host====
  # cd /whereToPutTheFile/
+
* Install lrzsz package, if not already installed on your system. For example on Ubuntu/Debian:
  # lrz -bZ
+
<pre class="host">
then in minicom Ctrl+A then s and choose zmodem protocol and the file to send
+
  $ sudo apt-get install lrzsz
Wait a little and your file will be copied to your board rootfs ! ;-)
+
</pre>
 +
* Install minicom tool:
 +
<pre class="host">
 +
  $ sudo apt-get install minicom
 +
</pre>
 +
* The first time, configure minicom (as root):
 +
<pre class="host">
 +
$ sudo minicom -s
 +
</pre>
  
Target --> Host
+
===Usage===
# lsz -b --zmodem filename
+
  
==TBDL==
+
{{Warning| You must use [[minicom]] as serial terminal and not [[kermit]]/[[screen]], sorry ! :-(}}
 +
* Be sure to have correctly configured Minicom (line speed, 8N1, no flow control, and correct download/upload directories path).
 +
* Use '''rz''' for receiving and '''sz''' to send files:
 +
====Host (PC) --> Target (APF)====
 +
<pre class="apf">
 +
# cd /whereToPutTheFileOnTheTarget/
 +
# rz -bZ
 +
.. waiting to receive.
 +
</pre>
 +
* then in minicom do: '''Ctrl+a , s''' and choose zmodem protocol and the file to send.
 +
* Wait a little and your file will be copied to your board rootfs ! ;-)
  
==Links==
+
====Target (APF) --> Host (PC)====
 +
<pre class="apf">
 +
# cd /location/of_the/file_to_send/on_the_apf/
 +
# sz -b --zmodem filename
 +
</pre>
 +
Minicom handles the file receiving automatically (and put it in your $HOME by default, or the directory you configured in Minicom: Ctrl+z, o, ''Filenames and paths'', ''Download directory'')
  
 +
===TBDL===
 +
====Serial transfer through USB gadget as serial link====
 +
After having booted your board:
 +
* On your Target, open a new terminal on your serial link (here USB):
 +
<pre class="apf">
 +
# /sbin/getty -L ttygserial 115200 vt100
 +
</pre>
 +
* On your Host, launch Minicom and configure it to use ''/dev/ttyUSB1'' at 115200, then connect it to this terminal
 +
 +
===Transfer without terminal===
 +
* On your Target, launch receiving:
 +
<pre class="apf">
 +
# rz --zmodem 1>/dev/ttyXXX 0</dev/ttyXXX
 +
</pre>
 +
* On your Host, launch transfer:
 +
<pre class="host">
 +
$ sz --zmodem /tftpboot/afiletosend 1>/dev/ttyUSB1 0</dev/ttyUSB1
 +
</pre>
 +
 +
== UBoot ==
 +
 +
=== Minicom ===
 +
 +
With [[minicom]] use ymodem :
 +
 +
* type:
 +
<pre class="apf">
 +
BIOS> loady ${loadaddr}
 +
Ctrl+A Z
 +
</pre>
 +
* Select ymodem  then filename
 +
 +
==Links==
 
* http://www.ohse.de/uwe/software/lrzsz.html
 
* http://www.ohse.de/uwe/software/lrzsz.html
 +
 +
[[Category:Serial ports]]

Latest revision as of 17:31, 1 February 2022

Instructions to use the serial port of your Armadeus board to transfer files from/to your PC.

Note Note: This page explains how to transfer files on the board when the Linux system has started, not from U-Boot !.

To know how to configure serial link for U-Boot communication, it's here.


Introduction

When you only have a serial link (RS232/USB) as connection with your devt PC (ie no Ethernet available), then you can use Zmodem protocol to send/receive files to/from your Shell/Console of your Armadeus board.

Linux

Installation

Target (APF)

Modify your Buildroot configuration:

 $ make menuconfig

to add lrzsz package:

Package Selection for the target  --->
    Networking applications  --->
        [*]   lrzsz

and then rebuild your rootfs:

 $ make

Reflash it or manually copy rz and sz executables found in $ARMADEUS_ROOTFS_DIR/usr/bin/.

Host

  • Install lrzsz package, if not already installed on your system. For example on Ubuntu/Debian:
 $ sudo apt-get install lrzsz
  • Install minicom tool:
 $ sudo apt-get install minicom
  • The first time, configure minicom (as root):
 $ sudo minicom -s

Usage

Warning Warning: You must use minicom as serial terminal and not kermit/screen, sorry ! :-(
  • Be sure to have correctly configured Minicom (line speed, 8N1, no flow control, and correct download/upload directories path).
  • Use rz for receiving and sz to send files:

Host (PC) --> Target (APF)

 # cd /whereToPutTheFileOnTheTarget/
 # rz -bZ
 .. waiting to receive.
  • then in minicom do: Ctrl+a , s and choose zmodem protocol and the file to send.
  • Wait a little and your file will be copied to your board rootfs ! ;-)

Target (APF) --> Host (PC)

 # cd /location/of_the/file_to_send/on_the_apf/
 # sz -b --zmodem filename

Minicom handles the file receiving automatically (and put it in your $HOME by default, or the directory you configured in Minicom: Ctrl+z, o, Filenames and paths, Download directory)

TBDL

Serial transfer through USB gadget as serial link

After having booted your board:

  • On your Target, open a new terminal on your serial link (here USB):
 # /sbin/getty -L ttygserial 115200 vt100
  • On your Host, launch Minicom and configure it to use /dev/ttyUSB1 at 115200, then connect it to this terminal

Transfer without terminal

  • On your Target, launch receiving:
# rz --zmodem 1>/dev/ttyXXX 0</dev/ttyXXX
  • On your Host, launch transfer:
$ sz --zmodem /tftpboot/afiletosend 1>/dev/ttyUSB1 0</dev/ttyUSB1

UBoot

Minicom

With minicom use ymodem :

  • type:
BIOS> loady ${loadaddr}
Ctrl+A Z
  • Select ymodem then filename

Links