Introduction
The transfer speed of the USB connection must be verified to handle
iperf
Install
Petalinux doesn't come with iperf3 built in, so it must be built from source once booted.
First, download the source code from https://github.com/esnet/iperf and transfer it to the SD card.
Next, move the SD card to the CyDAQ and boot petalinux.
Now transfer the source from the SD card to the home directory, unzip, and install
cp /mnt/sd-mmcblk0p1/iperf-master.zip /home/root/iperf-master.zip
unzip /home/root/iperf-master.zip
cd iperf-master
./configure && make && make install
Similar steps might need to be taken on for the client as well, as it requires iperf3 to be installed. You probably don't have to transfer the source over SD card, as your host PC most likely has internet connectivity.
Test
On petalinux, start the iperf3 server
iperf3 -s
On a connected device (with iperf3 also installed), start the test
iperf3 -c 169.254.7.2 -f M
Here are my iperf3 test results
scp
After implementing SCP functionality into the CLI tool and running a sample from the GUI, the following output was observed:
Although this number of 4.8MB/s isn't as high as the network connection can handle (as shown with iperf), it's still within our acceptable minimum of 2 million samples per second.
Note: Further testing of the SCP connection to increase transfer speed can be done here, such as changing the compression and encryption algorithms used. Doing so was not part of the testing due to time constraints.
USB Speed testing conclusion
It's clear that high transfer speeds are capable between Petalinux and a host PC over USB over the Ethernet Gadget. The SCP connection speeds were acceptable, but could be improved. It is also worth investigating other network file transfer strategies, such as sockets, HTTP requests, or simply raw TCP file transfers. Our team didn't have enough time to investigate a better solution to this, but is worth investigating if network transfer speeds need to be increased for this project.