Get the App
SLTechnology News&Howtos  ›  Servers  › 

A tutorial on Building TFTP Server based on SAIL-IMX6

Shulou Source: shulou.com Published: 2022-06-03 09:38:16 09月10日 Update

1. Install servers, clients, and daemons

# sudo apt-get install tftp-hpa tftpd-hpaxinetd

two。 Server configuration

First, create a tftpboot in the root directory and change the property to any user readability:

# cd /

# sudo mkdir tftpboot

# sudo chmod 777 tftpboot

Then, go to the directory / etc/xinetd.d/, and create a new file tftp in it, adding the specified contents to the tftp file:

# cd / etc/xinetd.d/

# sudo vi tftp

Add the following to the tftp file

Service tftp

{

Disable = no 138

Socket_type = dgram

Protocol = udp

Wait = yes

User = root

Server = / usr/sbin/in.tftpd

Server_args =-s / tftpboot-c

Per_source = 11

Cps = 100 2

}

Finally, modify the configuration file / etc/default/tftpd-hpa to

TFTP_USERNAME= "tftp"

TFTP_DIRECTORY= "/ tftpboot"

TFTP_ADDRESS= "0.0.0.0Vol 69"

TFTP_OPTIONS= "--secure-l-c-s"

Note: change "TFTP_DIRECTORY" to the path where the new tftpboot directory is located.

3. Restart the service

# sudo / etc/init.d/xinetd reload

# sudo / etc/init.d/xinetd restart

# sudo / etc/init.d/tftpd-hpa restart

4. Test server

Test it and create a new file under the / tftpboot folder

# touch abc

Go to another folder

# tftp 192.168.2.51 (192.168.2.51 is native IP)

# tftp > get abc

If you can download the server, you can use tftp to download the file after connecting the development board with PC through the network cable.

The tftp command is used as follows

Tftp your-ip-address

Enter the TFTP operation:

Connect: connecting to a remote tftp server

Mode: file transfer mode

Put: uploading files

Get: downloading files

Quit: exit

Verbose: displays detailed processing information

Tarce: displays the package path

Status: displays current status information

Binary: binary transfer mode

Ascii:ascii transfer mode

Rexmt: sets the timeout for packet transmission

Timeout: sets the timeout for retransmission

Help: help information

?: help information

5.] uboot uses tftp

(1)。 Connect the network port of the host and the development board with a network cable, and copy the compiled kernel image uImage and device tree files to the tftpboot directory.

(2)。 Enter the uboot phase, modify the environment variables and save:

Setenv

Ethaddr e6:97:d9:0c:f7:7a sets MAC

Setenv

Serverip 192.168.2.51 sets the IP of the tftp server

Setenv

Ipaddr 192.168.2.85 sets the local IP

Setenv

Image imx6qdl/zImage sets the kernel image to be downloaded locally on the tftp server

Setenv

Fdt_file imx6qdl/imx6q-s3-sabresd.dtb sets the device tree downloaded to the local on the tftp server

Setenv

Nfs_rootfs/ nfs_rootfs/imx6qdl-rootfs sets the NFS file system location

Saveenv

(3)。 Select Network Startup from the uboot menu

Restart the development board, and after u-boot starts, quickly press any key to enter the uboot menu.

-- MainMenu

0-- exitto uboot shell

1-- select boot mode

Enter serial number 1 to enter the startup type selection option

-- BOOTMODE Menu

0-- exitto upper menu

1-- bootfrom net

2-- bootfrom emmc

Enter serial number 1 to set the development board to start from the network, and then restart the development board.

Later, if you want to boot from emmc, you can also select boot from emmc.

Tags: File service server development information mode directory transfer selection content kernel serial number folder time network cable network menu device path mirror Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Linux Docker Xiaomi MariaDB