One neat little trick of having an OTG port is the capability to have the board act as any type of device you'd want it to be.. in my case, I wanted to emulate a disk drive for the heck of it..
I found this link particularly useful. g_file_storage.ko which is generated once you enable file storage gadget as a module in the kernel build.
Step 1: create the "disk" - essentially a file
dd bs=1M count=64 if=/dev/zero of=fs
fdisk fs (follow the steps in the link)
fdisk -lu fs
sudo losetup -o 4096 /dev/loop0 fs
sudo mkdosfs /dev/loop0
sudo mount -t vfat /dev/loop0 r
vim r/hellow.txt (put what ever files we want here)
sudo umount r
sudo losetup -d /dev/loop0
ensure that fs file exists in the filesystem of the target
Step 2: load it up..
insmod g_file_storage.ko file=./fs stall=n
where fs is the file which we created in the first place.. and that'z it.. once you connect the musb to a windows PC, it appears as a disk ;)...
BeagleBoard.org at ELC and SCaLE - It has been a big week for BeagleBoard.org. The next generation BeagleBone has been teased with a page open for registering interest. Matt Richardson crea...
2 months ago