linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Sid Spry" <sid@aeam.us>
To: "Krzysztof Opasiak" <k.opasiak@samsung.com>,
	"Peter Chen" <peter.chen@nxp.com>
Cc: "Felipe Balbi" <balbi@kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: Documentation for Raw USB ConfigFS
Date: Wed, 20 May 2020 00:27:32 -0500	[thread overview]
Message-ID: <1aca8e3c-3a60-4b7c-b517-e8409f1c4d2e@www.fastmail.com> (raw)
In-Reply-To: <689edc51-b60c-fa4a-e481-10861d67bfb1@samsung.com>

On Tue, May 19, 2020, at 2:51 PM, Krzysztof Opasiak wrote:
> 
> 
> On 19.05.2020 21:40, Sid Spry wrote:
> > On Tue, May 19, 2020, at 2:12 PM, Sid Spry wrote:
> >> On Mon, May 18, 2020, at 6:58 PM, Peter Chen wrote:
> >>>   
> >>>>> 2. Try exactly the same script I gave you, do not try change any
> >>>>> charaters (except the position for your application)
> >>>>>
> >>>>>>> cd /sys/kernel/config/usb_gadget
> >>>>>>> cd g1
> >>>>>>> echo "0x1d6b" > idVendor
> >>>>>>> echo "0x0105" > idProduct
> >>>>>>> mkdir /dev/usb-ffs
> >>>>>>> mkdir functions/ffs.usb
> >>>>>>> mount -t functionfs usb /dev/usb-ffs ln -s functions/ffs.usb
> >>>>>>> configs/c.1 /home/root/usb_test/ffs_test/ffs-test & /* your own
> >>>>>>> test application */ while [ ! -e /dev/usb-ffs/ep1 ] do  echo "."
> >>>>>>>   sleep 1;
> >>>>>>> done
> >>>>>
> >>>>>>
> >>>>>> [1]: I actually did not have CONFIG_USB_CONFIGFS_F_FS nor F_NCM/ECM
> >>>> set however the necessary code seemed to have been pulled in some other way
> >>>> and the modules were available. They were loaded, and as explained my shell-
> >>>> based configfs code worked. They are set now and the problem persists.
> >>>>>
> >>>>
> >>>> Hi, sorry I was not clear. The kernel config is fine, and
> >>>> CONFIG_USB_CONFIGFS_F_FS is set. I run your exact script (minus the ffs-test
> >>>> line) and it fails to create the functions/ffs.usb directory as I described before. I can
> >>>> create other functions just fine.
> >>>
> >>> You may enable debug at configfs.c, f_fs.c and your udc driver to see
> >>> what happened.
> >>>
> >>
> >> Thanks for your help Peter. Unfortunately I have hit a brick wall. The
> >> examples in libusbgx also fail to work, and I tried that library after
> >> a friend recommended it as perhaps having secret mojo. I enabled the
> >> userspace debug helpers in the kernel but they do not seem to offer me
> >> any insight, and there's no relevant dmesg output.
> >>
> >> My device is an Allwinner H2+, and the UDC seems to be the Inventra
> >> Highspeed Dual Role Controller. I've also got the DesignWare USB3/USB2
> >> cores enabled from my upstream but I think they are not being loaded.
> >>
> >> If anyone can look I'd appreciate it, this is just a hobby project.
> >> It's a good chance for me to do some kernel debugging but I'm a bit
> >> lost.
> >>
> >> Thanks for the help so far.
> >>
> > 
> > Sorry for double post again. Alternatively, if anyone can recommend a device which they know has working ffs configfs gadget functionality, I'll just buy a board with that instead.
> 
> Can you send me the strace log from the libusbgx example that does not 
> work for you?
> 

I apologize for the anticlimax, but some minor option I changed seemed to gate the bug. It may have been that I compiled in the DWC controller's dual mode instead of leaving it as module and this claimed the UDC in some way? The DWC dual-mode was compiled in as it caused a compilation issue in an older kernel.

I can now create the directory. Will get back if I can get the driver code working, the example references the linux source code in a strange way, haven't figured out how to add all headers.

      reply	other threads:[~2020-05-20  5:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-30 17:08 Documentation for Raw USB ConfigFS Sid Spry
2020-05-06  9:17 ` Peter Chen
2020-05-12 15:14   ` Sid Spry
2020-05-13  7:36     ` Felipe Balbi
2020-05-13 10:05       ` Peter Chen
2020-05-14 16:32         ` Sid Spry
2020-05-15  1:05           ` Peter Chen
2020-05-16  5:57             ` Sid Spry
2020-05-18  5:48               ` Peter Chen
2020-05-18 22:14                 ` Sid Spry
2020-05-18 23:58                   ` Peter Chen
2020-05-19 19:12                     ` Sid Spry
2020-05-19 19:40                       ` Sid Spry
2020-05-19 19:51                         ` Krzysztof Opasiak
2020-05-20  5:27                           ` Sid Spry [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1aca8e3c-3a60-4b7c-b517-e8409f1c4d2e@www.fastmail.com \
    --to=sid@aeam.us \
    --cc=balbi@kernel.org \
    --cc=k.opasiak@samsung.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.chen@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).