Hola, llevo varios días intentando modificar el firmware (at90usb82) del Arduino UNO para emular otro device (exactamente un lector de huellas AuthenTec, Inc. AES1600), ya he logrado cambiar el Vendor, ProductID y otros valores de la configuración, el detalle ahora que se me presenta es el manejo de los EndPoints, debido a que cuando el interfaz se conecta al sistema (una XP virtualizada que tiene los drivers) se realizan un intercambio de Bulk-out (Operation now in progress (-EINPROGRESS) (-115)), todo esta bien hasta ese punto, primero se realiza un Bulk-Out al EndPoint 0x04 (OUT) con 4 bytes y luego uno al EndPoint 0x83 (IN) con 0 bytes, al realizarse el Bulk-OUT al 0x04 se responde con un (0) Success, pero al realizarse al 0x83 obtengo un No such file or directory (-ENOENT) (-2) (0xfeffffff), la configuración que tengo al firmware es la siguiente:
Los números de los EndPoints: #define CDC_NOTIFICATION_EPNUM 2
#define CDC_TX_EPNUM 3
#define CDC_RX_EPNUM 4
#define CDC_NOTIFICATION_EPSIZE 8
#define CDC_TXRX_EPSIZE 64
La declaración de la Interfaz virtual:USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
{
.Config =
{
.ControlInterfaceNumber = 0,
.DataINEndpointNumber = CDC_TX_EPNUM,
.DataINEndpointSize = CDC_TXRX_EPSIZE,
.DataINEndpointDoubleBank = false,
.DataOUTEndpointNumber = CDC_RX_EPNUM,
.DataOUTEndpointSize = CDC_TXRX_EPSIZE,
.DataOUTEndpointDoubleBank = false,
.NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM,
.NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
.NotificationEndpointDoubleBank = false,
},
};
void EVENT_USB_Device_ConfigurationChanged(void)
{
CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface);
}
El Device Descriptor:USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
.USBSpecification = VERSION_BCD(01.10),
.Class = 0xff,
.SubClass = 0xff,
.Protocol = 0xff,
.Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE,
.VendorID = 0x08FF,
.ProductID = 0x1600,
.ReleaseNumber = 0x0c10,
.ManufacturerStrIndex = 0x00,
.ProductStrIndex = 0x01,
.SerialNumStrIndex = 0x00,
.NumberOfConfigurations = 0x01
};
La configuración del descriptor:USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Config =
{
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
.TotalInterfaces = 1,
.ConfigurationNumber = 1,
.ConfigurationStrIndex = NO_DESCRIPTOR,
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
},
.CDC_DCI_Interface =
{
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0,
.AlternateSetting = 0,
.TotalEndpoints = 2,
.Class = 0xff,
.SubClass = 0xff,
.Protocol = 0xff,
.InterfaceStrIndex = NO_DESCRIPTOR
},
.CDC_DataOutEndpoint =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x00
},
.CDC_DataInEndpoint =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x00
}
};
typedef struct
{
USB_Descriptor_Configuration_Header_t Config;
USB_Descriptor_Interface_t CDC_DCI_Interface;
USB_Descriptor_Endpoint_t CDC_DataInEndpoint;
USB_Descriptor_Endpoint_t CDC_DataOutEndpoint;
} USB_Descriptor_Configuration_t;
Pero realmente me estoy quedando sin ideas y no encuentro el por que me retorna el estado No such file or directory (-ENOENT)
Necesito levantar otra interfaz virtual? o se me ha pasado algo?
Gracias de antemano
