Если я правильно понял спецификацию, то должен прийти запрос GetConfiguration, но вместо него приходит запрос на device descriptor. Устройство его отсылает. И так семь раз.
Потом хост ругается, на ошибку чтения конфигурации.
Поскольку с SAM-BA в том же устройстве хост прекрасно работает, то ошибка в программе. Вопрос какая?
Спецификацию перечитал несколько раз, проверял программу, сравнивал с AT91 USB Framework - Core 1.01 + CDC 1.0.
Дескриптор:
Код
static const struct device_descriptor dev_descr = {
.bLength = sizeof(struct device_descriptor),
.bDescriptorType = USB_DESC_DEVICE,
.bcdUSB = 0x0200,
.bDeviseClass = 0x02,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 8,
.idVendor = 0x1111,
.idProduct = 0x2222,
.bcdDevice = VERSION_CODE,
.iManufacturer = 1,
.iProduct = 2,
.iSerialNumber = 3,
.bNumConfigurations = 1
};
.bLength = sizeof(struct device_descriptor),
.bDescriptorType = USB_DESC_DEVICE,
.bcdUSB = 0x0200,
.bDeviseClass = 0x02,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 8,
.idVendor = 0x1111,
.idProduct = 0x2222,
.bcdDevice = VERSION_CODE,
.iManufacturer = 1,
.iProduct = 2,
.iSerialNumber = 3,
.bNumConfigurations = 1
};
Setup пакеты:
Код
1. 80 06 00 01 00 00 40 00
2. Пакет SetAddress не приводится
3. 80 06 00 01 00 00 12 00
4. 80 06 00 01 00 00 12 00
5. 80 06 00 01 00 00 12 00
6. 80 06 00 01 00 00 12 00
7. 80 06 00 01 00 00 12 00
8. 80 06 00 01 00 00 12 00
9. 80 06 00 01 00 00 12 00
2. Пакет SetAddress не приводится
3. 80 06 00 01 00 00 12 00
4. 80 06 00 01 00 00 12 00
5. 80 06 00 01 00 00 12 00
6. 80 06 00 01 00 00 12 00
7. 80 06 00 01 00 00 12 00
8. 80 06 00 01 00 00 12 00
9. 80 06 00 01 00 00 12 00
Лог хоста (Linux):
Код
new full speed USB device using uhci_hcd and address 32
usb 4-1: unable to read config index 0 descriptor/start
usb 4-1: chopping to 0 config(s)
PM: Adding info for usb:4-1
PM: Adding info for No Bus:usbdev4.32_ep00
usb 4-1: no configuration chosen from 0 choices
usb 4-1: unable to read config index 0 descriptor/start
usb 4-1: chopping to 0 config(s)
PM: Adding info for usb:4-1
PM: Adding info for No Bus:usbdev4.32_ep00
usb 4-1: no configuration chosen from 0 choices
В Windows ситуация отличается только количеством запросов.
Чего я не учел?