Difference between revisions of "Communicate with your board from a Linux Host (Basics)"

From ArmadeusWiki
Jump to: navigation, search
 
(Debian Jessie)
 
(30 intermediate revisions by 6 users not shown)
Line 1: Line 1:
==RS232 configuration==
+
==RS232 Terminal configuration==
We suggest you to use Kermit as Terminal emulator for RS232 connection. Minicom was sadly reported to have problems when communicating with U-Boot.
+
You will need a RS232 terminal emulator to communicate with U-Boot/Linux console. You can choose between:
 +
* [[Kermit]]
 +
* Minicom
 +
* GtkTerm
 +
We suggest you to use [[Kermit]] as Terminal emulator for RS232 connection. Minicom was sadly reported to have problems when communicating with U-Boot (ZModem data transfer).
 +
If you just need a simple serial console and not to transfer data through RS232, then '''GTKTerm''' is the perfect choice ! (package gtkterm in Ubuntu)
 +
{{Note|Your terminal should be configured with: '''115200 bauds 8N1''' parameters}}
  
===Kermit installation=== 
+
==TFTP server==
* On Ubuntu:
+
In order to send your image files (U-Boot, Linux, rootfs or FPGA's firmware) at higher speed to your Armadeus board, you can use the Ethernet link and [http://en.wikipedia.org/wiki/Trivial_File_Transfer_Protocol a TFTP server].
apt-get install gkermit
+
Once the server started, the files located in the server shared directory (''/tftpboot'' by default) will be accessible from the U-Boot/Linux TFTP clients.
or use Synaptic graphical package manager.
+
  
 +
===TFTP server installation=== 
 +
* On *Ubuntu / Debian:
 +
$ sudo apt-get install tftpd xinetd
 +
or use Synaptic<br>
 
* On Fedora:
 
* On Fedora:
  rpm -q gkermit
+
  # rpm -q tftpd xinetd
  
===Kermit configuration=== 
+
* Then create the directory that will contain all the files that the server will export (you have to be root to do that):
* Edit/Create .kermrc file in your $HOME directory and put it in:
+
  $ sudo mkdir /tftpboot
  set line /dev/ttyS0
+
  $ sudo chmod 777 /tftpboot
  set speed 115200
+
set carrier-watch off
+
set handshake none
+
set flow-control none
+
robust
+
set file type bin
+
set file name lit
+
set rec pack 1000
+
set send pack 1000
+
set window 5
+
set transmit linefeed on
+
* In this example, we assume that your serial port is ttyS0 (first serial port). Change this to correct value if necessary.
+
* If you use an USB<->Serial converter then serial port would surely be named like that: ttyUSB0
+
  
===Kermit usage===   
+
===Server configuration===   
* To launch it:
+
* Edit or create the configuration file ''/etc/xinetd.d/tftp'' and modify/add it the following lines:
  kermit -c
+
  # default: off
* To switch from terminal mode to command mode:
+
# description: The tftp server serves files using the trivial file transfer
  CTRL + \ + c
+
#      protocol.  The tftp protocol is often used to boot diskless
* To switch from command mode to terminal mode:
+
#      workstations, download configuration files to network-aware printers,
C-Kermit>c
+
#      and to start the installation process for some operating systems.
 +
service tftp
 +
{
 +
        socket_type            = dgram
 +
        protocol                = udp
 +
        wait                    = yes
 +
        user                    = root
 +
        server                  = /usr/sbin/in.tftpd
 +
        server_args            = -s /tftpboot
 +
#      disable                = yes
 +
}
 +
 +
* Restart xinetd service:
 +
  $ sudo killall -HUP xinetd
 +
* Put some files in ''/tftpboot''
 +
* To test it from U-Boot (if you already have the correct IP addresses, otherwise [[Target_Software_Installation#Configure_U-Boot|continue with Setup Basics here]]):
 +
<pre class="apf">
 +
BIOS> run download_uboot
 +
MAC: 00:1e:ac:00:00:01
 +
operating at 100M full duplex mode
 +
Using dm9000 device
 +
TFTP from server 192.168.0.2; our IP address is 192.168.0.10
 +
Filename 'apf9328-u-boot.bin'.
 +
Load address: 0x8000000
 +
Loading: ###########################################
 +
done
 +
Bytes transferred = 217656 (35238 hex)
 +
BIOS>
 +
</pre>
  
==TFTP server==
+
== Troubleshooting ==
In order to send your files (uBoot, Linux, rootfs ...) with higher speed to the armadeus board, you can use a tftp server.
+
Once the server started, the files located in the server shared directory (or current directory) will be accessible from the U-Boot TFTP client.
+
  
===TFTP server installation===
+
=== Debian Jessie ===
  
 +
On debian jessie, if we follow the tutorial above we get this error under U-Boot:
  
===Server configuration=== 
+
<pre class="target">
* Select the directory in which the files you want to sent to the Armadeus board are located ("Browse" button)
+
BIOS> run update_kernel
* Set the server address if necessary (must be your Host IP address)
+
Using FEC device
If the Armadeus board has been correctly configured (host address, netmask ...) the transfer will start immediately.
+
TFTP from server 192.168.0.214; our IP address is 192.168.0.11
 +
Filename 'testbench27_apf6_test-linux.bin'.
 +
Load address: 0xa0000000
 +
Loading: *
 +
TFTP error: 'Access violation' (2)
 +
Not retrying...
 +
</pre>
 +
 
 +
We can see the problem in log with this command :
 +
<pre class="host">
 +
$ sudo tailf /var/log/syslog | grep tftp
 +
Oct 23 08:43:29 fabien in.tftpd[24535]: connect from 192.168.0.11 (192.168.0.11)
 +
Oct 23 08:43:29 fabien tftpd[24536]: tftpd: trying to get file: testbench27_apf6_test-linux.bin
 +
Oct 23 08:43:29 fabien tftpd[24536]: tftpd: serving file from /srv/tftp
 +
</pre>
 +
 
 +
The tftpboot service seems to not follow the configuration file /etc/xinetd.d/tftp.
 +
 
 +
To solve problem temporarly, we can make a symbolic link in /srv directory :
 +
<pre class="host">
 +
cd /srv
 +
sudo ln -s /tftpboot tftp
 +
</pre>
 +
 
 +
=== (XXX) Debian jessie magic ===
 +
 
 +
Launch tftp manually :
 +
<pre class="host">
 +
sudo in.tftpd -l -s /srv/tftp/
 +
</pre>
  
 +
Found [https://bbs.archlinux.org/viewtopic.php?id=154523 here]
  
 
==Links==
 
==Links==
 
* [http://www.columbia.edu/kermit/ Kermit Homepage]
 
* [http://www.columbia.edu/kermit/ Kermit Homepage]
*
+
* [http://www.jls-info.com/julien/linux/ GTKTerm Homepage]
 +
* http://doc.ubuntu-fr.org/tftpd

Latest revision as of 09:58, 8 October 2015

RS232 Terminal configuration

You will need a RS232 terminal emulator to communicate with U-Boot/Linux console. You can choose between:

We suggest you to use Kermit as Terminal emulator for RS232 connection. Minicom was sadly reported to have problems when communicating with U-Boot (ZModem data transfer). If you just need a simple serial console and not to transfer data through RS232, then GTKTerm is the perfect choice ! (package gtkterm in Ubuntu)

Note Note: Your terminal should be configured with: 115200 bauds 8N1 parameters


TFTP server

In order to send your image files (U-Boot, Linux, rootfs or FPGA's firmware) at higher speed to your Armadeus board, you can use the Ethernet link and a TFTP server. Once the server started, the files located in the server shared directory (/tftpboot by default) will be accessible from the U-Boot/Linux TFTP clients.

TFTP server installation

  • On *Ubuntu / Debian:
$ sudo apt-get install tftpd xinetd

or use Synaptic

  • On Fedora:
# rpm -q tftpd xinetd
  • Then create the directory that will contain all the files that the server will export (you have to be root to do that):
$ sudo mkdir /tftpboot
$ sudo chmod 777 /tftpboot

Server configuration

  • Edit or create the configuration file /etc/xinetd.d/tftp and modify/add it the following lines:
# default: off
# description: The tftp server serves files using the trivial file transfer
#       protocol.  The tftp protocol is often used to boot diskless
#       workstations, download configuration files to network-aware printers,
#       and to start the installation process for some operating systems.
service tftp
{
       socket_type             = dgram
       protocol                = udp
       wait                    = yes
       user                    = root
       server                  = /usr/sbin/in.tftpd
       server_args             = -s /tftpboot
#       disable                 = yes
}

  • Restart xinetd service:
$ sudo killall -HUP xinetd
BIOS> run download_uboot
MAC: 00:1e:ac:00:00:01
operating at 100M full duplex mode
Using dm9000 device
TFTP from server 192.168.0.2; our IP address is 192.168.0.10
Filename 'apf9328-u-boot.bin'.
Load address: 0x8000000
Loading: ###########################################
done
Bytes transferred = 217656 (35238 hex)
BIOS>

Troubleshooting

Debian Jessie

On debian jessie, if we follow the tutorial above we get this error under U-Boot:

BIOS> run update_kernel 
Using FEC device
TFTP from server 192.168.0.214; our IP address is 192.168.0.11
Filename 'testbench27_apf6_test-linux.bin'.
Load address: 0xa0000000
Loading: *
TFTP error: 'Access violation' (2)
Not retrying...

We can see the problem in log with this command :

$ sudo tailf /var/log/syslog | grep tftp
Oct 23 08:43:29 fabien in.tftpd[24535]: connect from 192.168.0.11 (192.168.0.11)
Oct 23 08:43:29 fabien tftpd[24536]: tftpd: trying to get file: testbench27_apf6_test-linux.bin
Oct 23 08:43:29 fabien tftpd[24536]: tftpd: serving file from /srv/tftp

The tftpboot service seems to not follow the configuration file /etc/xinetd.d/tftp.

To solve problem temporarly, we can make a symbolic link in /srv directory :

cd /srv
sudo ln -s /tftpboot tftp

(XXX) Debian jessie magic

Launch tftp manually :

sudo in.tftpd -l -s /srv/tftp/

Found here

Links