Hi,
I searched sdcc archives about some usable & wroking USB library and I
found some posts about gpled USB stack  writtten by Alexander Enzmann
( file usb.zip found on nutsvols.com). This library was created using
sdcc version 2.5 (according to some comments in the source files) and
it contains precompiled hex files, too. I tried to recompile PICHID
library example  with my sdcc 3.0.2 and pic18f2550. Fisrt it fails
with some casting
erros with lines:
 outPtr = &deviceDescriptor;
so I changed it to
outPtr = (byte *)&deviceDescriptor;
then compilation was succesfull. But it won't work. My usb host
(Linux) reports errors after pic flashing & boot:
usb 1-6: new full speed USB device using ohci_hcd and address 11
usb 1-6: device descriptor read/64, error -62
usb 1-6: device descriptor read/64, error -62

When I flashed old recompiled hex (mentioned above), it works and USB
host reports:
usb 1-6: new full speed USB device using ohci_hcd and address 15
usb 1-6: configuration #1 chosen from 1 choice
HID device claimed by neither input, hiddev nor hidraw
and lsusb reports new usb device:
Bus 001 Device 015: ID 04d8:4541 Microchip Technology, Inc.

I switched on some debug (printed via serial):
Enable the module
Device powered
USB Test Startup
Enable the module
Device powered
BusReset
BusReset
ProcessControlTransfer USTAT =0
SetupStage
ProcessStandardRequest
GetDescriptor
DEVICE_DESCRIPTOR
InDataStage bufferSize=18
ProcessControlTransfer USTAT =0x04
InDataStage bufferSize=0
ProcessControlTransfer USTAT =0
BusReset
ProcessControlTransfer USTAT =0
SetupStage
ProcessStandardRequest
GetDescriptor
DEVICE_DESCRIPTOR
InDataStage bufferSize=18
ProcessControlTransfer USTAT =0x04
InDataStage bufferSize=0
ProcessControlTransfer USTAT =0
BusReset
BusReset
ProcessControlTransfer USTAT =0
SetupStage
ProcessStandardRequest
GetDescriptor
DEVICE_DESCRIPTOR
InDataStage bufferSize=18
ProcessControlTransfer USTAT =0x04
InDataStage bufferSize=0
ProcessControlTransfer USTAT =0
BusReset
ProcessControlTransfer USTAT =0
SetupStage
ProcessStandardRequest
GetDescriptor
DEVICE_DESCRIPTOR
InDataStage bufferSize=18
ProcessControlTransfer USTAT =0x04
InDataStage bufferSize=0
ProcessControlTransfer USTAT =0
BusReset
BusReset
ProcessControlTransfer USTAT =0
SetupStage
ProcessStandardRequest
SET_ADDRESS: 12
ProcessControlTransfer USTAT =0x04
UADDR = 0x12
ProcessControlTransfer USTAT =0
SetupStage
ProcessStandardRequest
GetDescriptor
DEVICE_DESCRIPTOR
InDataStage bufferSize=8
ProcessControlTransfer USTAT =0x04
InDataStage bufferSize=0
ProcessControlTransfer USTAT =0
ProcessControlTransfer USTAT =0
SetupStage
ProcessStandardRequest
GetDescriptor
DEVICE_DESCRIPTOR
InDataStage bufferSize=8
ProcessControlTransfer USTAT =0x04
InDataStage bufferSize=0
ProcessControlTransfer USTAT =0
BusReset
ProcessControlTransfer USTAT =0
SetupStage
ProcessStandardRequest
SET_ADDRESS: 13
ProcessControlTransfer USTAT =0x04
UADDR = 0x13
ProcessControlTransfer USTAT =0
SetupStage
ProcessStandardRequest
GetDescriptor
DEVICE_DESCRIPTOR
InDataStage bufferSize=8
ProcessControlTransfer USTAT =0x04
InDataStage bufferSize=0
ProcessControlTransfer USTAT =0
ProcessControlTransfer USTAT =0
SetupStage
ProcessStandardRequest
GetDescriptor
DEVICE_DESCRIPTOR
InDataStage bufferSize=8
ProcessControlTransfer USTAT =0x04
InDataStage bufferSize=0
ProcessControlTransfer USTAT =0

It looks like pic try to send (many times) dev descriptor w/o success.
Maybe someone has any hints why it won't works... or maybe exist
somewhere and usable (with sdcc) usb stack for pic18f?
I tried other usb libs puf, eva but both are based on the same stack
form nutsvols...

regards,
marico

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to