Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PIC32 DIY and MPLAB-Harmony CDC Single Com Demo
14-02-2014, 01:06 AM, (This post was last modified: 14-02-2014, 01:08 AM by fcapozzi.)
#21
RE: PIC32 DIY and MPLAB-Harmony CDC Single Com Demo
Here are the descriptors structure used in the demo code ... take a look .. it seems ok

Quote:const USB_DEVICE_DESCRIPTOR device_dsc=
{
// Size of this descriptor in bytes
0x12,

// DEVICE descriptor type
USB_DESCRIPTOR_DEVICE,

// USB Spec Release Number in BCD format
0x0200,

// Class Code
USB_CDC_CLASS_CODE,

// Subclass code
USB_CDC_SUBCLASS_CODE,

// Protocol code
0x00,

// Max packet size for EP0, see system_config.h
/* name must be USB_EP0_BUFF_SIZE */
USB_DEVICE_EP0_BUFFER_SIZE,

// Vendor ID
0x04D8,

// Product ID: CDC RS-232 Emulation Demo
0x000A,

// Device release number in BCD format
0x0100,

// Manufacturer string index
0x01,

// Product string index
0x02,

// Device serial number string index
0x00,

// Number of possible configurations
0x01
};


/* Configuration 1 Descriptor */
const uint8_t configDescriptor1[]={

/* Configuration Descriptor */
//sizeof(USB_CFG_DSC), // Size of this descriptor in bytes
0x09,
// CONFIGURATION descriptor type
USB_DESCRIPTOR_CONFIGURATION,
// Total length of data for this cfg
66,0,
// Number of interfaces in this cfg
2,
// Index value of this configuration
1,
// Configuration string index
0,
// Attributes, see usb_device.h
USB_ATTRIBUTE_DEFAULT | USB_ATTRIBUTE_SELF_POWERED,
// Max power consumption (2X mA)
50,

/* Interface Descriptor */
//sizeof(USB_INTF_DSC), // Size of this descriptor in bytes
9,
// INTERFACE descriptor type
USB_DESCRIPTOR_INTERFACE,
// Interface Number
0,
// Alternate Setting Number
0,
// Number of endpoints in this intf
1,
// Class code
USB_CDC_COMMUNICATIONS_INTERFACE_CLASS_CODE,
// Subclass code
USB_CDC_SUBCLASS_ABSTRACT_CONTROL_MODEL,
// Protocol code
USB_CDC_PROTOCOL_AT_V250,
// Interface string index
0,

/* CDC Class-Specific Descriptors */
// Size of the descriptor
sizeof(USB_CDC_HEADER_FUNCTIONAL_DESCRIPTOR),
// CS_INTERFACE
USB_CDC_DESC_CS_INTERFACE,
// Type of functional descriptor
USB_CDC_FUNCTIONAL_HEADER,
//CDC spec version
0x20,0x01,

// Size of the descriptor
sizeof(USB_CDC_ACM_FUNCTIONAL_DESCRIPTOR),
// CS_INTERFACE
USB_CDC_DESC_CS_INTERFACE,
// Type of functional descriptor
USB_CDC_FUNCTIONAL_ABSTRACT_CONTROL_MANAGEMENT,
// bmCapabilities of ACM
USB_CDC_ACM_SUPPORT_LINE_CODING_LINE_STATE_AND_NOTIFICATION,

// Size of the descriptor
sizeof(USB_CDC_UNION_FUNCTIONAL_DESCRIPTOR_HEADER),
// CS_INTERFACE
USB_CDC_DESC_CS_INTERFACE,
// Type of functional descriptor
USB_CDC_FUNCTIONAL_UNION,
//com interface number
0,

// Size of the descriptor
sizeof(USB_CDC_CALL_MANAGEMENT_DESCRIPTOR),
// CS_INTERFACE
USB_CDC_DESC_CS_INTERFACE,
// Type of functional descriptor
USB_CDC_FUNCTIONAL_CALL_MANAGEMENT,
// bmCapabilities of CallManagement
0x00,
// Data interface number
1,

/* Interrupt Endpoint (IN)Descriptor */
/*sizeof EP descriptor*/
0x07,
//Endpoint Descriptor
USB_DESCRIPTOR_ENDPOINT,
//EndpointAddress ( EP1 IN INTERRUPT)
0x81,
//Attributes type of EP (INTERRUPT)
0x03,
// Max packet size of this EP
0x0A,0x00,
//Interval (in ms)
0x02,

/* Interface Descriptor */
//sizeof(USB_INTF_DSC), // Size of this descriptor in bytes
9,
// INTERFACE descriptor type
USB_DESCRIPTOR_INTERFACE,
// Interface Number
1,
// Alternate Setting Number
0,
// Number of endpoints in this intf
2,
// Class code
USB_CDC_DATA_INTERFACE_CLASS_CODE,
// Subclass code
0,
// Protocol code
USB_CDC_PROTOCOL_NO_CLASS_SPECIFIC,
// Interface string index
0,

/* Bulk Endpoint (OUT) Descriptor */
/*sizeof EP descriptor*/
0x07,
//Endpoint Descriptor
USB_DESCRIPTOR_ENDPOINT,
//EndpointAddress BULK OUT
0x02,
//Attributes BULK EP
0x02,
// MaxPacket Size of EP (BULK OUT)
0x40,0x00,
//Interval Can be ignored for BULK EPs.
0x00,

/* Bulk Endpoint (IN)Descriptor */
/*sizeof EP descriptor*/
0x07,/*sizeof(USB_EP_DSC)*/
//Endpoint Descriptor
USB_DESCRIPTOR_ENDPOINT,
//EndpointAddress BULK IN
0x82,
//Attributes BULK EP
0x02,
// MaxPacket Size of EP (BULK IN)
0x40,0x00,
//Interval Can be ignored for BULK EPs.
0x00,

};
Reply
14-02-2014, 03:18 PM,
#22
RE: PIC32 DIY and MPLAB-Harmony CDC Single Com Demo
The Linux errors are fairly detailed why not check other (CDC) code that works? Or make changes and see how the erros change.

Clearly the code as it is now is broken.

John
Reply
24-02-2014, 03:32 PM,
#23
RE: PIC32 DIY and MPLAB-Harmony CDC Single Com Demo
After a few attempts i ask for help in the Microchip forum and got an answer from a Microchip guy. He told me that the CDC example was not yet tested on Linux platform. It should be fixed in the next harmony release 0.80 that would be available late spring.

Fabio.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)