Update Petalinux Introduction authored by Corbin Kems's avatar Corbin Kems
......@@ -12,7 +12,7 @@ This project uses Petalinux primarily because it comes with USB/Serial/Ethernet
All the necessary files are located in the [petalinux](https://git.ece.iastate.edu/sd/sdmay23-47/-/tree/master/petalinux) directory at the root of the project. That directory then splits into three subdirectories that operate as follows:
- [hw](https://git.ece.iastate.edu/sd/sdmay23-47/-/tree/master/petalinux/hw) - The hardware project created in Vivado, which exports a `.xsa` file that is used by petalinux tools.
- [hw](https://git.ece.iastate.edu/sd/sdmay23-47/-/tree/master/petalinux/hw) - The hardware project created in Vivado, which exports a `.xsa` file that is used by petalinux tools and Vitis.
- [os](https://git.ece.iastate.edu/sd/sdmay23-47/-/tree/master/petalinux/os) - The petalinux OS project. All petalinux tools commands are ran in this directory.
- [sw](https://git.ece.iastate.edu/sd/sdmay23-47/-/tree/master/petalinux/sw) - Any applications we develop to run on petalinux go here, and are designed to be opened in Vitis.
......@@ -31,10 +31,36 @@ TODO link to external Vivado resources to learn how to use
Building petalinux requires petalinux tools, which can only run on Linux. Check out our [Petalinux Tools Install](https://git.ece.iastate.edu/sd/sdmay23-47/-/wikis/Petalinux-Tools-Install) for a guide on how to set that up in the Ubuntu development environment.
The main purpose of Petalinux is to allow for fast and stable communication between the CyDAQ and host pc over USB.
## USB kernel modules
We are using two USB gadgets to allow communication over USB.
- Abstract Control Model (ACM) USB Gadget: Simulates a serial port on the host PC side.
- Ethernet Control Model (ECM) USB Gadget: Simulates an ethernet connection on the host PC side. Each CyDAQ is configured to have the static ip `169.254.7.2`. In other words, when the CyDAQ is plugged into a PC, you can ping, ssh, etc to that ip.
Each USB gadget shows up in windows as a separate device. The ACM gadget is a COM port and the ECM as a network interface. Both should auto configure, so the CyDAQ should be plug and play!
The configuration of the two Gadgets is done using ConfigFS. The script that runs on petalinux startup is located [here](https://git.ece.iastate.edu/sd/sdmay23-47/-/blob/master/petalinux/os/project-spec/meta-user/recipes-apps/bootscript/files/bootscript).
# SW - Vitis
Check out our [Vivado/Vitis Install](https://git.ece.iastate.edu/sd/sdmay23-47/-/wikis/Vivado-and-Vitis-Install) guide to learn how to install Vitis on your Ubuntu development environment.
TODO explain each exising application (comm and sampling?)
The software directory `<project root>/petalinux/sw/platform` contains the multiple software applications and the platforms associated with them.
- CyDAQ_platform: A linux platform project that points to the necessary petalinux SDK files generated by petalinux tools.
- CyDAQ_comm / CyDAQ_comm_system: The application that runs on petalinux which handles 1) communication with the host PC over serial and 2) communication to the sampling application running as standalone on the other CPU core.
- CyDAQ_standalone: A baremetal platform project that is designed to run on the `ps7_cortexa9_1` CPU core.
- CyDAQ_sampling / CyDAQ_sampling_system: The baremetal application that runs on the standalone platform. It listens for configuration requests from petalinux, configures the hardware (input select, sample rate, etc) accordingly, and communicates any information back to petalinux.
## Asymmetric Multi Processing (AMP)
We are using the OpenAMP library to communicate between Petalinux and baremetal applications. The [Libmetal and OpenAMP User Guide](https://docs.xilinx.com/v/u/2020.1-English/ug1186-zynq-openamp-gsg) is the official documentation for petalinux.
> Warning: The documentation linked above isn't the best. It is mainly written for the ZyboMP platform, which is slightly different then the Zybo Z7 board we are using.
OpenAMP is compatable with linux remoteproc, rpmsg, and VirtIO components, which we use to send commands and data from petalinux -> baremetal and baremetal -> petalinux.
# External Resources
Check out our [Useful Resources](https://git.ece.iastate.edu/sd/sdmay23-47/-/wikis/Useful-Resources) page for links to official documentation and other guides we used to develop this project.
......
......