Forums › Reference, Evaluation, and Development Boards › OSD3358-SM-RED › USB0 as OTG client
Tagged: mass storage device, OTG
Hello Octavo System team,
I am writing this post because I have development a custom board which is practically exact the same that the OSD3358 red board. I have follow the sch and layout reference file, the bring up process is correct, and the Linux is working. But I am trying to configure the usb0 as a OTG client and I am not able to configure the board as a mass storage device. I have set up the SD card following the same steps that in the tutorial for the beagle-bone black in digikey in this link.Â
My intention is configure the mass storage device with the dwc2 module. For that, I have added to the /boot/config.txt:
and /etc/modules: dwc2 but when I try to test the usb storage mode with this command:
The response is the following
I think that it can be caused because the usb0 is configured as a ssh communication because during the boot I can see the following traces:
I have removed the ssh over usb in the network/interface file but the response of the ifconfig command is the following:
eth0: flags=-28669<UP,BROADCAST,MULTICAST,DYNAMIC>Â mtu 1500
ether 98:5d:ad:2b:3d:4d txqueuelen 1000 (Ethernet)
RX packets 0Â bytes 0 (0.0 B)
RX errors 0Â dropped 0Â overruns 0Â frame 0
TX packets 0Â bytes 0 (0.0 B)
TX errors 0Â dropped 0 overruns 0Â carrier 0Â collisions 0
device interrupt 45
lo: flags=73<UP,LOOPBACK,RUNNING>Â mtu 65536
inet 127.0.0.1Â netmask 255.0.0.0
inet6 ::1Â prefixlen 128Â scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 1120Â bytes 77280 (75.4 KiB)
RX errors 0Â dropped 0Â overruns 0Â frame 0
TX packets 1120Â bytes 77280 (75.4 KiB)
TX errors 0Â dropped 0 overruns 0Â carrier 0Â collisions 0
usb1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>Â mtu 1500
inet 192.168.6.2Â netmask 255.255.255.252Â broadcast 192.168.6.3
inet6 fe80::9a5d:adff:fe2b:3d52Â prefixlen 64Â scopeid 0x20<link>
ether 98:5d:ad:2b:3d:52Â txqueuelen 1000Â (Ethernet)
RX packets 48Â bytes 7425 (7.2 KiB)
RX errors 0Â dropped 0Â overruns 0Â frame 0
TX packets 45Â bytes 6230 (6.0 KiB)
TX errors 0Â dropped 0 overruns 0Â carrier 0Â collisions 0
My main doubts are the following:
Summarizing, my target is set up this board to detect as usb mass storage device OTG (like a pendrive). Could you please help me to do it?
Thanks a lot for your help and support,
Best regards.
Alejandro
olmoDalco,
Apologies for the delayed response here.
Please take a look at the application note:Â https://octavosystems.com/app_notes/programming-emmc-with-usb/ which describes the process of programming the on board eMMC by exposing it to a host computer as a mass storage device. The application note takes you through creating the Linux image and the script for exposing the eMMC as a mass storage device is also shown. Note that g_mass_storage module needs to be compiled into the Linux kernel being used in the image.
Best,
Neeraj
Dear Neeraj Dantu,
First of all, I want thank your support, don’t worry about the delay.
I have read the application note about the programming EMMC, and I have some questions. Really I don’t want programming the EMMC, I need only expose the system as a OPT client in a host computer (the same that a USB pen drive in a PC). My most important doubts are the following:
Based on the above questions, I want mark that the most important point that I need do, is install a complete linux image which will be able to show a USB client OTG in any PC host computer, which use the g_mass_storage module.
Thanks a lot Octavo team.
Regards.
olmoDalco,
If you don’t want to program the eMMC, you don’t need to use the resources described in the Application note.
Please review the following links that describe how to use g_mass_storage to expose part of the storage as a mass storage device:
1. https://linux-sunxi.org/USB_Gadget/Mass_storage
2. https://developer.ridgerun.com/wiki/index.php?title=How_to_use_mass_storage_gadget
If you are using Beagle images, you can look into the Kernel build configuration file located in /boot/ folder to verify if g_mass_storage is built-in/module in the current kernel for the Beagle Image.
Finally, the page you linked from Digikey(https://www.digikey.com/eewiki/display/linuxonarm/BeagleBone+Black) shows how to build a kernel, build the kernel modules and install the kernel and modules on an SD card if you need to.
Please let us know if you have further questions.
Best,
Neeraj
Neeraj Dantu
First of all, I want to thank you about your help and support. And sorry for the delay en the answer.
I dont want to flash de eMMC for MP, I only want configure and use the board as a mass storage device for debugging.
Lets me try to explain you a bit about my issue. I only wanted use the microusb port of this board as a pen drive in a PC computer. In order to configure the board to do it, I tried with the g_mass_storage module : I have configured the module in /boot/config.txt and /etc/modules files. I have created and format the binary file (with these commands: sudo dd bs=1M if=/dev/zero of=/piusb.bin count=2048 and sudo mkdosfs /piusb.bin -F 32 -I) and mounted the system (sudo mkdir /mnt/usb_share, sudo nano /etc/fstab, adding: “/piusb.bin /mnt/usb_share vfat users,umask=000 0 2”, sudo mount -a). Finally I tested the mass storage devide. Please execute the following commands:
sudo modprobe gmassstorage file=/piusb.bin stall=0 ro=1
But it was not correctly configured like a OTG, the dmesg log always showed some errors (I can send you the logs). After search about it, I found that there are some scripts which are executed after boot and are configuring the peripherals according to the OSD reference board , they are causing issues with our design. So that I removed the triggered of these scripts and configure the OTG manually (with the commands mentioned previously) and it works fine.
So that my recommendation if you find out problems related with OTG, is remove these scripts and after that configure the g_mass_storage module manually.
Please if you think that I can provide you some information like logs, video or something like that. Lets me know.
Thanks for the support.
Best regards.
Olmo.
Olmo,
Thank you for getting back to us on the forum! I am glad you got the mass storage utility to work. We would very much appreciate it if you could post the procedure you followed on this thread.
Thank you very much for your efforts.
Best,
Neeraj
Dear Neeraj Dantu,
Sorry for the delay in the replay, I have not being working in this project since last year and I have not sign in in the forum. Lets me explain the steps that I followed to bring up the OTG (I know that remove the boot scripts is not the best way, but I have to analyze these scripts in order to avoid the configuration which is causing the difficulty to use the OTG).
I hope that these steps work for more people.
Thanks a lot,
Best regards.
Octavo Systems LLC all rights reserved
OCTAVO is registered in the U.S. Patent and Trademark Office. OSD, C-SiP, and the Octavo Logo are trademarks of Octavo Systems LLC.
"*" indicates required fields
"*" indicates required fields
"*" indicates required fields
"*" indicates required fields