In this project, we show different ways you can set up RzBoard, working either from a Linux host or a windows Host.
Hardware SetupVerify that the USB to serial cable is connected properly.
RXD is RzBoard's Receiver, which means the transmitting cable to Rzboard goes there. The Same for TXD which is RzBoard's Transmitter to the other device.
The RED cable connector should not be connected.
Linux Host setup: Network boot from an NFS Root Filesystem for RZBoard V2LTo set up network boot for RzBord, we need to configure the Ubuntu host system and also configure Rzboard. We will use these pre-built images from RZBoard_EdgeImpulse_Netboot. Download it and unzip it.
Setup on the host Ubuntu PCFollowing are the steps to configure a network boot for RzBoard on the host system.
- Setup a TFTP Server on the Ubuntu PC
Enter the following to install the TFTP server, as well as the NFS server utilities:
bn@nc:~$ sudo apt-get update
bn@nc:~$ sudo apt-get install tftp tftpd-hpa nfs-common nfs-kernel-server cu
Create a directory for the TFTP server:
bn@nc:~$ sudo mkdir /tftpboot
Set up 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"
$ sudo nano /etc/default/tftpd-hpa
Start the TFTP server, then confirm it has started using the commands below:
bn@nc:~$ sudo systemctl enable tftpd-hpa
bn@nc:~$ sudo systemctl restart tftpd-hpa
bn@nc:~$ sudo chmod 777 /tftpboot
bn@nc:~$ sudo echo “Hello” > /tftpboot/hello.txt
bn@nc:~$ sudo tftp localhost
> get hello.txt
If no error message is displayed, the TFTP server is successfully started. Enter q to exit from the tftp prompt. Note: If the above command did not show the expected result, then you should restart the Ubuntu hostPC, and try this again.
Locate RZBoards Linux kernel Image file and devicetree rzboard.dtb file and copy these into the TFTP server folder at /tftpboot.
The files, after building yocto image according to the instructions from meta-rzboard/README.md, will be in this folder:"/<work_dir>/yocto_rzboard/build/tmp/deploy/images/rzboard".
bn@nc:~$ sudo cp <PATH_to_FILE>/Image /tftpboot
bn@nc:~$ sudo cp <PATH_to_FILE>/rzboard.dtb /tftpboot
$ ls -l /tftpboot/
total 21632
-rw-rw-r-- 1 bn bn 12 Jan 27 14:19 hello.txt
-rw-r--r-- 1 root root 22168064 Jan 27 14:58 Image
-rw-r--r-- 1 root root 44941 Jan 27 15:05 rzboard.dtb
- Setup an NFS Server on the Ubuntu PC
Start the NFS server and create a directory for RZBoards NFS service:
bn@nc:~$ sudo /etc/init.d/nfs-kernel-server start
bn@nc:~$ sudo mkdir /nfs/rzv2l -p
Modify 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)
bn@nc:~$ sudo nano /etc/exports
bn@nc:~$ cat /etc/exports
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
#
/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.
bn@nc:~$ sudo exportfs -a
bn@nc:~$ showmount -e localhost
Export list for localhost:
/nfs/rzv2l *
Note: If the 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 the NFS server already started) to extract the RZBoard file system into the NFS server folder:
bn@nc:~$ sudo tar xfj <PATH_to_FILE>/avnet-core-image-rzboard.tar.bz2 -C /nfs/rzv2l
bn@nc:~$ ls /nfs/rzv2l/
bin dev home lib64 mnt run sys usr
boot etc lib media proc sbin tmp var
- Set a Shared IP Address for Ubuntu PC's Ethernet Interface
For the Ethernet communication between the host PC and RZBoard, Edit wired Connections through a Linux wired connection settings and set the ipv4's connection method to "shared". Alternatively, Network-manager offers a built-in interactive console to achieve the same. You can set up a shared connection using these commands:
bn@nc:~$ sudo nmcli connection edit type ethernet
nmcli> set ipv4.method shared
nmcli> save
nmcli> quit
Check the shared ip_address.
bn@nc:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp89s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 88:ae:dd:0a:cf:b6 brd ff:ff:ff:ff:ff:ff
inet 10.42.0.1/24 brd 10.42.0.255 scope global noprefixroute enp89s0
valid_lft forever preferred_lft forever
inet6 fe80::8f3c:8cc:8c52:ddb9/64 scope link noprefixroute
valid_lft forever preferred_lft forever
- Setup Serial Communication on the Ubuntu PC
Connect the USB-serial cable fly-leads to the RZBoard J19 header Connect this cable USB type-A connector to the Ubuntu host PCOn the Ubuntu PC, retrieve the name of this ttyUSB device using this command:
bn@nc:~$ ls -l /dev/serial/by-id/
total 0
…-> ../../ttyUSB0
Change permission of this ttyUSB serial port, and set up its serial mode:
bn@nc:~$ sudo chmod 666 /dev/ttyUSB0
bn@nc:~$ cu -s 115200 -l /dev/ttyUSB0 --parity none --nostop
Open another console on Ubuntu PC and change RTS/CTS flow-control option:
bn@nc:~$ stty -F /dev/ttyUSB0 -crtscts
When ready to end serial communication, enter "~."
to exit.
On the RZBoard, press and hold the S1 button to power on the RZ/V2L.Verify that the U-boot/Linux boot messages display via serial cable.
Return to the first console,immediately following the power-up of RzBoard, and repeatedly press the ENTER key to interrupt the u-boot autoboot sequence.
At the u-boot console prompt, enter the new u-boot environment settings as follows:
bn@nc:~$ cu -s 115200 -l /dev/ttyUSB0 --parity none --nostop
Connected.
.
.
.
=> env default -a
=> setenv serverip 10.42.0.1
=> setenv boot_tftp 'dhcp 0x48080000 Image; dhcp 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
=> boot
Entering the boot command at end of this list restarts the bootloader sequence. After u-boot, log messages from the successful loading of Linux should be displayed.
- Log in with username
root
. - Password is
avnet
.
if your RzBoard does not have the latest Uboot, the following instruction will explain how to flash the bootloader onto the eMMC on the RZBoard.
Windows Host setupIf not already installed, download and install Tera Term serial terminal software: https://osdn.net/projects/ttssh2/downloads/74780/teraterm-4.106.exe/.
Plug in the USB-to-Serial Debug Console Cable to the PC. Ensure it is recognized by the Windows Device Manager. It should come up under Ports (Com & LPT).
Note! The Comm port number assigned by the PC may differ from the image above.
When working with a windows system Windows.bat files are used to reflash the eMMC.
Download the RZBoard-Linux-Yocto-UserManual-v2.1 document from the RZBoard product page for a detailed step-by-step procedure of eMMC flash programming. The key steps however are summarized here as follows.
Download RZBoard_EdgeImpulse_eMMC and unzip it
1) Prior to launching either of the.bat files, make sure of the following:
- RZboard is powered down!
- All Tera Term windows are closed!
- USB serial cable from PC has TX, RX, GND fly-leads connected to correct J19 header pins and the COM port has enumerated on the PC
- Ethernet cable from PC is connected to RZBoard and the Laptop/PC's Ethernet adapter IPv4 properties set a static IP address of 192.168.1.88
- The config.ini file has been edited to list: - the correct COM port for the attached USB-Serial cable- the correct name for the.wic Linux image file (if an updated version is used)
2) To reflash the bootloader images, set the bootmode to SCIF serial mode: This done by setting BOOT2=1 by strapping J19-pin1 to +5V(ie. connect fly-wire from J19-pin1 to J1-pin2 on the 40pin header)
With RZBoard powered OFF, from Windows file explorer run flash_bootloader.bat (this launches the applicable Tera Term macro using the edited config.inisettings) Choose eMMC as the flash to program, the macro then waits for power up...Press and hold S1 for 2 seconds to power-on RZBoard, the macro will now proceed. Wait for this to complete (<5 min). Make sure to shut down the Tera Term window after this has completed.
3) To reflash the Linux System image, set the boot mode to eMMC mode: ie. Set BOOT2=0 by removing the fly-wire previously used (in reflash of bootloader)
With RZBoard powered OFF, run flash_system_image.bat (this launches a different Tera Term macro, using the same saved config.ini settings)
Power-on RZBoard. A blue window should open and an Ethernet connection established within 30 seconds
Wait for the macro to complete (you shall see multiple blocks of data getting sent) with the sequence finishing in 5 to 10 minutes. After finishing, press any key to exit the BAT script. You will also then need to manually exit the Tera Term console.
RZBoard boot up
Open Tera Term and select the serial port associated with the USB-Serial adaptor then click OK.
In the Tera Term console select Setup from the top menu and then Serial Port. Change the speed to 115200 then click New Setting.
In the RZBoard, press and hold the S1 button to power on the RZ/V2L. Verify that the U-boot/Linux boot messages display via serial cable.
.
.
.
Poky (Yocto Project Reference Distro) 3.1.14 rzboard ttySC0
rzboard login: root
Password: avnet
After booting connect the RzBoad ethernet cable to your router for an internet connection. you will need the internet to set up edge impulse for RzBoad.
In the Tera Term Console ping your PC to ensure that the RzBoard is properly talking to your PC.
Comments
Please log in or sign up to comment.