use mass storage to send files from host to device

26 views
Skip to first unread message

wood...@trxsystems.com

unread,
May 8, 2020, 3:07:49 PM5/8/20
to BeagleBoard
I'm stuck on this and while I don't expect anyone to answer, I would greatly appreciate it. 
I understand that the g_multi gadget has backing storage for the mass storage device in /var/cache/doc-beaglebone-getting-started.
I know that if I want to read from this storage, I have to do it while the storage is not in use. 
I think I should be able to mount and read the backing storage before am335x_evm.sh is run (this is the code which configures the g_multi gadget and enables it). However, when I do this the contents of 
the backing storage disappear. What could be going wrong?

For reference, this is how i'm attempting to read the storage:
I edited am335x_evm.sh to make the device read/write
I pointed /var/local/bb_usb_mass_storage.img to another file: /root/data/backing_storage - a fat32 partition with 512 byte sectors starting at sector 2048
I created the following directory: /mnt/loop

losetup -o 1048576 /dev/loop0 /root/data/backing_file
mkdosfs -F 32 /dev/loop0
mount -t vfat /dev/loop0 /mnt/loop
ls /mnt/loop >> /var/log/messages
umount /dev/loop0
losetup -d /dev/loop0

William Hermans

unread,
May 8, 2020, 5:38:43 PM5/8/20
to beagl...@googlegroups.com
I'm not sure what's going on with g_multi for you there. But I will say this. There are other, probably better suited options for moving files over to the device. 

I've used g_multi in the past and have always found it problematic for this platform. So personally, I dedicated a cheap netbook to operate as a server for the beaglebone(black), and just used NFS shares, and Samba for my dev workstation.

Another option would be to use ssh file transfers, after running a ssh server on the beaglebone.

It really depends on what you're trying to do, and your dev system.

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/77acb0c3-3fb1-418b-8b31-32d87bf3be71%40googlegroups.com.

Dennis Lee Bieber

unread,
May 9, 2020, 12:14:53 PM5/9/20
to Beagleboard
On Fri, 8 May 2020 16:37:58 -0600, in gmane.comp.hardware.beagleboard.user
William Hermans <yyrkoon-Re5JQEe...@public.gmane.org> wrote:

>
>Another option would be to use ssh file transfers, after running a ssh
>server on the beaglebone.
>

Unless the OP is running a highly customized OS on the Beagle, SSH (and
SFTP) should be available natively.

{Disconnecting CAT-5 cable from BBB, using just the USB to my Win10
computer}

FileZilla in SFTP mode connects with no problem...
WinSCP connects with no problem...
PsFTP connects with no problem...

C:\Users\Wulfraed>psftp debian@beaglebone
Using username "debian".
Pre-authentication banner message from server:
| Debian GNU/Linux 10
|
| BeagleBoard.org Debian Buster IoT Image 2020-04-06
|
| Support: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian
|
| default username:password is [debian:temppwd]
|
End of banner message from server
debian@beaglebone's password:
Remote working directory is /home/debian
psftp>


debian@beaglebone:~$ uname -a
Linux beaglebone 4.19.94-ti-r42 #1buster SMP PREEMPT Tue Mar 31 19:38:29
UTC 2020 armv7l GNU/Linux


--
Dennis L Bieber

wood...@trxsystems.com

unread,
May 11, 2020, 8:12:49 AM5/11/20
to BeagleBoard
Thank you William and Dennis for the feedback. 
It turns out that executing the command 'mkdosfs -F 32 /dev/loop0' prior to attempting to read the backing storage was incorrect. This creates a new file system and overwrites the old one. I should only have used that command once when the backing storage was created. 

Reply all
Reply to author
Forward
0 new messages