RE: Questions about usb to serial driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > > -----Original Message-----
> > > From: gregkh@xxxxxxxxxxxxxxxxxxx <gregkh@xxxxxxxxxxxxxxxxxxx>
> > > Sent: Friday, July 1, 2022 3:16 PM
> > > To: Neal Liu <neal_liu@xxxxxxxxxxxxxx>
> > > Cc: linux-usb@xxxxxxxxxxxxxxx; linux-serial@xxxxxxxxxxxxxxx
> > > Subject: Re: Questions about usb to serial driver
> > >
> > > On Fri, Jul 01, 2022 at 03:16:13AM +0000, Neal Liu wrote:
> > > > Hi all,
> > > >
> > > > I have a question about USB-serial and I hope I can find the
> > > > answer from
> > > here.
> > > > I'll be appreciated it if there is any feedback from you.
> > > >
> > > > My question is If I have a USB device controller (udc) and a uart
> > > > controller (16550) independently in a SoC, is there any usb-serial
> > > > drivers or
> > > applications that could possible to support/connect:
> > > > -	udc tx to uart rx
> > > > -	uart tx to udc rx
> > > >
> > > > Any chance I can make this SoC as a usb-serial devices?
> > >
> > > Sure, use the CONFIG_USB_CONFIGFS_SERIAL or
> CONFIG_USB_CONFIGFS_ACM
> > > build options and hook your gadget up to the serial port in
> > > userspace and you will have a very expensive usb-serial converter
> > > (there are very cheap chips that do the same thing if you want to
> > > make a simpler
> > > device.)
> > >
> > > hope this helps,
> >
> > Thanks Greg!
> >
> > What the detail steps exactly for "hook your gadget up to the serial port in
> userspace"?
> > Assume my system has:
> > 1 system uart: ttyS0
> > 1 uart: ttyS1
> > 1 usb gadget cdc acm: ttyGS0
> >
> > How to hook up ttyS1 to ttyGS0, so that I could communicate through below
> path.
> > PC1 - usb interface - my SoC (ttyGS0 - ttyS1) - rs232 interface - PC2?
> 
> That's an exercise left for the reader to do, odds are you need a userspace
> program that just copies the data back and forth.  Try it and see!

Thanks for your guides, I have implemented it and it works well.
The most tricky part is to configure serial port configuration through termios struct.

-Neal




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux