* connecting omap and comp using usb cable @ 2007-03-27 15:46 Wael Adel [not found] ` <31e679430703270851q3f1e1f6o57a88339accd8fa9@mail.gmail.com> 0 siblings, 1 reply; 4+ messages in thread From: Wael Adel @ 2007-03-27 15:46 UTC (permalink / raw) To: linux-omap-open-source hi all, i want to communicate with the OMAP kit through the usb cable. so i made the following small program as a first step to open the device as follows: (Note that i have made by taking copy of flash recovery program omapf1) ******************************************************************************************************** #include <stdio.h> #include <string.h> #include <usb.h> #define OMAP_VENDOR 0x0451 #define OMAP_PRODUCT 0x3f00 #define IN_EP 0x81 #define OUT_EP 0x02 int main(int argc, char *argv[]) { usb_init(); usb_find_busses(); fprintf (stderr, "Waiting to OMAP-USB connection\n"); for (;;) { sleep (1); int n= usb_find_devices (); if (n) { struct usb_bus *bus; for (bus= usb_get_busses (); bus; bus= bus->next) { struct usb_device *dev; for (dev= bus->devices; dev; dev= dev->next) { usb_dev_handle *handle; if (dev->descriptor.idVendor == OMAP_VENDOR && dev->descriptor.idProduct == OMAP_PRODUCT && (handle= usb_open (dev)) != NULL) { printf("Device is opened successfully\n"); } } } } } return 0; } ******************************************************************************************************************** but u guess what? when i run this small program,i got the following output: Waiting to OMAP-USB connection note that i checked that the usb cable is connected well between my comp and the kit. Also i checked that jumper 3 is set to pins (1,2) do u have any ideas why the device is not found? thanks in advance. ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <31e679430703270851q3f1e1f6o57a88339accd8fa9@mail.gmail.com>]
[parent not found: <bd205c5f0703270858y79c08e9dg65dfe1a04f4087fc@mail.gmail.com>]
* Re: connecting omap and comp using usb cable [not found] ` <bd205c5f0703270858y79c08e9dg65dfe1a04f4087fc@mail.gmail.com> @ 2007-03-27 16:10 ` Wael Adel 2007-03-27 16:17 ` Felipe Balbi 0 siblings, 1 reply; 4+ messages in thread From: Wael Adel @ 2007-03-27 16:10 UTC (permalink / raw) To: Felipe Balbi; +Cc: linux-omap-open-source On 3/27/07, Wael Adel <showairovic@gmail.com> wrote: > i m using A-A usb cable to connect my comp to the OMAP kit.OK > so that the OMAP kit would b the device (slave) of the usb bus while > the host of the bus would b my computer ? > is there any problem in that? > > On 3/27/07, Felipe Balbi <felipebalbi@users.sourceforge.net> wrote: > > What do you mean with "connect to OMAP" ?? > > Why don't you use g_serial to emulate a tty terminal through usb or > > g_ether to emulate a network card through USB ?? > > > > I think g_ether would easier... as long as you can connect to OMAP > > board using SSH or Telnet or something like that. > > > > > > > > > > On 3/27/07, Wael Adel <showairovic@gmail.com> wrote: > > > hi all, > > > i want to communicate with the OMAP kit through the usb cable. > > > > > > so i made the following small program as a first step to open the > > > device as follows: (Note that i have made by taking copy of flash > > > recovery program omapf1) > > > > > > ******************************************************************************************************** > > > #include <stdio.h> > > > #include <string.h> > > > #include <usb.h> > > > > > > #define OMAP_VENDOR 0x0451 > > > #define OMAP_PRODUCT 0x3f00 > > > #define IN_EP 0x81 > > > #define OUT_EP 0x02 > > > > > > int main(int argc, char *argv[]) > > > { > > > usb_init(); > > > usb_find_busses(); > > > > > > > > > fprintf (stderr, "Waiting to OMAP-USB connection\n"); > > > for (;;) > > > { > > > sleep (1); > > > > > > int n= usb_find_devices (); > > > if (n) > > > { > > > struct usb_bus *bus; > > > for (bus= usb_get_busses (); bus; bus= > bus->next) > > > { > > > struct usb_device *dev; > > > > > > for (dev= bus->devices; dev; dev= > > dev->next) > > > { > > > usb_dev_handle *handle; > > > if (dev->descriptor.idVendor > > > == OMAP_VENDOR && > > > > > > dev->descriptor.idProduct == OMAP_PRODUCT && > > > (handle= usb_open > > > (dev)) != NULL) > > > { > > > printf("Device is > > > opened successfully\n"); > > > } > > > } > > > } > > > } > > > } > > > return 0; > > > } > > > > > > ******************************************************************************************************************** > > > > > > but u guess what? > > > when i run this small program,i got the following output: > > > > > > Waiting to OMAP-USB connection > > > > > > note that i checked that the usb cable is connected well between my > > > comp and the kit. > > > Also i checked that jumper 3 is set to pins (1,2) > > > do u have any ideas why the device is not found? > > > thanks in advance. > > > _______________________________________________ > > > Linux-omap-open-source mailing list > > > Linux-omap-open-source@linux.omap.com > > > http://linux.omap.com/mailman/listinfo/linux-omap-open-source > > > > > > > > > -- > > Best Regards, > > > > Felipe Balbi > > felipebalbi@users.sourceforge.net > > > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: connecting omap and comp using usb cable 2007-03-27 16:10 ` Wael Adel @ 2007-03-27 16:17 ` Felipe Balbi 2007-03-27 16:33 ` Wael Adel 0 siblings, 1 reply; 4+ messages in thread From: Felipe Balbi @ 2007-03-27 16:17 UTC (permalink / raw) To: Wael Adel; +Cc: linux-omap-open-source Hello Wael, On 3/27/07, Wael Adel <showairovic@gmail.com> wrote: > On 3/27/07, Wael Adel <showairovic@gmail.com> wrote: > > i m using A-A usb cable to connect my comp to the OMAP kit.OK > > so that the OMAP kit would b the device (slave) of the usb bus while > > the host of the bus would b my computer ? Yes, that's right. But I think you don't need to write another application if you can use what's already there. Try to build your device's kernel with support to USB Gadget. And enable CONFIG_USB_ETH. This'll build a module called g_ether. This module will let your USB Device work as a Ethernet card. This way you will be able to ssh into the device and work on that. I don't know if this will help ya... I don't know what's your objectives. If you could tell us a bit more... > > is there any problem in that? No problem at all.. this is the correct way to do it. > > > > On 3/27/07, Felipe Balbi <felipebalbi@users.sourceforge.net> wrote: > > > What do you mean with "connect to OMAP" ?? > > > Why don't you use g_serial to emulate a tty terminal through usb or > > > g_ether to emulate a network card through USB ?? > > > > > > I think g_ether would easier... as long as you can connect to OMAP > > > board using SSH or Telnet or something like that. > > > > > > > > > > > > > > > On 3/27/07, Wael Adel <showairovic@gmail.com> wrote: > > > > hi all, > > > > i want to communicate with the OMAP kit through the usb cable. > > > > > > > > so i made the following small program as a first step to open the > > > > device as follows: (Note that i have made by taking copy of flash > > > > recovery program omapf1) > > > > > > > > > ******************************************************************************************************** > > > > #include <stdio.h> > > > > #include <string.h> > > > > #include <usb.h> > > > > > > > > #define OMAP_VENDOR 0x0451 > > > > #define OMAP_PRODUCT 0x3f00 > > > > #define IN_EP 0x81 > > > > #define OUT_EP 0x02 > > > > > > > > int main(int argc, char *argv[]) > > > > { > > > > usb_init(); > > > > usb_find_busses(); > > > > > > > > > > > > fprintf (stderr, "Waiting to OMAP-USB connection\n"); > > > > for (;;) > > > > { > > > > sleep (1); > > > > > > > > int n= usb_find_devices (); > > > > if (n) > > > > { > > > > struct usb_bus *bus; > > > > for (bus= usb_get_busses (); bus; bus= > > bus->next) > > > > { > > > > struct usb_device *dev; > > > > > > > > for (dev= bus->devices; dev; dev= > > > dev->next) > > > > { > > > > usb_dev_handle *handle; > > > > if (dev->descriptor.idVendor > > > > == OMAP_VENDOR && > > > > > > > > dev->descriptor.idProduct == OMAP_PRODUCT && > > > > (handle= usb_open > > > > (dev)) != NULL) > > > > { > > > > printf("Device is > > > > opened successfully\n"); > > > > } > > > > } > > > > } > > > > } > > > > } > > > > return 0; > > > > } > > > > > > > > > ******************************************************************************************************************** > > > > > > > > but u guess what? > > > > when i run this small program,i got the following output: > > > > > > > > Waiting to OMAP-USB connection > > > > > > > > note that i checked that the usb cable is connected well between my > > > > comp and the kit. > > > > Also i checked that jumper 3 is set to pins (1,2) > > > > do u have any ideas why the device is not found? > > > > thanks in advance. > > > > _______________________________________________ > > > > Linux-omap-open-source mailing list > > > > Linux-omap-open-source@linux.omap.com > > > > http://linux.omap.com/mailman/listinfo/linux-omap-open-source > > > > > > > > > > > > > -- > > > Best Regards, > > > > > > Felipe Balbi > > > felipebalbi@users.sourceforge.net > > > > > > -- Best Regards, Felipe Balbi felipebalbi@users.sourceforge.net ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: connecting omap and comp using usb cable 2007-03-27 16:17 ` Felipe Balbi @ 2007-03-27 16:33 ` Wael Adel 0 siblings, 0 replies; 4+ messages in thread From: Wael Adel @ 2007-03-27 16:33 UTC (permalink / raw) To: Felipe Balbi; +Cc: linux-omap-open-source On 3/27/07, Felipe Balbi <felipebalbi@users.sourceforge.net> wrote: > Hello Wael, > > On 3/27/07, Wael Adel <showairovic@gmail.com> wrote: > > On 3/27/07, Wael Adel <showairovic@gmail.com> wrote: > > > i m using A-A usb cable to connect my comp to the OMAP kit.OK > > > so that the OMAP kit would b the device (slave) of the usb bus while > > > the host of the bus would b my computer ? > > Yes, that's right. But I think you don't need to write another > application if you can use > what's already there. > > Try to build your device's kernel with support to USB Gadget. And > enable CONFIG_USB_ETH. This'll build a module called g_ether. This > module will let your USB Device work as a Ethernet card. This way you > will be able to ssh into the device and work on that. but my problem is not at the device side, it is at the host side. note that i tried to run the code i have sent at the host side, this was written in the flash recovery program. As for the device side i load the gadgetfs module not ethernet module but i may try what u have said to me, but still dont know how can the host read data from the device(OMAP kit) > I don't know if this will help ya... I don't know what's your objectives. > > If you could tell us a bit more... All what i want is just to make OMAP kit be able to send/receive data from my comp and also i want to make my comp be able to receive/send data from/to my device (OMAP) > > > is there any problem in that? > > No problem at all.. this is the correct way to do it. > > > > > > > On 3/27/07, Felipe Balbi <felipebalbi@users.sourceforge.net> wrote: > > > > What do you mean with "connect to OMAP" ?? > > > > Why don't you use g_serial to emulate a tty terminal through usb or > > > > g_ether to emulate a network card through USB ?? > > > > > > > > I think g_ether would easier... as long as you can connect to OMAP > > > > board using SSH or Telnet or something like that. > > > > > > > > > > > > > > > > > > > > On 3/27/07, Wael Adel <showairovic@gmail.com> wrote: > > > > > hi all, > > > > > i want to communicate with the OMAP kit through the usb cable. > > > > > > > > > > so i made the following small program as a first step to open the > > > > > device as follows: (Note that i have made by taking copy of flash > > > > > recovery program omapf1) > > > > > > > > > > > > > ******************************************************************************************************** > > > > > #include <stdio.h> > > > > > #include <string.h> > > > > > #include <usb.h> > > > > > > > > > > #define OMAP_VENDOR 0x0451 > > > > > #define OMAP_PRODUCT 0x3f00 > > > > > #define IN_EP 0x81 > > > > > #define OUT_EP 0x02 > > > > > > > > > > int main(int argc, char *argv[]) > > > > > { > > > > > usb_init(); > > > > > usb_find_busses(); > > > > > > > > > > > > > > > fprintf (stderr, "Waiting to OMAP-USB connection\n"); > > > > > for (;;) > > > > > { > > > > > sleep (1); > > > > > > > > > > int n= usb_find_devices (); > > > > > if (n) > > > > > { > > > > > struct usb_bus *bus; > > > > > for (bus= usb_get_busses (); bus; bus= > > > bus->next) > > > > > { > > > > > struct usb_device *dev; > > > > > > > > > > for (dev= bus->devices; dev; dev= > > > > dev->next) > > > > > { > > > > > usb_dev_handle *handle; > > > > > if (dev->descriptor.idVendor > > > > > == OMAP_VENDOR && > > > > > > > > > > dev->descriptor.idProduct == OMAP_PRODUCT && > > > > > (handle= usb_open > > > > > (dev)) != NULL) > > > > > { > > > > > printf("Device is > > > > > opened successfully\n"); > > > > > } > > > > > } > > > > > } > > > > > } > > > > > } > > > > > return 0; > > > > > } > > > > > > > > > > > > > ******************************************************************************************************************** > > > > > > > > > > but u guess what? > > > > > when i run this small program,i got the following output: > > > > > > > > > > Waiting to OMAP-USB connection > > > > > > > > > > note that i checked that the usb cable is connected well between my > > > > > comp and the kit. > > > > > Also i checked that jumper 3 is set to pins (1,2) > > > > > do u have any ideas why the device is not found? > > > > > thanks in advance. > > > > > _______________________________________________ > > > > > Linux-omap-open-source mailing list > > > > > Linux-omap-open-source@linux.omap.com > > > > > http://linux.omap.com/mailman/listinfo/linux-omap-open-source > > > > > > > > > > > > > > > > > -- > > > > Best Regards, > > > > > > > > Felipe Balbi > > > > felipebalbi@users.sourceforge.net > > > > > > > > > > > > -- > Best Regards, > > Felipe Balbi > felipebalbi@users.sourceforge.net > ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-03-27 16:33 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2007-03-27 15:46 connecting omap and comp using usb cable Wael Adel [not found] ` <31e679430703270851q3f1e1f6o57a88339accd8fa9@mail.gmail.com> [not found] ` <bd205c5f0703270858y79c08e9dg65dfe1a04f4087fc@mail.gmail.com> 2007-03-27 16:10 ` Wael Adel 2007-03-27 16:17 ` Felipe Balbi 2007-03-27 16:33 ` Wael Adel
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.