this is a continuation of the discussion in
http://forum.bela.io/d/35-disable-bela-as-a-usb-mass-storage-device-ok
but now I kind of understand is a bit more general, and might be useful to others.
(and perhaps others can also share more light on the matter, as I'm finding little documentation)
so bela/Xenomai is using the linux usb gadget interface to handle its usb port.
this is configured in :
/opt/boot-scripts/am335x_evm.sh
where you will find the line g_multi, which loads the 'multi' gadget, which allows the USB port (as configured above) to appear as a mass storage device AND a RNDIS ethernet device. its required as only one gadget can be loaded
as I mentioned in the above thread, though, you can just use the RNDIS network driver, without mass storage by using the g_ether gadget.
but (and point of this thread really) that I think other might find interest is g_midi, this means that bela will appear as a class compliant USB midi device!
as I mentioned you can only load one gadget, and unfortunately it appears g_midi is not available in g_multi.
so your choice is to edit the above file, and only have g_midi active. (ok if you have another network interface e.g. eth0) or you can switch them on the fly
you can do this using
modprobe -r g_multi
modprobe g_midi
the first line removes the current gadget (g_multi in this example) and second line activates new gadget.
note: g_midi is using defaults, but a better usb midi name could be defined in the g_midi config, which ive not located yet 😉
a quick look at the kernel, shows the compiled 'gadget' modules: g_acm_ms.ko g_cdc.ko g_hid.ko g_multi.ko g_printer.ko g_zero.ko g_ether.ko g_mass_storage.ko g_ncm.ko g_serial.ko
g_audio.ko g_ffs.ko g_midi.ko g_nokia.ko g_webcam.ko
unfortunately, Ive found very little documentation on any of this, and some of these (including midi) are marked as 'experimental'... and of course will often need additional configuration.
anyone know a good source of documentation (over and above the source code 😉) for these modules?
anyway, hope g_midi is useful to some, quite handy if you want your bela to appear as a usb midi device.
(by default it can already act as a usb midi host)