Hi Knas,
maybe it’s related to the buffer size of your endpoints?
Here the descriptors that I used for the PIC18F4550 (it’s written for the C18 compiler)
/* Device Descriptor */
rom USB_DEV_DSC device_dsc=
{
sizeof(USB_DEV_DSC), // Size of this descriptor in bytes
DSC_DEV, // DEVICE descriptor type
0x0200, // USB Spec Release Number in BCD format
CDC_DEVICE, // Class Code
0x00, // Subclass code
0x00, // Protocol code
EP0_BUFF_SIZE, // Max packet size for EP0, see usbcfg.h
0x16C0, // Vendor ID --- sponsored by voti.nl! see http://www.voti.nl/pids
1020, // Product ID: CDC RS-232 Emulation Demo
0x0000, // Device release number in BCD format
0x01, // Manufacturer string index
0x02, // Product string index
0x00, // Device serial number string index
0x01 // Number of possible configurations
};
/* Configuration 1 Descriptor */
CFG01=
{
/* Configuration Descriptor */
9, // Size of this descriptor in bytes
0x02, // CONFIGURATION descriptor type
9+ 9+9 +9+7+ 6+6+ 9+9+ 9+5+9+5, 0x00, // Total length of data for this cfg
0x02, // Number of interfaces in this cfg
0x01, // Interface number
0x00, // Configuration string index
0x80, // Attributes, see usbdefs_std_dsc.h
50, // Max power consumption (2X mA)
/* Descriptor of Audio Control Interface */
9, // Size of this descriptor in bytes
0x04, // INTERFACE descriptor type
0x00, // Interface Number
0x00, // Alternate Setting Number
0x00, // Number of endpoints in this intf
0x01, // Class code (AUDIO)
0x01, // Sub Class (AUDIO_CONTROL)
0x00, // Sub Sub Class
0x00, // Interface string index
/* Class Specific Audio Control Interface Descriptor */
9, // Size of this descriptor in bytes
0x24, // descriptor type
0x01, // Header subtype
0x00, 0x01, // Revision of class specification - 1.0
9, 0x00, // total size of class-specific descriptors
0x01, // number of streaming interfaces
0x01, // MIDI Streaming Interface 1 belongs to this AudioControl Interface
/* Descriptor of MIDI Stream Interface */
9, // Size of this descriptor in bytes
0x04, // INTERFACE descriptor type
0x01, // Interface Number
0x00, // Alternate Setting Number
0x02, // Number of endpoints in this intf
0x01, // Class code (AUDIO)
0x03, // Sub Class (MIDISTREAMING)
0x00, // Sub Sub Class
0x00, // Interface string index
/* Class Specific MIDI Stream Interface Descriptor */
7, // Size of this descriptor in bytes
0x24, // descriptor type
0x01, // Header subtype
0x00, 0x01, // Revision of class specification - 1.0
7+ 6+6+ 9+9+ 9+5+9+5,0x00, // total size of class-specific descriptors
/* MIDI In Descriptor (Embedded) */
6, // Size of this descriptor in bytes
0x24, // descriptor type
0x02, // MIDI_IN_JACK subtype
0x01, // EMBEDDED
0x01, // ID of this jack
0x00, // unused
/* MIDI In Descriptor (External) */
6, // Size of this descriptor in bytes
0x24, // descriptor type
0x02, // MIDI_IN_JACK subtype
0x02, // EXTERNAL
0x02, // ID of this jack
0x00, // unused
/* MIDI Out Descriptor (Embedded) */
9, // Size of this descriptor in bytes
0x24, // descriptor type
0x03, // MIDI_OUT_JACK subtype
0x01, // EMBEDDED
0x03, // ID of this jack
0x01, // number of input pins of this jack
0x02, // ID of the entity to which this pin is connected
0x01, // Output Pin number of the entity to which this input pin is connected
0x00, // unused
/* MIDI Out Descriptor (External) */
9, // Size of this descriptor in bytes
0x24, // descriptor type
0x03, // MIDI_OUT_JACK subtype
0x02, // EXTERNAL
0x04, // ID of this jack
0x01, // number of input pins of this jack
0x01, // ID of the entity to which this pin is connected
0x01, // Output Pin number of the entity to which this input pin is connected
0x00, // unused
/* EP2 Out */
9, // Size of this descriptor in bytes
0x05, // descriptor type (ENDPOINT)
0x01, // Out Endpoint 1
0x02, // Bulk, not shared
0x40, 0x00, // 64 bytes per packet
0x00, // ignore for bulk
0x00, // unused
0x00, // unused
5, // Size of this descriptor in bytes
0x25, // descriptor type (CS_ENDPOINT)
0x01, // MS_GENERAL
0x01, // number of embedded MIDI INs
0x01, // ID of embedded MIDI In Jack
/* EP2 In */
9, // Size of this descriptor in bytes
0x05, // descriptor type (ENDPOINT)
0x81, // In Endpoint 1
0x02, // Bulk, not shared
0x40, 0x00, // 64 bytes per packet
0x00, // ignore for bulk
0x00, // unused
0x00, // unused
5, // Size of this descriptor in bytes
0x25, // descriptor type (CS_ENDPOINT)
0x01, // MS_GENERAL
0x01, // number of embedded MIDI OUTs
0x03, // ID of embedded MIDI Out Jack
};
rom struct{byte bLength;byte bDscType;word string[1];}sd000={
sizeof(sd000),DSC_STR,0x0409};
rom struct{byte bLength;byte bDscType;word string[25];}sd001={
sizeof(sd001),DSC_STR,
'T','h','o','r','s','t','e','n',' ','K','l','o','s','e',
' ',' ',' ',' ',' ',' ',' ',' ',' ',' '};
rom struct{byte bLength;byte bDscType;word string[25];}sd002={
sizeof(sd002),DSC_STR,
'M','B','H','P',' ','U','S','B',' ','P','I','C',
'E','m','u','l','a','t','i','o','n',' ','D',' '};
[/code]
Best Regards, Thorsten.