kkobru 0 10 августа, 2017 Опубликовано 10 августа, 2017 (изменено) · Жалоба Добрый день! Может кто сталкивался. Не живёт USB на моей плате с tm4c1294kcpdt. Инициализирую как в примере, в режиме USB CDC, ноги подключены непосредственно к разъёму мини-USB, но устройство не опознаётся. Схему и плату могу показать, код инициализации ниже: //***************************************************************************** // // The languages supported by this device. // //***************************************************************************** const uint8_t g_pui8LangDescriptor[] = { 4, USB_DTYPE_STRING, USBShort(USB_LANG_EN_US) }; //***************************************************************************** // // The manufacturer string. // //***************************************************************************** const uint8_t g_pui8ManufacturerString[] = { (12 + 1) * 2, USB_DTYPE_STRING, 'P', 0, 'o', 0, 'r', 0, 't', 0, 'l', 0, 'a', 0, 'b', 0, ' ', 0, 'l', 0, 't', 0, 'd', 0, '.', 0, }; //***************************************************************************** // // The product string. // //***************************************************************************** const uint8_t g_pui8ProductString[] = { 2 + (12 * 2), USB_DTYPE_STRING, 'A', 0, 'u', 0, 't', 0, 'o', 0, 't', 0, 'r', 0, 'a', 0, 't', 0, 'e', 0, ' ', 0, '0', 0, '2', 0, }; //***************************************************************************** // // The serial number string. // //***************************************************************************** /*const*/ uint8_t g_pui8SerialNumberString[] = { 2 + (8 * 2), USB_DTYPE_STRING, '1', 0, '2', 0, '3', 0, '4', 0, '5', 0, '6', 0, '7', 0, '8', 0 }; //***************************************************************************** // // The control interface description string. // //***************************************************************************** const uint8_t g_pui8ControlInterfaceString[] = { 2 + (21 * 2), USB_DTYPE_STRING, 'A', 0, 'C', 0, 'M', 0, ' ', 0, 'C', 0, 'o', 0, 'n', 0, 't', 0, 'r', 0, 'o', 0, 'l', 0, ' ', 0, 'I', 0, 'n', 0, 't', 0, 'e', 0, 'r', 0, 'f', 0, 'a', 0, 'c', 0, 'e', 0 }; //***************************************************************************** // // The configuration description string. // //***************************************************************************** const uint8_t g_pui8ConfigString[] = { 2 + (26 * 2), USB_DTYPE_STRING, 'S', 0, 'e', 0, 'l', 0, 'f', 0, ' ', 0, 'P', 0, 'o', 0, 'w', 0, 'e', 0, 'r', 0, 'e', 0, 'd', 0, ' ', 0, 'C', 0, 'o', 0, 'n', 0, 'f', 0, 'i', 0, 'g', 0, 'u', 0, 'r', 0, 'a', 0, 't', 0, 'i', 0, 'o', 0, 'n', 0 }; //***************************************************************************** // // The descriptor string table. // //***************************************************************************** const uint8_t * const g_ppui8StringDescriptors[] = { g_pui8LangDescriptor, g_pui8ManufacturerString, g_pui8ProductString, g_pui8SerialNumberString, g_pui8ControlInterfaceString, g_pui8ConfigString }; #define NUM_STRING_DESCRIPTORS (sizeof(g_ppui8StringDescriptors) / \ sizeof(uint8_t *)) tUSBDCDCDevice g_sCDCDevice = { // // The Vendor ID you have been assigned by USB-IF. // 0x8F0F, // Temporary // // The product ID you have assigned for this device. // 0x100, // // The power consumption of your device in milliamps. // 20, // // The value to be passed to the host in the USB configuration descriptor’s // bmAttributes field. // USB_CONF_ATTR_SELF_PWR, // // A pointer to your control callback event handler. // AT_USBControlEventCallback, // // A value that you want passed to the control callback alongside every // event. // //(void *)&g_sYourInstanceData, 0, // // A pointer to your receive callback event handler. // AT_USBReceiveEventCallback, // // A value that you want passed to the receive callback alongside every // event. // //(void *)&g_sYourInstanceData, 0, // // A pointer to your transmit callback event handler. // AT_USBTransmitEventCallback, // // A value that you want passed to the transmit callback alongside every // event. // //(void *)&g_sYourInstanceData, 0, // // A pointer to your string table. // g_ppui8StringDescriptors, // // The number of entries in your string table. // NUM_STRING_DESCRIPTORS }; extern unsigned int Clk; void initUSBCDC() { uint32_t ui32PLLRate; SysCtlPeripheralEnable(SYSCTL_PERIPH_USB0); SysCtlVCOGet(SYSCTL_XTAL_16MHZ, &ui32PLLRate); USBStackModeSet(0, eUSBModeDevice, 0); USBDCDFeatureSet(0, USBLIB_FEATURE_CPUCLK, &Clk); USBDCDFeatureSet(0, USBLIB_FEATURE_USBPLL, &ui32PLLRate); pvDevice = USBDCDCInit(0, &g_sCDCDevice); } Изменено 12 августа, 2017 пользователем IgorKossak [codebox] для длинного кода, [code] - для короткого! Цитата Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты Поделиться
GDI 0 18 августа, 2017 Опубликовано 18 августа, 2017 · Жалоба Что то не видно настроек GPIO. ROM_GPIOPinTypeUSBAnalog(GPIO_PORTL_BASE, GPIO_PIN_6 | GPIO_PIN_7); //Это пины USB Цитата Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты Поделиться
vitkorob 0 21 августа, 2017 Опубликовано 21 августа, 2017 · Жалоба Сталкивался, USB запустил. Прикладываю 100% рабочий проект. Обратите внимание на файл usb_composite.c Для сборки проекта потребуются библиотеки driverlib и usblib от производителя. Проект настроен на версию TivaWare_C_Series-2.1.2.111, установленную в пути по-умолчанию. На официальном сайте http://software-dl.ti.com/tiva-c/SW-TM4C/l.../index_FDS.html доступен пакет библиотек SW-TM4C-2.1.4.178.exe более новой версии. Если пользоваться им, то в проекте надо поправить абсолютные пути к библиотекам. Если нужна старая версия пакета, то сообщите, я могу выложить. usb_0.1.0_firmware_TM4C1294KCPDT_.zip Цитата Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты Поделиться