On Wed, Apr 22, 2020 at 5:31 PM someone wrote:
Hey Jason,
Hope you are safe and doing well.
Wondering if the BeagleBone Green or other variants can act as a usb host and client at the same time.
On 2 separate ports, yes. The USB specification itself does not support multi-master. Man, makes me miss IEEE-1394 every time.
I.e. connect USB flash drive to beagle bone, and have the beagle bone act as a larger flash drive when plugged into a client?
Sure. You can have the BeagleBone act as a USB storage device and you can add intermediary layers that perform transactions on other devices, including a USB host port.
I'd suggest you also look at
https://github.com/microsoft/uf2-linux to see the way they used network-backed block device (NBD) to create a daemon that listens for the block accesses. This can be pretty tricky, but you can fake all sorts of storage handling in-between.
The use case is a multi boot USB tool - throw a bunch of ISOs on the BB and select which one you need, plug it in and boot the machine!
When structuring such a support e-mail, I always suggest with starting with what you are wanting to accomplish FIRST:
1) what you want to do
2) what you tried
3) what you expected
4) what you actually got (and why it isn't what you expected, if you know)
If you have a right way to control the UI, the files on your target disk, and the target disk is already mounted when you connect to your host, this is actually pretty trivial. You'd simply set the backing store of your of your gadget ahead of making the connection. USB ConfigFS makes this pretty easy.
|
echo "${log} enable USB mass_storage ${usb_image_file}" mkdir -p functions/mass_storage.usb0 echo ${usb_ms_stall} > functions/mass_storage.usb0/stall echo ${usb_ms_cdrom} > functions/mass_storage.usb0/lun.0/cdrom echo ${usb_ms_nofua} > functions/mass_storage.usb0/lun.0/nofua echo ${usb_ms_removable} > functions/mass_storage.usb0/lun.0/removable echo ${usb_ms_ro} > functions/mass_storage.usb0/lun.0/ro echo ${actual_image_file} > functions/mass_storage.usb0/lun.0/file
|
The ${actual_image_file} would need to point to the .iso on your target storage file system.