@@ -42,6 +42,19 @@ On the petalinux side, the serial gadget shows up as a readable/writable file in
The configuration of the two Gadgets is done using ConfigFS. The script that runs on petalinux startup that does the filesystem-based configuration is located [here](https://git.ece.iastate.edu/sd/sdmay23-47/-/blob/master/petalinux/os/project-spec/meta-user/recipes-apps/bootscript/files/bootscript).
The correct kernel modules must also be enabled for them to work properly. This can be done with the following (they are already be enabled in this repo).
```bash
petalinux-config -c kernel
```
A configuration screen should open when the command completes.
Make sure the following are selected under `Device Drivers/USB Support/USB Gadget Support`
*`USB Peripheral Controller/<*> Xilinx USB Driver`
*`<M> USB Gadget functions configurable through configfs`
*`[*] Abstract Control Model (CDC ACM)`
*`[*] Ethernet Control Model (CDC ECM)`
*`[*] RNDIS`
## Device Tree
The device tree is used to define hardware (including memory allocation) in Petalinux. The main Device tree files are generated during the `petalinux-config --get-hw-description` command. We can modify the device tree by the device tree addon file which is located at [petalinux/os/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi](https://git.ece.iastate.edu/sd/sdmay23-47/-/blob/master/petalinux/os/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi), and any changes to it require a rebuild of petalinux to take effect.