Hi Hopefully in right place I am posting this issue
I am stuck with this task ....
I have simple programm with USB FW 1.3 and is working fine, but when I am trying to do the same using USB FW 2.5 something is rong and I can't figure it out what.
Mainly something is wrong with EP02 activation or definitions or something else.
This is my USB FW 1.3 code
/* Configuration 1 Descriptor */
CFG01=
{
/* Configuration Descriptor */
sizeof(USB_CFG_DSC), // Size of this descriptor in bytes
DSC_CFG, // CONFIGURATION descriptor type
sizeof(cfg01), // Total length of data for this cfg
1, // Number of interfaces in this cfg
1, // Index value of this configuration
0, // Configuration string index
_DEFAULT, // Attributes, see usbdefs_std_dsc.h
50, // Max power consumption (2X mA)
/* Interface Descriptor */
sizeof(USB_INTF_DSC), // Size of this descriptor in bytes
DSC_INTF, // INTERFACE descriptor type
0, // Interface Number
0, // Alternate Setting Number
3, // Number of endpoints in this intf
0x00, // Class code
0x00, // Subclass code
0x00, // Protocol code
0, // Interface string index
/* Endpoint Descriptors */
sizeof(USB_EP_DSC),DSC_EP,_EP01_OUT,_INT,USBGEN_EP_SIZE,32,
sizeof(USB_EP_DSC),DSC_EP,_EP01_IN,_INT,USBGEN_EP_SIZE,32,
sizeof(USB_EP_DSC),DSC_EP,_EP02_IN,_INT,USBINT_EP_SIZE,32
};
and this is my USB FW 2.5 endpoints config
/* Configuration 1 Descriptor */
ROM BYTE configDescriptor1[]={
/* Configuration Descriptor */
0x09,//sizeof(USB_CFG_DSC), // Size of this descriptor in bytes
USB_DESCRIPTOR_CONFIGURATION, // CONFIGURATION descriptor type
0x20,0x00, // Total length of data for this cfg
1, // Number of interfaces in this cfg
1, // Index value of this configuration
0, // Configuration string index
_DEFAULT | _SELF, // Attributes, see usb_device.h
50, // Max power consumption (2X mA)
/* Interface Descriptor */
0x09,//sizeof(USB_INTF_DSC), // Size of this descriptor in bytes
USB_DESCRIPTOR_INTERFACE, // INTERFACE descriptor type
0, // Interface Number
0, // Alternate Setting Number
4, // Number of endpoints in this intf
0xFF, // Class code
0xFF, // Subclass code
0xFF, // Protocol code
0, // Interface string index
/* Endpoint Descriptor */
0x07, /*sizeof(USB_EP_DSC)*/
USB_DESCRIPTOR_ENDPOINT, //Endpoint Descriptor
_EP01_OUT, //EndpointAddress
_BULK, //Attributes
USBGEN_EP_SIZE,0x00, //size
1, //Interval
0x07, /*sizeof(USB_EP_DSC)*/
USB_DESCRIPTOR_ENDPOINT, //Endpoint Descriptor
_EP01_IN, //EndpointAddress
_BULK, //Attributes
USBGEN_EP_SIZE,0x00, //size
1, //Interval
0x07, /*sizeof(USB_EP_DSC)*/
USB_DESCRIPTOR_ENDPOINT, //Endpoint Descriptor
_EP02_OUT, //EndpointAddress
_INT, //Attributes
USBINT_EP_SIZE,0x00, //size
1, //Interval
0x07, /*sizeof(USB_EP_DSC)*/
USB_DESCRIPTOR_ENDPOINT, //Endpoint Descriptor
_EP02_IN, //EndpointAddress
_INT, //Attributes
USBINT_EP_SIZE,0x00, //size
1 //Interval
};
and EP activation
void USBCBInitEP(void)
{
USBEnableEndpoint(USBGEN_EP_NUM,USB_OUT_ENABLED|USB_IN_ENABLED|USB_HANDSHAKE_ENABLED|USB_DISALLOW_SETUP);
USBGenericOutHandle = USBGenRead(USBGEN_EP_NUM,(BYTE*)&OUTPacket,USBGEN_EP_SIZE);
USBEnableEndpoint(USBINT_EP_NUM,USB_OUT_ENABLED|USB_IN_ENABLED|USB_HANDSHAKE_ENABLED|USB_DISALLOW_SETUP);
USBGenericOutHandle = USBIntRead(USBINT_EP_NUM,(BYTE*)&OUTPacket,USBINT_EP_SIZE);
}
Can anybody kindly halp me where I am doing something not right, please.
Thanks
Marcin