• AVR Freaks

Bare Minimum Isochronous Transfer Generic USB Device Example

Page: < 12345.. > >> Showing page 2 of 10
Author
stefanopod
Super Member
  • Total Posts : 1285
  • Reward points : 0
  • Joined: 2007/06/25 02:33:59
  • Location: Bologna,Italy
  • Status: offline
RE: Bare Minimum Isochronous Transfer Generic USB Device Example 2007/07/30 09:27:48 (permalink)
0
I tried the ddk demo with the same results you posted. I tried writing on the pic, and I had error diagnostic failed to open pipe05 (your reading trial had pipe 4). Maybe It's a silly question but with an endpoint 0 and an endpoint 1, how have I a pipe #5?
 
Reading again "usb in a nutshell" I found the "standard endpoint request" CLEAR_FEATURE ENDPOINT_HALT which allows the host to stall and clear an endpoint. Is this intersting to you?
  
I am not much confident in a success: my thought is this : it is possible that in the web one cannot find a working example of microchip isochronous transfer? It' such a strange item? People succeed and keep their secret? Maybe it's stupid, but I think there's something wrong in mchp hardware, or in firmware or in PC software or in all of them.
 
My need for isochronous comes from a very simple training experiment I wanted to show to my students (I'm a teacher): after having sampled their voices and stored samples to PC (what I did without difficulties employing generic bulk or CDC) I wanted to walk the reverse path and make the boys glad to hear they voices on a speaker. I tried a bulk transfer from PC to PIC and a syncronized (using timer)transfer from PIC to DAC, but the bulk transfer steals milliseconds to the timer and 60 secs of sampling produce 64 secs of bad audio. I'll tell the boys that their teacher is OK and MCHP is bad.
 
Thanks again for sharing your trials, but I can't be very helpful.
#21
xiaofan
Super Member
  • Total Posts : 6247
  • Reward points : 0
  • Joined: 2005/04/14 07:05:25
  • Location: Singapore
  • Status: offline
RE: Bare Minimum Isochronous Transfer Generic USB Device Example 2007/07/30 09:37:14 (permalink)
0
I see. You are doing something useful and I am just experimenting but the problem is the same. We need to find out how to get this thing work. I think it will work. The problem must be with my code. Hopefully some experts can show some light on this.
#22
stefanopod
Super Member
  • Total Posts : 1285
  • Reward points : 0
  • Joined: 2007/06/25 02:33:59
  • Location: Bologna,Italy
  • Status: offline
RE: Bare Minimum Isochronous Transfer Generic USB Device Example 2007/07/30 11:03:51 (permalink)
0
I have read something in the ddk software: the "PerformFullSpeedIsochTransfer" function makes a lot of mess to accomplish isochronous write; on the contrary  MPUSBWrite in MCPUSBAPI accomplishes a simple WriteFile operation, assuming, I don't know how, probably using enumeration data, that it' s writing on an isochronous pipe. It looks too simple, and  doesn't work (one could say, also ddk example doesn't work, but it tries).
 But are we sure MCPUSBAPI handle ISO?
#23
xiaofan
Super Member
  • Total Posts : 6247
  • Reward points : 0
  • Joined: 2005/04/14 07:05:25
  • Location: Singapore
  • Status: offline
RE: Bare Minimum Isochronous Transfer Generic USB Device Example 2007/07/30 11:37:13 (permalink)
0
: But are we sure MCPUSBAPI handle ISO?

I think so but there are no official documentation. If not the host PC application should not work. But we do we need some experts or someone from Microchip to clarify this issue.
 
Edit:
I know sometimes I can still get the code working if I wrongly use bulk transfer instead of interrupt transfer under some of the old Linux version (libusb).
Eg: http://forum.microchip.com/tm.aspx?m=241692
Without the patch, the code still work under many Linux versions. It is wrong but it works.
 
However I do not know about isoc driver and I have never worked with any isoc based USB device before so I am really not sure.
 
post edited by xiaofan - 2007/07/30 12:02:09
#24
sc6po
Senior Member
  • Total Posts : 133
  • Reward points : 0
  • Joined: 2006/06/28 01:52:36
  • Location: France
  • Status: offline
RE: Bare Minimum Isochronous Transfer Generic USB Device Example 2007/07/30 13:37:38 (permalink)
0
Hi,
Sorry if I don't help you much right now...I'm kind of having a hard time making my stuff work.
Got to make things work quickly...Otherwise I'll have an even harder time...[:o]
I'm just starting on the base of someone else job...The guy quit and things are not that pretty right now...
Got to make feedback work...Hope tomorrow will be a good day...Smile

I currently use my sound card under unix...(embedded unix).
Appart from the jitter things, it works quite well.
But under windows, we had issues...It does not work anymore on my computer...
But If you want it to work, do not use pic driver...Use it as generic driver...generic audio device...
If your descriptors are ok, you should have no issue.
I has issues because my descriptors are kind of complex right now, 10 audio pipes, audio controls, and other controls, not declared as HID...
Seems windows does not like the not HID part...

Good Luck, and keep hope.






#25
xiaofan
Super Member
  • Total Posts : 6247
  • Reward points : 0
  • Joined: 2005/04/14 07:05:25
  • Location: Singapore
  • Status: offline
RE: Bare Minimum Isochronous Transfer Generic USB Device Example 2007/07/30 13:52:02 (permalink)
0
You are very kind. Thanks a lot for the tips. The problem is that I kind of know nothing about PC host side of programming and this has hindered my learning curve.
 
Anyway, I am not in a hurry. This is purely for my learning.
 
By the way, I think your stuff is quite advanced and it seems to me that it won't work with Windows without your own driver.
#26
xiaofan
Super Member
  • Total Posts : 6247
  • Reward points : 0
  • Joined: 2005/04/14 07:05:25
  • Location: Singapore
  • Status: offline
RE: Bare Minimum Isochronous Transfer Generic USB Device Example 2007/07/30 18:35:40 (permalink)
0
Since I know a little bit of libusb-win32, I tried to use libusb-win32 device driver. It seems that reading from PIC is kind of working in certain condition. A working example is shown here. I will change the firmware and test the writing to PIC and reading back from PIC (loop back test).

In the enclosed zip file:

C:\PICkit_2\PICKit2GenISOC2\libusb>dir
Volume in drive C is RAWXP_D1
Volume Serial Number is C4B3-442F
Directory of C:\PICkit_2\PICKit2GenISOC2\libusb
07/30/2007  09:26 PM    <DIR>          .
07/30/2007  09:26 PM    <DIR>          ..
07/30/2007  09:24 PM            49,156 debugprint.txt      --> debugview output
07/11/2007  05:28 PM            41,472 libusb0.dll            --> libusb-win32 DLL
07/11/2007  05:28 PM            28,672 libusb0.sys          --> libusb-win32 device driver
07/30/2007  09:12 PM             3,837 libusb_isoc.c        --> test program
07/30/2007  09:12 PM            20,948 libusb_isoc.exe    --> exe file for the test program
07/30/2007  08:08 PM               168 pickit2_isoc.cat    --> driver cat file
07/30/2007  08:08 PM             3,475 pickit2_isoc.inf    --> driver inf file
07/30/2007  08:08 PM               168 pickit2_isoc_x64.cat  --> driver inf for Win64, may not work
07/30/2007  09:14 PM             7,989 read.txt                  --> data read from the application
07/30/2007  08:15 PM             2,480 testisoc.c                --> source code
            10 File(s)        158,365 bytes
             2 Dir(s)  18,278,686,720 bytes free

Command lists:
C:\PICkit_2\PICKit2GenISOC2\libusb>gcc -o libusb_isoc.exe libusb_isoc.c -lusb
C:\PICkit_2\PICKit2GenISOC2\libusb>libusb_isoc.exe>read.txt 2>&1

Partial Output:

LIBUSB_DLL: info: usb_os_init: dll version: 0.1.12.1
LIBUSB_DLL: info: usb_os_init: driver version: 0.1.12.1
LIBUSB_DLL: info: usb_os_find_busses: found bus-0
LIBUSB_DLL: info: usb_os_find_devices: found \\.\libusb0-0001--0x04d8-0x0080 on bus-0
pickit2_isoc with Vendor Id: 4d8 and Product Id: 80 found.
42, 42, 42  43, 43, 43  44, 44, 44  45, 45, 45  46, 46, 46  47, 47, 47  48, 48, 48  49, 49, 49 
4a, 4a, 4a  4b, 4b, 4b  4c, 4c, 4c  4d, 4d, 4d  4e, 4e, 4e  4f, 4f, 4f  50, 50, 50  51, 51, 51 
52, 52, 52  53, 53, 53  54, 54, 54  55, 55, 55  56, 56, 56  57, 57, 57  58, 58, 58  59, 59, 59 
5a, 5a, 5a  5b, 5b, 5b  5c, 5c, 5c  5d, 5d, 5d  5e, 5e, 5e  5f, 5f, 5f  60, 60, 60  61, 61, 61 
62, 62, 62  63, 63, 63  64, 64, 64  65, 65, 65  66, 66, 66  67, 67, 67  68, 68, 68  69, 69, 69 
6a, 6a, 6a  6b, 6b, 6b  6c, 6c, 6c  6d, 6d, 6d  6e, 6e, 6e  6f, 6f, 6f  70, 70, 70  71, 71, 71 
72, 72, 72  73, 73, 73  74, 74, 74  75, 75, 75  76, 76, 76  77, 77, 77  78, 78, 78  79, 79, 79 
7a, 7a, 7a  7b, 7b, 7b  7c, 7c, 7c  7d, 7d, 7d  7e, 7e, 7e  7f, 7f, 7f  80, 80, 80  81, 81, 81
<skipped>


DebugView Output:

00000000 9:13:54.057 PM   
00000001 9:13:54.057 PM LIBUSB-DRIVER - release_all_interfaces(): releasing all interfaces bound to file object 0x8932b3c0 
00000002 9:13:54.057 PM   
00000003 9:13:54.057 PM [3548] LIBUSB_DLL: info: usb_os_init: dll version: 0.1.12.1 
00000004 9:13:54.057 PM   
00000005 9:13:54.057 PM LIBUSB-DRIVER - release_all_interfaces(): releasing all interfaces bound to file object 0x8932b3c0 
00000006 9:13:54.057 PM [3548] LIBUSB_DLL: info: usb_os_init: driver version: 0.1.12.1 
00000007 9:13:54.057 PM   
00000008 9:13:54.057 PM   
00000009 9:13:54.057 PM LIBUSB-DRIVER - get_descriptor(): buffer size 18 
00000010 9:13:54.057 PM LIBUSB-DRIVER - get_descriptor(): type 0001 
00000011 9:13:54.057 PM LIBUSB-DRIVER - get_descriptor(): recipient 0000 
00000012 9:13:54.057 PM LIBUSB-DRIVER - get_descriptor(): index 0000 
00000013 9:13:54.057 PM LIBUSB-DRIVER - get_descriptor(): language id 0000 
00000014 9:13:54.057 PM LIBUSB-DRIVER - get_descriptor(): timeout 5000 
00000015 9:13:54.057 PM [3548] LIBUSB_DLL: info: usb_os_find_busses: found bus-0 
00000016 9:13:54.077 PM LIBUSB-DRIVER - release_all_interfaces(): releasing all interfaces bound to file object 0x8932b3c0 
00000017 9:13:54.077 PM [3548] LIBUSB_DLL: info: usb_os_find_devices: found \\.\libusb0-0001--0x04d8-0x0080 on bus-0 
00000018 9:13:54.077 PM   
00000019 9:13:54.077 PM   
00000020 9:13:54.077 PM LIBUSB-DRIVER - get_descriptor(): buffer size 8 
00000021 9:13:54.077 PM LIBUSB-DRIVER - get_descriptor(): type 0002 
00000022 9:13:54.077 PM LIBUSB-DRIVER - get_descriptor(): recipient 0000 
00000023 9:13:54.077 PM LIBUSB-DRIVER - get_descriptor(): index 0000 
00000024 9:13:54.077 PM LIBUSB-DRIVER - get_descriptor(): language id 0000 
00000025 9:13:54.077 PM LIBUSB-DRIVER - get_descriptor(): timeout 1000 
00000026 9:13:54.077 PM   
00000027 9:13:54.077 PM   
00000028 9:13:54.077 PM LIBUSB-DRIVER - get_descriptor(): buffer size 32 
00000029 9:13:54.077 PM LIBUSB-DRIVER - get_descriptor(): type 0002 
00000030 9:13:54.077 PM LIBUSB-DRIVER - get_descriptor(): recipient 0000 
00000031 9:13:54.077 PM LIBUSB-DRIVER - get_descriptor(): index 0000 
00000032 9:13:54.077 PM LIBUSB-DRIVER - get_descriptor(): language id 0000 
00000033 9:13:54.077 PM LIBUSB-DRIVER - get_descriptor(): timeout 1000 
00000034 9:13:54.087 PM LIBUSB-DRIVER - release_all_interfaces(): releasing all interfaces bound to file object 0x8932b3c0 
00000035 9:13:54.087 PM   
00000036 9:13:54.087 PM   
00000037 9:13:54.087 PM LIBUSB-DRIVER - set_configuration(): configuration 1 
00000038 9:13:54.087 PM LIBUSB-DRIVER - set_configuration(): timeout 5000 
00000039 9:13:54.087 PM   
00000040 9:13:54.087 PM LIBUSB-DRIVER - claim_interface(): interface 0 
00000041 9:13:54.087 PM   
00000042 9:13:54.087 PM   
00000043 9:13:54.087 PM LIBUSB-DRIVER - transfer(): isochronous transfer 
00000044 9:13:54.087 PM LIBUSB-DRIVER - transfer(): direction in 
00000045 9:13:54.087 PM LIBUSB-DRIVER - transfer(): endpoint 0x81 
00000046 9:13:54.087 PM LIBUSB-DRIVER - transfer(): packet_size 0x40 
00000047 9:13:54.087 PM LIBUSB-DRIVER - transfer(): size 640 
00000048 9:13:54.087 PM LIBUSB-DRIVER - transfer(): sequence 1914 
00000049 9:13:54.087 PM   
00000050 9:13:54.087 PM   
00000051 9:13:54.087 PM   
00000052 9:13:54.087 PM LIBUSB-DRIVER - transfer(): isochronous transfer 
00000053 9:13:54.087 PM LIBUSB-DRIVER - transfer(): direction in 
00000054 9:13:54.087 PM LIBUSB-DRIVER - transfer(): endpoint 0x81 
00000055 9:13:54.087 PM LIBUSB-DRIVER - transfer(): packet_size 0x40 
00000056 9:13:54.087 PM LIBUSB-DRIVER - transfer(): size 640 
00000057 9:13:54.087 PM LIBUSB-DRIVER - transfer(): sequence 1915 
00000058 9:13:54.087 PM   
00000059 9:13:54.087 PM   
00000060 9:13:54.087 PM   
<skip>
00000754 9:14:10.460 PM LIBUSB-DRIVER - transfer(): isochronous transfer 
00000755 9:14:10.460 PM LIBUSB-DRIVER - transfer(): direction in 
00000756 9:14:10.460 PM LIBUSB-DRIVER - transfer(): endpoint 0x81 
00000757 9:14:10.460 PM LIBUSB-DRIVER - transfer(): packet_size 0x40 
00000758 9:14:10.460 PM LIBUSB-DRIVER - transfer(): size 640 
00000759 9:14:10.460 PM LIBUSB-DRIVER - transfer(): sequence 1978 
00000760 9:14:10.460 PM   
00000761 9:14:10.470 PM LIBUSB-DRIVER - transfer_complete(): sequence 1976: 640 bytes transmitted 
00000762 9:14:10.470 PM   
00000763 9:14:10.470 PM   
00000764 9:14:10.470 PM LIBUSB-DRIVER - transfer(): isochronous transfer 
00000765 9:14:10.470 PM LIBUSB-DRIVER - transfer(): direction in 
00000766 9:14:10.470 PM LIBUSB-DRIVER - transfer(): endpoint 0x81 
00000767 9:14:10.470 PM LIBUSB-DRIVER - transfer(): packet_size 0x40 
00000768 9:14:10.470 PM LIBUSB-DRIVER - transfer(): size 640 
00000769 9:14:10.470 PM LIBUSB-DRIVER - transfer(): sequence 1979 
00000770 9:14:10.470 PM   
00000771 9:14:10.480 PM LIBUSB-DRIVER - transfer_complete(): sequence 1977: 640 bytes transmitted 
00000772 9:14:10.490 PM LIBUSB-DRIVER - transfer_complete(): sequence 1978: 640 bytes transmitted 
00000773 9:14:10.500 PM LIBUSB-DRIVER - transfer_complete(): sequence 1979: 640 bytes transmitted 
00000774 9:14:10.500 PM   
00000775 9:14:10.500 PM   
00000776 9:14:10.500 PM LIBUSB-DRIVER - set_interface(): interface 0 
00000777 9:14:10.500 PM LIBUSB-DRIVER - set_interface(): altsetting 0 
00000778 9:14:10.500 PM LIBUSB-DRIVER - set_interface(): timeout 5000 
00000779 9:14:10.500 PM   
00000780 9:14:10.500 PM LIBUSB-DRIVER - get_descriptor(): buffer size 18 
00000781 9:14:10.500 PM LIBUSB-DRIVER - get_descriptor(): type 0001 
00000782 9:14:10.500 PM LIBUSB-DRIVER - get_descriptor(): recipient 0000 
00000783 9:14:10.500 PM LIBUSB-DRIVER - get_descriptor(): index 0000 
00000784 9:14:10.500 PM LIBUSB-DRIVER - get_descriptor(): language id 0000 
00000785 9:14:10.500 PM LIBUSB-DRIVER - get_descriptor(): timeout 5000 
00000786 9:14:10.500 PM   
00000787 9:14:10.500 PM LIBUSB-DRIVER - get_descriptor(): buffer size 9 
00000788 9:14:10.500 PM LIBUSB-DRIVER - get_descriptor(): type 0002 
00000789 9:14:10.500 PM LIBUSB-DRIVER - get_descriptor(): recipient 0000 
00000790 9:14:10.500 PM LIBUSB-DRIVER - get_descriptor(): index 0000 
00000791 9:14:10.500 PM LIBUSB-DRIVER - get_descriptor(): language id 0000 
00000792 9:14:10.500 PM LIBUSB-DRIVER - get_descriptor(): timeout 5000 
00000793 9:14:10.510 PM   
00000794 9:14:10.510 PM LIBUSB-DRIVER - get_descriptor(): buffer size 32 
00000795 9:14:10.510 PM LIBUSB-DRIVER - get_descriptor(): type 0002 
00000796 9:14:10.510 PM LIBUSB-DRIVER - get_descriptor(): recipient 0000 
00000797 9:14:10.510 PM LIBUSB-DRIVER - get_descriptor(): index 0000 
00000798 9:14:10.510 PM LIBUSB-DRIVER - get_descriptor(): language id 0000 
00000799 9:14:10.510 PM LIBUSB-DRIVER - get_descriptor(): timeout 5000 
00000800 9:14:10.560 PM LIBUSB-DRIVER - update_pipe_info(): interface 0 
00000801 9:14:10.560 PM LIBUSB-DRIVER - update_pipe_info(): endpoint address 0x01 
00000802 9:14:10.560 PM LIBUSB-DRIVER - update_pipe_info(): endpoint address 0x81 
00000803 9:14:10.560 PM   
00000804 9:14:10.560 PM LIBUSB-DRIVER - release_interface(): interface 0 
00000805 9:14:10.560 PM LIBUSB-DRIVER - release_all_interfaces(): releasing all interfaces bound to file object 0x89da1798 

post edited by xiaofan - 2007/07/30 18:53:40
#27
stefanopod
Super Member
  • Total Posts : 1285
  • Reward points : 0
  • Joined: 2007/06/25 02:33:59
  • Location: Bologna,Italy
  • Status: offline
RE: Bare Minimum Isochronous Transfer Generic USB Device Example 2007/07/31 07:12:54 (permalink)
0
I employed libusb0.dll without problems a few months ago to deal with bulk transfers, and libusb0 developers'guide didn't mention iso functions. Now looking in the ddl  as you suggested I see interesting functions concerning iso like "usb_isochronous_setup_async", but I have no documantation about them.
I'll try to translate the demo you posted, in c++ builder, the only environment where I feel at home, and may be i'll do some useful work.
#28
xiaofan
Super Member
  • Total Posts : 6247
  • Reward points : 0
  • Joined: 2005/04/14 07:05:25
  • Location: Singapore
  • Status: offline
RE: Bare Minimum Isochronous Transfer Generic USB Device Example 2007/07/31 07:17:01 (permalink)
0
I agree with you that documentation for libusb and libusb-win32 is kind of lagging for long time. I have posted the code to the libusb-win32 list and I will ask for some explanation for the functions. They are specific to the Win32 platform. It is said that the current libusb-linux code does not support isoc out of the box. There is a patch though. I might want to try it once I am back to Singapore to be with my Linux computer.
#29
xiaofan
Super Member
  • Total Posts : 6247
  • Reward points : 0
  • Joined: 2005/04/14 07:05:25
  • Location: Singapore
  • Status: offline
RE: Bare Minimum Isochronous Transfer Generic USB Device Example 2007/07/31 19:02:40 (permalink)
0
If I change the packet size (up to 1023 for full speed isoc), it is actually ok. So the PIC->PC side is kind of working.
#define USBGEN_EP_SIZE          240
 
Device info:


DLL version: 0.1.12.1
Driver version: 0.1.12.1
bus/device  idVendor/idProduct
bus-0/\\.\libusb0-0001--0x04d8-0x0080     04D8/0080
- Manufacturer : Microchip Technology Inc.
- Product      : PICDEM FS USB Demo Board (C) 2004
  wTotalLength:         32
  bNumInterfaces:       1
  bConfigurationValue:  1
  iConfiguration:       0
  bmAttributes:         80h
  MaxPower:             50
    bInterfaceNumber:   0
    bAlternateSetting:  0
    bNumEndpoints:      2
    bInterfaceClass:    0
    bInterfaceSubClass: 0
    bInterfaceProtocol: 0
    iInterface:         0
      bEndpointAddress: 01h
      bmAttributes:     0dh
      wMaxPacketSize:   240
      bInterval:        1
      bRefresh:         0
      bSynchAddress:    0
      bEndpointAddress: 81h
      bmAttributes:     0dh
      wMaxPacketSize:   240
      bInterval:        1

 
DebugView Output snip:

[\\APSGSGPXFCHEN]
00000000 9:59:10.641 PM 
00000001 9:59:10.641 PM LIBUSB-DRIVER - release_all_interfaces(): releasing all interfaces bound to file object 0x8941c028
00000002 9:59:10.641 PM 
00000005 9:59:10.651 PM 
00000006 9:59:10.651 PM LIBUSB-DRIVER - release_all_interfaces(): releasing all interfaces bound to file object 0x8941c028
00000008 9:59:10.651 PM 
00000009 9:59:10.651 PM 
00000010 9:59:10.651 PM LIBUSB-DRIVER - get_descriptor(): buffer size 18
00000011 9:59:10.651 PM LIBUSB-DRIVER - get_descriptor(): type 0001
00000012 9:59:10.651 PM LIBUSB-DRIVER - get_descriptor(): recipient 0000
00000013 9:59:10.651 PM LIBUSB-DRIVER - get_descriptor(): index 0000
00000014 9:59:10.651 PM LIBUSB-DRIVER - get_descriptor(): language id 0000
00000015 9:59:10.651 PM LIBUSB-DRIVER - get_descriptor(): timeout 5000
00000016 9:59:10.661 PM LIBUSB-DRIVER - release_all_interfaces(): releasing all interfaces bound to file object 0x8941c028
00000017 9:59:10.661 PM 
00000018 9:59:10.661 PM 
00000019 9:59:10.661 PM LIBUSB-DRIVER - get_descriptor(): buffer size 8
00000020 9:59:10.661 PM LIBUSB-DRIVER - get_descriptor(): type 0002
00000021 9:59:10.661 PM LIBUSB-DRIVER - get_descriptor(): recipient 0000
00000022 9:59:10.661 PM LIBUSB-DRIVER - get_descriptor(): index 0000
00000023 9:59:10.661 PM LIBUSB-DRIVER - get_descriptor(): language id 0000
00000024 9:59:10.661 PM LIBUSB-DRIVER - get_descriptor(): timeout 1000
00000026 9:59:10.671 PM 
00000027 9:59:10.671 PM 
00000028 9:59:10.671 PM LIBUSB-DRIVER - get_descriptor(): buffer size 32
00000029 9:59:10.671 PM LIBUSB-DRIVER - get_descriptor(): type 0002
00000030 9:59:10.671 PM LIBUSB-DRIVER - get_descriptor(): recipient 0000
00000031 9:59:10.671 PM LIBUSB-DRIVER - get_descriptor(): index 0000
00000032 9:59:10.671 PM LIBUSB-DRIVER - get_descriptor(): language id 0000
00000033 9:59:10.671 PM LIBUSB-DRIVER - get_descriptor(): timeout 1000
00000034 9:59:10.671 PM LIBUSB-DRIVER - release_all_interfaces(): releasing all interfaces bound to file object 0x8941c028
00000035 9:59:10.671 PM 
00000036 9:59:10.671 PM 
00000037 9:59:10.671 PM LIBUSB-DRIVER - set_configuration(): configuration 1
00000038 9:59:10.671 PM LIBUSB-DRIVER - set_configuration(): timeout 5000
00000039 9:59:10.671 PM 
00000040 9:59:10.671 PM LIBUSB-DRIVER - claim_interface(): interface 0
00000041 9:59:10.671 PM 
00000042 9:59:10.671 PM 
00000043 9:59:10.671 PM LIBUSB-DRIVER - transfer(): isochronous transfer
00000044 9:59:10.671 PM LIBUSB-DRIVER - transfer(): direction in
00000045 9:59:10.671 PM LIBUSB-DRIVER - transfer(): endpoint 0x81
00000046 9:59:10.671 PM LIBUSB-DRIVER - transfer(): packet_size 0xf0
00000047 9:59:10.671 PM LIBUSB-DRIVER - transfer(): size 24000
00000048 9:59:10.671 PM LIBUSB-DRIVER - transfer(): sequence 369
00000049 9:59:10.671 PM 
00000050 9:59:10.671 PM 
00000051 9:59:10.671 PM 
00000052 9:59:10.671 PM LIBUSB-DRIVER - transfer(): isochronous transfer
00000053 9:59:10.671 PM LIBUSB-DRIVER - transfer(): direction in
00000054 9:59:10.671 PM LIBUSB-DRIVER - transfer(): endpoint 0x81
00000055 9:59:10.671 PM LIBUSB-DRIVER - transfer(): packet_size 0xf0
00000056 9:59:10.671 PM LIBUSB-DRIVER - transfer(): size 24000
00000057 9:59:10.671 PM LIBUSB-DRIVER - transfer(): sequence 370
00000058 9:59:10.671 PM 
00000059 9:59:10.671 PM 
00000060 9:59:10.671 PM 
00000061 9:59:10.671 PM LIBUSB-DRIVER - transfer(): isochronous transfer
00000062 9:59:10.671 PM LIBUSB-DRIVER - transfer(): direction in
00000063 9:59:10.671 PM LIBUSB-DRIVER - transfer(): endpoint 0x81
00000064 9:59:10.671 PM LIBUSB-DRIVER - transfer(): packet_size 0xf0
00000065 9:59:10.671 PM LIBUSB-DRIVER - transfer(): size 24000
00000066 9:59:10.671 PM LIBUSB-DRIVER - transfer(): sequence 371
00000067 9:59:10.671 PM 
00000068 9:59:10.782 PM LIBUSB-DRIVER - transfer_complete(): sequence 369: 24000 bytes transmitted
00000069 9:59:10.782 PM 
00000070 9:59:10.782 PM 
00000071 9:59:10.782 PM LIBUSB-DRIVER - transfer(): isochronous transfer
00000072 9:59:10.782 PM LIBUSB-DRIVER - transfer(): direction in
00000073 9:59:10.782 PM LIBUSB-DRIVER - transfer(): endpoint 0x81
00000074 9:59:10.782 PM LIBUSB-DRIVER - transfer(): packet_size 0xf0
00000003 9:59:10.641 PM [2284] LIBUSB_DLL: info: usb_os_init: dll version: 0.1.12.1
00000004 9:59:10.651 PM [2284] LIBUSB_DLL: info: usb_os_init: driver version: 0.1.12.1
00000007 9:59:10.651 PM [2284] LIBUSB_DLL: info: usb_os_find_busses: found bus-0
00000025 9:59:10.661 PM [2284] LIBUSB_DLL: info: usb_os_find_devices: found \\.\libusb0-0001--0x04d8-0x0080 on bus-0
00000075 9:59:10.782 PM LIBUSB-DRIVER - transfer(): size 24000
00000076 9:59:10.782 PM LIBUSB-DRIVER - transfer(): sequence 372
00000077 9:59:10.782 PM 
00000078 9:59:10.882 PM LIBUSB-DRIVER - transfer_complete(): sequence 370: 24000 bytes transmitted
00000079 9:59:10.882 PM 
00000080 9:59:10.882 PM 
00000081 9:59:10.882 PM LIBUSB-DRIVER - transfer(): isochronous transfer
00000082 9:59:10.882 PM LIBUSB-DRIVER - transfer(): direction in
00000083 9:59:10.882 PM LIBUSB-DRIVER - transfer(): endpoint 0x81
00000084 9:59:10.882 PM LIBUSB-DRIVER - transfer(): packet_size 0xf0
00000085 9:59:10.882 PM LIBUSB-DRIVER - transfer(): size 24000
00000086 9:59:10.882 PM LIBUSB-DRIVER - transfer(): sequence 373
00000087 9:59:10.882 PM 
00000088 9:59:10.982 PM LIBUSB-DRIVER - transfer_complete(): sequence 371: 24000 bytes transmitted
00000089 9:59:10.982 PM 
00000090 9:59:10.982 PM 
00000091 9:59:10.982 PM LIBUSB-DRIVER - transfer(): isochronous transfer
00000092 9:59:10.982 PM LIBUSB-DRIVER - transfer(): direction in
00000093 9:59:10.982 PM LIBUSB-DRIVER - transfer(): endpoint 0x81
00000094 9:59:10.982 PM LIBUSB-DRIVER - transfer(): packet_size 0xf0
00000095 9:59:10.982 PM LIBUSB-DRIVER - transfer(): size 24000
00000096 9:59:10.982 PM LIBUSB-DRIVER - transfer(): sequence 374
00000097 9:59:10.982 PM 
00000098 9:59:11.082 PM LIBUSB-DRIVER - transfer_complete(): sequence 372: 24000 bytes transmitted
00000099 9:59:11.082 PM 
00000100 9:59:11.082 PM 
<snip>
00003038 9:59:40.474 PM LIBUSB-DRIVER - transfer_complete(): sequence 666: 24000 bytes transmitted
00003039 9:59:40.474 PM 
00003040 9:59:40.474 PM 
00003041 9:59:40.474 PM LIBUSB-DRIVER - transfer(): isochronous transfer
00003042 9:59:40.474 PM LIBUSB-DRIVER - transfer(): direction in
00003043 9:59:40.474 PM LIBUSB-DRIVER - transfer(): endpoint 0x81
00003044 9:59:40.474 PM LIBUSB-DRIVER - transfer(): packet_size 0xf0
00003045 9:59:40.474 PM LIBUSB-DRIVER - transfer(): size 24000
00003046 9:59:40.474 PM LIBUSB-DRIVER - transfer(): sequence 669
00003047 9:59:40.474 PM 
00003048 9:59:40.574 PM LIBUSB-DRIVER - transfer_complete(): sequence 667: 24000 bytes transmitted
00003049 9:59:40.574 PM 
00003050 9:59:40.574 PM 
00003051 9:59:40.574 PM LIBUSB-DRIVER - transfer(): isochronous transfer
00003052 9:59:40.574 PM LIBUSB-DRIVER - transfer(): direction in
00003053 9:59:40.574 PM LIBUSB-DRIVER - transfer(): endpoint 0x81
00003054 9:59:40.574 PM LIBUSB-DRIVER - transfer(): packet_size 0xf0
00003055 9:59:40.574 PM LIBUSB-DRIVER - transfer(): size 24000
00003056 9:59:40.574 PM LIBUSB-DRIVER - transfer(): sequence 670
00003057 9:59:40.574 PM 
00003058 9:59:40.675 PM LIBUSB-DRIVER - transfer_complete(): sequence 668: 24000 bytes transmitted
00003059 9:59:40.675 PM 
00003060 9:59:40.675 PM 
00003061 9:59:40.675 PM LIBUSB-DRIVER - transfer(): isochronous transfer
00003062 9:59:40.675 PM LIBUSB-DRIVER - transfer(): direction in
00003063 9:59:40.675 PM LIBUSB-DRIVER - transfer(): endpoint 0x81
00003064 9:59:40.675 PM LIBUSB-DRIVER - transfer(): packet_size 0xf0
00003065 9:59:40.675 PM LIBUSB-DRIVER - transfer(): size 24000
00003066 9:59:40.675 PM LIBUSB-DRIVER - transfer(): sequence 671
00003067 9:59:40.675 PM 
00003068 9:59:40.775 PM LIBUSB-DRIVER - transfer_complete(): sequence 669: 24000 bytes transmitted
00003069 9:59:40.875 PM LIBUSB-DRIVER - transfer_complete(): sequence 670: 24000 bytes transmitted
00003070 9:59:40.975 PM LIBUSB-DRIVER - transfer_complete(): sequence 671: 24000 bytes transmitted
00003071 9:59:40.975 PM 
00003072 9:59:40.975 PM 
00003073 9:59:40.975 PM LIBUSB-DRIVER - set_interface(): interface 0
00003074 9:59:40.975 PM LIBUSB-DRIVER - set_interface(): altsetting 0
00003075 9:59:40.975 PM LIBUSB-DRIVER - set_interface(): timeout 5000
00003076 9:59:40.975 PM 
00003077 9:59:40.975 PM LIBUSB-DRIVER - get_descriptor(): buffer size 18
00003078 9:59:40.975 PM LIBUSB-DRIVER - get_descriptor(): type 0001
00003079 9:59:40.975 PM LIBUSB-DRIVER - get_descriptor(): recipient 0000
00003080 9:59:40.975 PM LIBUSB-DRIVER - get_descriptor(): index 0000
00003081 9:59:40.975 PM LIBUSB-DRIVER - get_descriptor(): language id 0000
00003082 9:59:40.975 PM LIBUSB-DRIVER - get_descriptor(): timeout 5000
00003083 9:59:40.985 PM 
00003084 9:59:40.985 PM LIBUSB-DRIVER - get_descriptor(): buffer size 9
00003085 9:59:40.985 PM LIBUSB-DRIVER - get_descriptor(): type 0002
00003086 9:59:40.985 PM LIBUSB-DRIVER - get_descriptor(): recipient 0000
00003087 9:59:40.985 PM LIBUSB-DRIVER - get_descriptor(): index 0000
00003088 9:59:40.985 PM LIBUSB-DRIVER - get_descriptor(): language id 0000
00003089 9:59:40.985 PM LIBUSB-DRIVER - get_descriptor(): timeout 5000
00003090 9:59:41.045 PM 
00003091 9:59:41.045 PM LIBUSB-DRIVER - get_descriptor(): buffer size 32
00003092 9:59:41.045 PM LIBUSB-DRIVER - get_descriptor(): type 0002
00003093 9:59:41.045 PM LIBUSB-DRIVER - get_descriptor(): recipient 0000
00003094 9:59:41.045 PM LIBUSB-DRIVER - get_descriptor(): index 0000
00003095 9:59:41.045 PM LIBUSB-DRIVER - get_descriptor(): language id 0000
00003096 9:59:41.045 PM LIBUSB-DRIVER - get_descriptor(): timeout 5000
00003097 9:59:41.075 PM LIBUSB-DRIVER - update_pipe_info(): interface 0
00003098 9:59:41.075 PM LIBUSB-DRIVER - update_pipe_info(): endpoint address 0x01
00003099 9:59:41.075 PM LIBUSB-DRIVER - update_pipe_info(): endpoint address 0x81
00003100 9:59:41.075 PM 
00003101 9:59:41.075 PM LIBUSB-DRIVER - release_interface(): interface 0
00003102 9:59:41.075 PM LIBUSB-DRIVER - release_all_interfaces(): releasing all interfaces bound to file object 0x8941c028

#30
stefanopod
Super Member
  • Total Posts : 1285
  • Reward points : 0
  • Joined: 2007/06/25 02:33:59
  • Location: Bologna,Italy
  • Status: offline
RE: Bare Minimum Isochronous Transfer Generic USB Device Example 2007/08/01 04:32:53 (permalink)
0
to xiaofan:
your last post increases my confidence that of late was flying low. However I found a lot of difficulties, but I hope i will get rid of these problems:
1)increasing endpoint size to an amount bigger than 108 bytes(??) yields the MPLAB diagnostic "section usbram4 cannot fit...". I made some trivial changes to your lkr file because I employ 4550 and no bootloader, but the problem  was'nt in that point. Apparently I changed only something about directories, or maybe I made some mess. I couldn'open your project with MPLAB 7.42, (I don't know why) so I made a new project pasting your files.
Maybe there is a CONFIG difference. Where do you store your config bits? I use an include file, but I didn'find yours.
2)With my ep_size 108 I succeeded in rwiso -u (configuration), rwiso -g secs (test stream), but I failed in writing and reading.
What command line do you use for reading? I get always "unable to open" pipe4 for reading and pipe5 for writing.
3)I know nothing about "Debug View". What is it?
 
If I can get rwiso working, I hope it is possible to translate it into a cbuider wrapper.
 
However I depend on you.
(but you understand something of my comical english??)
 
 
 
 
 
#31
sc6po
Senior Member
  • Total Posts : 133
  • Reward points : 0
  • Joined: 2006/06/28 01:52:36
  • Location: France
  • Status: offline
RE: Bare Minimum Isochronous Transfer Generic USB Device Example 2007/08/01 05:04:48 (permalink)
0
Hi,
Fort he first point, you should add pragma to select the ram you would use.
#pragma udata usbram5a=0x500  for instance.
The first locations of USB Ram (ie 400) are used for your endpoints data, depending on the number of endpoints you declare (usbmmap.c). So you depending on your endpoints ( MAX_EP_NUMBER), you have less ram available

I just had a quick look to your declaration...
Seems very tiny to me...But since I use audio...
I would have thought that you would always need alternate setting 0 = 0 bus time reservation and Alternate Setting 1 = you endpoints declaration...
This is kind of bus time reservation. Depending on the devices linked to the host controler (in case more than one), the host has to authorize the acess...

Bye
post edited by sc6po - 2007/08/01 05:07:15
#32
xiaofan
Super Member
  • Total Posts : 6247
  • Reward points : 0
  • Joined: 2005/04/14 07:05:25
  • Location: Singapore
  • Status: offline
RE: Bare Minimum Isochronous Transfer Generic USB Device Example 2007/08/01 05:47:35 (permalink)
0
ORIGINAL: stefanopod
1)increasing endpoint size to an amount bigger than 108 bytes(??) yields the MPLAB diagnostic "section usbram4 cannot fit...". I made some trivial changes to your lkr file because I employ 4550 and no bootloader, but the problem  was'nt in that point. Apparently I changed only something about directories, or maybe I made some mess. I couldn'open your project with MPLAB 7.42, (I don't know why) so I made a new project pasting your files.
Maybe there is a CONFIG difference. Where do you store your config bits? I use an include file, but I didn'find yours.

 
I am using V7.61 so you can not open it with V7.42.
 
The working lkr:
//----------------------------------------------------------------------
// PIC18F2550 Linker for PICkit 2 Flash Starter Kit
// Steven Bible       2005-01-03    Adapted from original 'F2550 linker
//----------------------------------------------------------------------
LIBPATH .
FILES c018i.o
FILES clib.lib
FILES p18f2550.lib
// Bootloader
//CODEPAGE   NAME=vectors    START=0x0            END=0x29           PROTECTED
//CODEPAGE   NAME=page       START=0x2A           END=0x7FFF
// Application
CODEPAGE   NAME=boot       START=0x0            END=0x1FFF         PROTECTED
CODEPAGE   NAME=vectors    START=0x2000         END=0x2029         PROTECTED
CODEPAGE   NAME=page       START=0x202A         END=0x7FFF
CODEPAGE   NAME=idlocs     START=0x200000       END=0x200007       PROTECTED
CODEPAGE   NAME=config     START=0x300000       END=0x30000D       PROTECTED
CODEPAGE   NAME=devid      START=0x3FFFFE       END=0x3FFFFF       PROTECTED
CODEPAGE   NAME=eedata     START=0xF00000       END=0xF000FF       PROTECTED
ACCESSBANK NAME=accessram  START=0x0            END=0x5F
DATABANK   NAME=gpr0       START=0x60           END=0xFF
DATABANK   NAME=gpr1       START=0x100          END=0x1FF
DATABANK   NAME=gpr2       START=0x200          END=0x2FF
DATABANK   NAME=gpr3       START=0x300          END=0x3FF
DATABANK   NAME=usb4       START=0x400          END=0x7FF          PROTECTED
//DATABANK   NAME=unused_usb START=0x700          END=0x7FF                
ACCESSBANK NAME=accesssfr  START=0xF60          END=0xFFF          PROTECTED
SECTION    NAME=CONFIG            ROM=config
//SECTION    NAME=ScriptBuffer      RAM=unused_usb
STACK SIZE=0x100 RAM=gpr3
 

2)With my ep_size 108 I succeeded in rwiso -u (configuration), rwiso -g secs (test stream), but I failed in writing and reading.
What command line do you use for reading? I get always "unable to open" pipe4 for reading and pipe5 for writing.

 
The demo is for loopback firmware. I have not figured out how to use rwiso.
 

3)I know nothing about "Debug View". What is it?


DebugView+libusb-win32 is kind of poorman's USB sniffer.
 
DebugView: http://www.microsoft.com/technet/sysinternals/utilities/debugview.mspx
libusb-win32+debugview example: http://osdir.com/ml/lib.libusb.devel.windows/2005-10/msg00012.html
 
Hope this helps.
Xiaofan
#33
stefanopod
Super Member
  • Total Posts : 1285
  • Reward points : 0
  • Joined: 2007/06/25 02:33:59
  • Location: Bologna,Italy
  • Status: offline
RE: Bare Minimum Isochronous Transfer Generic USB Device Example 2007/08/01 05:52:15 (permalink)
0
Buffer descriptor tables are located in usbram4 (that is hardware dependent) and it is 256 bytes  long: 400 to 4ff. My max_endpoint number is 2 : how can I fit 2 BDT of  240 bytes (like Xiaofan's) in usbram4?
Maybe 8 for EP0 in, 8for EPO out and 240 for EP1OUT or EP1IN (not both of them):that makes 256.
#34
xiaofan
Super Member
  • Total Posts : 6247
  • Reward points : 0
  • Joined: 2005/04/14 07:05:25
  • Location: Singapore
  • Status: offline
RE: Bare Minimum Isochronous Transfer Generic USB Device Example 2007/08/01 05:56:18 (permalink)
0
isousb and bulkusb are the examples provided by Windows DDK. They both provide a testing host application for loopback firmware. I have not figured how to use them yet. I think it is not that difficult. It is just because of my lack of understaning of Win32 programming.
 
To use them, I think we need to change the firmware so that the input pipe and output pipe are looped back.
http://www.microsoft.com/whdc/devtools/ddk/default.mspx is not the latest version but it is good enough. Or you can use the latest WDK (need to register for Microsoft Connect).
 
Check this thread as well.
http://forum.microchip.com/tm.aspx?m=265685
 
 
#35
xiaofan
Super Member
  • Total Posts : 6247
  • Reward points : 0
  • Joined: 2005/04/14 07:05:25
  • Location: Singapore
  • Status: offline
RE: Bare Minimum Isochronous Transfer Generic USB Device Example 2007/08/01 05:57:34 (permalink)
0
ORIGINAL: stefanopod

Buffer descriptor tables are located in usbram4 (that is hardware dependent) and it is 256 bytes  long: 400 to 4ff. My max_endpoint number is 2 : how can I fit 2 BDT of  240 bytes (like Xiaofan's) in usbram4?
Maybe 8 for EP0 in, 8for EPO out and 240 for EP1OUT or EP1IN (not both of them):that makes 256.

 
So you need to change the linker script to increase usbram4. See the previous post.
#36
sc6po
Senior Member
  • Total Posts : 133
  • Reward points : 0
  • Joined: 2006/06/28 01:52:36
  • Location: France
  • Status: offline
RE: Bare Minimum Isochronous Transfer Generic USB Device Example 2007/08/01 06:22:07 (permalink)
0
Just add #pragma udata usbram5a=0x500  before the declaration in your usbmmap.c
#37
xiaofan
Super Member
  • Total Posts : 6247
  • Reward points : 0
  • Joined: 2005/04/14 07:05:25
  • Location: Singapore
  • Status: offline
RE: Bare Minimum Isochronous Transfer Generic USB Device Example 2007/08/01 06:59:26 (permalink)
0
I see what you mean. This might be better.
#38
stefanopod
Super Member
  • Total Posts : 1285
  • Reward points : 0
  • Joined: 2007/06/25 02:33:59
  • Location: Bologna,Italy
  • Status: offline
RE: Bare Minimum Isochronous Transfer Generic USB Device Example 2007/08/01 07:39:30 (permalink)
0
From pic manual- pag 170- I read that endpoint buffer control may reside only in ram 400-4ff. That's hardware.
No pragma and no increasing. Am I wrong?
#39
xiaofan
Super Member
  • Total Posts : 6247
  • Reward points : 0
  • Joined: 2005/04/14 07:05:25
  • Location: Singapore
  • Status: offline
RE: Bare Minimum Isochronous Transfer Generic USB Device Example 2007/08/01 08:13:21 (permalink)
0
Right now I am not with my PC, I will check this later. I think sc6po's method should work.
#40
Page: < 12345.. > >> Showing page 2 of 10
Jump to:
© 2019 APG vNext Commercial Version 4.5