During application development on RZBoard, use of a network attached root file system will save you time and avoid wear-out of onboard flash devices.
In this project we will step through the process of how to:
Setup on the host Ubuntu PC:
- a TFTP Server
- an NFS Server
- the ethernet and serial interfaces
Setup on RZBoard:
- the U-Boot environment configuration for network boot
- Install Tera Term serial console application fromhttps://osdn.net/dl/ttssh2/teraterm-4.106.exe/
- Copy the relevant RZBoard files to the Ubuntu host PC, eg.
This section uses following packages.
- tftp
- tftpd-hpa
Enter the following to install the TFTP server, as well as the NFS server utilities, then create a directory for TFTP server:
$ sudo apt-get update
$ sudo apt-get install tftp tftpd-hpa nfs-common nfs-kernel-server cu
$ sudo mkdir /tftpbootSetup the TFTP server configuration file.Create /etc/default/tftpd-hpa file, containing the following configuration:
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftpboot"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="--secure"Start the TFTP server, then confirm it has started using the commands below:
$ sudo systemctl enable tftpd-hpa
$ sudo systemctl restart tftpd-hpa
$ sudo chmod 777 /tftpboot
$ sudo echo “Hello” > /tftpboot/hello.txt
$ sudo tftp localhost
> get hello.txtIf no error message is displayed, the TFTP server is successfully started.Enter q to exit from the tftp prompt
Note: If above command did not show the expected result, then you should restart the Ubuntu hostPC, and try this again
Locate RZBoard's Linux kernel Image file and devicetree rzboard.dtb file and copy these into the TFTP server folder at /tftpboot
sudo cp <PATH_to_FILE>/Image /tftpboot
sudo cp <PATH_to_FILE>/rzboard.dtb /tftpbootSetup an NFS Server on the Ubuntu PCStart the NFS server and create a directory for RZBoard's NFS service:
$ sudo /etc/init.d/nfs-kernel-server start
$ sudo mkdir /nfs/rzv2l -pModify the NFS server configuration, by adding the following line at end of the /etc/exports file:
…
/nfs/rzv2l *(rw,no_subtree_check,sync,no_root_squash)Refresh the NFS server, then confirm the NFS server is successfully started by executing the following command. If the same result is shown, the NFS server is successfully started.
$ sudo exportfs -a
$ showmount -e localhost
Export list for localhost:
/nfs/rzv2l *Note: If above command did not show the expected result, please restart the Ubuntu PC, and try it again.
Locate the large Linux filesystem archive file, then execute the following command on the Ubuntu host PC (with NFS server already started) to extract the RZBoard file system into the NFS server folder:
$ sudo tar xfj <PATH_to_FILE>/core-image-weston-smarc-rzv2l.tar.bz2 -C /nfs/rzv2lSet a Static IP Address for Ubuntu PC's Ethernet InterfaceFor the Ethernet communication between host PC and RZBoard, the IP address of the Ubuntu PC must be static. Implement this using one of these two methods:
- Configure the DHCP server of your network router to reserve / always assign the same IP address (eg. 192.168.1.77) to the Ubuntu host PC
- Alternatively, disable the default network settings on the Ubuntu PC, then create a new network netplan.yaml file, specifying this static IP address. eg.Disable the network settings:
$ sudo mv /etc/netplan/01-network-manager-all.yaml /etc/netplan/01-network-manager-all.yaml.disabledCreate /etc/netplan/99-netcfg.yaml and add the following line (the name enp0s3 may be different, depending on environment):
network:
version: 2
ethernets:
enp0s3:
addresses: [192.168.1.77/24]
gateway4: 192.168.1.1
nameservers:
addresses: [192.168.1.1]
search: []
optional: trueRestart the network:
$ sudo netplan applySetup Serial Communication on the Ubuntu PCConnect the USB-serial cable fly-leads to the RZBoard J19 headerConnect this cable's USB type-A connector to the Ubuntu host PCOn the Ubuntu PC, retrieve name of this ttyUSB device using this command:
$ ls -l /dev/serial/by-id/
total 0
…-> ../../ttyUSB0Change permission of this ttyUSB serial port, and setup it's serial mode:
sudo chmod 666 /dev/ttyUSB0
cu -s 115200 -l /dev/ttyUSB0 --parity none --nostopOpen another console on Ubuntu PC to change RTS/CTS flow-control option:
stty -F /dev/ttyUSB0 -crtsctsWhen ready to end serial communication, enter "~." to exit.
Immediately following power-up of RZBoard, repeatedly press the ENTER key to interrupt the u-boot autoboot sequence.
At the u-boot console prompt, enter new u-boot environment settings as follows:
env default -a
setenv ipaddr 192.168.1.11
setenv serverip 192.168.1.77
setenv netmask 255.255.255.0
setenv ethaddr 02:11:22:33:44:55
setenv boot_tftp 'tftpboot 0x48080000 Image; tftpboot 0x48000000 rzboard.dtb; booti 0x48080000 - 0x48000000'
setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:/nfs/rzv2l,nfsvers=3 ip=${ipaddr}:${serverip}::${netmask}:rzv2l:eth0
setenv bootcmd run boot_tftp
saveenv
bootEntering boot command at end of this list, restarts the bootloader sequence.After u-boot, log messages from successful loading of Linux should be displayed.




Comments