Author Topic: Using Usb As Device Driver  (Read 3391 times)

Little_Goomba

  • Newbie
  • *
  • Posts: 31
    • View Profile
Using Usb As Device Driver
« on: August 15, 2005, 11:00:30 am »
I'm trying to write some software that will allow me to program embedded controllers using the Z.  I've got an unusual problem -  I've gotten as far as being able to recognize the programmer, but as soon as I try to write a block of data to the controller, WHAM!  Lockup.  Here's where I could use some help.  When I built libusb, the build enabled interrupt driven bulk data writes.  Does anyone know if the USB controller in the 6000 allows for interrupt driven writes?  Should I reprogram the application to use bulk writes?
I saw in the USB cables thread that someone else was getting lockup when trying to access a jukebox (I'll assume that's an MP3 player).  Maybe this is something similair?  I've been adding printf statements to the usb applications to try and get input on where the crash is occurring.  Here's where I think the crash happens.

Code: [Select]
int usb_interrupt_write(usb_dev_handle *dev, int ep, char *bytes, int size,
    int timeout)
{
  /* Ensure the endpoint address is correct */
  return usb_interrupt_transfer(dev, ep & ~USB_ENDPOINT_IN, bytes, size,
  timeout);
}
crashes the system.  Whazzup with that?
Thanks for your help, Zaurus experts!
« Last Edit: August 15, 2005, 11:03:20 am by Little_Goomba »
Model - 6000L w/ ExpansionPack, 4Gb microdrive, 1Gb SDRAM
Metrowerks OpenPDA V1.0
Java Zaurus V1.0
Qtopia V 1.5.4
Kernel 2.4.18

Little_Goomba

  • Newbie
  • *
  • Posts: 31
    • View Profile
Using Usb As Device Driver
« Reply #1 on: August 15, 2005, 02:21:14 pm »
Got it!  The TUSB2040 is not Interrupt friendly.  When an interrupt is sent to this device, it chokes the 6000, and that's all.  Sending data in bulk via software does the trick.  But I still don't feel like an expert.

Summary:  Don't write drivers that use the standard interrupt method of sending USB data.
Model - 6000L w/ ExpansionPack, 4Gb microdrive, 1Gb SDRAM
Metrowerks OpenPDA V1.0
Java Zaurus V1.0
Qtopia V 1.5.4
Kernel 2.4.18