The Angstrom Distribution colibri-imx7 ttymxc0
Angstrom v2015.12 - Kernel 4.1.15-v2.6b2+g0ff849d
Colibri_iMX7_LinuxImageV2.6_20160630
I am seeing an error starting the usbg service:
[FAILED] Failed to start Load default USB gadget schema g1.schema.
See ‘systemctl status usbg.service’ for details.
There seem to be a couple of problems but unless I read it wrong it seems that the device tree sets the OTG1 port in host mode.
Yes, on the Colibri iMX7 the automatic USB device/host switching (e.g. based on VBUS cable detect resp. ID pin) is not implemented in our BSP as of yet and the OTG port defaults to host functionality. For the time being you would need to change the device tree in order to configure the OTG port for device functionality.
Loading the Gadget driver fails is due to missing Serial number in the device tree. The serial number from the device tree is passed to the USB Gadget descriptor so a host can read the serial number of the device.
For testing, the fdt_fixup allows to set the dr_mode property without recompiling the device tree:
You can disable the serial number coping by removing the ExecStartPost line which writes the serial number in /etc/systemd/system/multi-user.target.wants/usbg.service. With that USB Gadget should work fine.