gnupic: Re: [gnupic] PIC18F4550 based free & open source USB STAPL Player


Previous by date: 11 Nov 2007 19:37:27 +0000 Re: [gnupic] gputils CVS->SVN, Borut Razem
Next by date: 11 Nov 2007 19:37:27 +0000 Re: [gnupic] gputils CVS->SVN, Peter Stuge
Previous in thread:
Next in thread: 11 Nov 2007 19:37:27 +0000 Re: [gnupic] PIC18F4550 based free & open source USB STAPL Player, Nestor A. Marchesini

Subject: Re: [gnupic] PIC18F4550 based free & open source USB STAPL Player
From: "Nestor A. Marchesini" ####@####.####
Date: 11 Nov 2007 19:37:27 +0000
Message-Id: <47375B1D.2000605@xinet.com.ar>

El 29/10/07 17:21, Wojciech Zabołotny escribió:
> Hi All,
>
> I have just released a free & open source USB STAPL Player - a small
> device which may control multiple JTAG chains (up to 8, but only 2
> implemented in current hardware) playing the STAPL (JAM) files. All
> information is available at
> http://www.ise.pw.edu.pl/~wzab/usb_stapl_player/index.html
>
> The design is heavily based on the wonderful PIC USB Framework (
> http://vasco.gforge.enseeiht.fr/ ) written by Pierre Gaufillet.
> The USB firmware is compiled with the SDCC ( http://sdcc.sf.net ) compiler.
> I've also made use of the Altera Jam STAPL Player - which is used on the
> PC side of the system.
> The USB protocol on the PC side is serviced with the libusb library.
> Many thanks to all providers of the above open solutions!
>
> The hardware is based on our didactical board:
> http://www.ise.pw.edu.pl/~wzab/opiclab/index.html
>
> This is the first release, so the design is not very clean yet, but it
> works (at least for me ;-) ).
> I hope, that you'll find it useful.
Hi Wojciech

I am testing your code with a trial and learning. :-)
The problem I have is that it detects and identifies only the first time
Then if I want to go back to what I have restart the PC.
PIC -> 18f4550
MCLR -> 1K -> +5V.
VDD -> +5V USB.
crystal -> 8Mhz and two ceramic of 22pf.
SDCC -> 2.7.0 #4818 (Sep 12 2007)

Initially not detected:
[root@deselectronica nestor]# tailf /var/log/kernel.log
Nov 11 05:18:27 deselectronica usb 4-2: new low speed USB device using 
uhci_hcd and address 2
Nov 11 05:18:27 deselectronica usb 4-2: device descriptor read/64, error -71
Nov 11 05:18:27 deselectronica usb 4-2: device descriptor read/64, error -71
Nov 11 05:18:27 deselectronica usb 4-2: new low speed USB device using 
uhci_hcd and address 3
Nov 11 05:18:28 deselectronica usb 4-2: device descriptor read/64, error -71
Nov 11 05:18:28 deselectronica usb 4-2: device descriptor read/64, error -71
Nov 11 05:18:28 deselectronica usb 4-2: new low speed USB device using 
uhci_hcd and address 4
Nov 11 05:18:28 deselectronica usb 4-2: device not accepting address 4, 
error -71
Nov 11 05:18:28 deselectronica usb 4-2: new low speed USB device using 
uhci_hcd and address 5
Nov 11 05:18:29 deselectronica usb 4-2: device not accepting address 5, 
error -71

To detect it, I have to do a reset in pin MCLR.
Nov 11 05:20:38 deselectronica usb 4-2: new full speed USB device using 
uhci_hcd and address 6
Nov 11 05:20:44 deselectronica usb 4-2: configuration #1 chosen from 2 
choices

At unplug everything...ok.
Nov 11 05:40:45 deselectronica usb 4-2: USB disconnect, address 6

By plugging again, there's no more way to detect it.
Nov 11 05:41:35 deselectronica usb 4-2: new full speed USB device using 
uhci_hcd and address 7
Nov 11 05:41:50 deselectronica usb 4-2: device descriptor read/64, error 
-110
Nov 11 05:42:18 deselectronica usb 4-2: new full speed USB device using 
uhci_hcd and address 8
Nov 11 05:42:33 deselectronica usb 4-2: device descriptor read/64, error 
-110
Nov 11 05:42:49 deselectronica usb 4-2: device descriptor read/64, error 
-110
Nov 11 05:42:49 deselectronica usb 4-2: new full speed USB device using 
uhci_hcd and address 9
Nov 11 05:43:04 deselectronica usb 4-2: device descriptor read/64, error 
-110
Nov 11 05:43:19 deselectronica usb 4-2: device descriptor read/64, error 
-110
Nov 11 05:43:19 deselectronica usb 4-2: new full speed USB device using 
uhci_hcd and address 10
Nov 11 05:43:30 deselectronica usb 4-2: device not accepting address 10, 
error -110
Nov 11 05:43:30 deselectronica usb 4-2: new full speed USB device using 
uhci_hcd and address 11
Nov 11 05:43:40 deselectronica usb 4-2: device not accepting address 11, 
error -110

I understand that the error -110 is a timeout, which is not where the 
problem is
in firware of the pic or in the driver uhci_hcd of my archlinux.
Thinking that was the SUSPND, I removed the call to the routine 
usb_sleep (), but still
doing exactly the same.

[nestor@deselectronica ~]$ lsusb
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 006: ID a5a5:0313
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
[nestor@deselectronica ~]$ lsusb -v -d a5a5:0313

Bus 004 Device 006: ID a5a5:0313
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass         0
  bDeviceProtocol       255
  bMaxPacketSize0         8
  idVendor           0xa5a5
  idProduct          0x0313
  bcdDevice            1.00
  iManufacturer           1
  iProduct                2
  iSerial                 3
  bNumConfigurations      2
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           18
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          4
    bmAttributes         0xc0
      Self Powered
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              4
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     2
    iConfiguration          5
    bmAttributes         0xc0
      Self Powered
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              5
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
can't get device qualifier: Operation not permitted
can't get debug descriptor: Operation not permitted
cannot read device status, Operation not permitted (1)

[root@deselectronica nestor]# uname -r
2.6.23-ARCH
[root@deselectronica nestor]# mount -t debugfs none_debugs /sys/kernel/debug
[root@deselectronica nestor]# modprobe usbmon
[root@deselectronica nestor]# ls /sys/kernel/debug/usbmon
0s  0u  1s  1t  1u  2s  2t  2u  3s  3t  3u  4s  4t  4u  5s  5t  5u
[root@deselectronica nestor]# cat /proc/bus/usb/devices
...
T:  Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=ff(vend.) Sub=00 Prot=ff MxPS= 8 #Cfgs=  0
P:  Vendor=a5a5 ProdID=0313 Rev= 1.00
...

But only the program uusb shows me the chains USB STAPL Player and the 
serial number 1.0
[nestor@deselectronica ~]$ kdesu uusb &

Does anyone have an idea of what might be happening?

Regards
Néstor A. Marchesini
Chajari-Entre Rios-Argentina

Previous by date: 11 Nov 2007 19:37:27 +0000 Re: [gnupic] gputils CVS->SVN, Borut Razem
Next by date: 11 Nov 2007 19:37:27 +0000 Re: [gnupic] gputils CVS->SVN, Peter Stuge
Previous in thread:
Next in thread: 11 Nov 2007 19:37:27 +0000 Re: [gnupic] PIC18F4550 based free & open source USB STAPL Player, Nestor A. Marchesini


Powered by ezmlm-browse 0.20.