Using Linux USB Gadget - Need to Capture Retrieve Events

Referring to this link: http://www.linux-usb.org/gadget/file_storage.html

I'm doing it:

  • I get some Beagle Board data on Angstrom Linux and send it to an SD card by installing it on Board Beagle. Now I will unmount the card from the Beagle board and use the gadie g_file_storage USB driver to install the SD card on the host.
  • Now, after the host receives data from the SD card, I want to remove the driver from the BB and install the SD card on the Beagle board and use the storage on the Beagle board again.

But

  • How will the Beagle Council know when to uninstall a gadget driver?
  • How to capture a USB host on a Beagle board?

If I use the Beagle Board as a USB storage device, I run into this problem.

After a Google search, the following alternatives were achieved for me:

  • Is there some kind of composite driver concept in which a mass storage class can be used along the side, say: a UART interface using the same physical USB communication path to send commands from the host to the Beagle board, which can help the aforementioned operation. Please help me if I am wrong. Please suggest.

or

  • Can I capture an extraction event in a Beagle panel using g_file_storage?

or

+4
source share
1 answer

Host extraction is displayed as one of two events:

  • "SetConfiguration" request with wValue 0
  • power loss on USB contacts

The former can be easily detected, the latter requires hardware support.

0
source

Source: https://habr.com/ru/post/1344558/


All Articles