This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM6548: addressing a full speed usb device using xhci code

Part Number: AM6548

Hi TI experts,

I've been experimenting with the USB driver code that is available through RTOS SDK of processors like am65, am57, etc.

I had some success enumerating a flash memory device that was communicating at high-speed. Unfortunately, the code fails during the enumeration process at setting the address step (address device step) when the device is a keyboard or dongle, which communicates at full speed. I'm wondering what causes this to happen. (my port is USB 2.0 capable only btw)

The specific file that this happens is : usb_xhci_hcd.c located in usb/src/xhci

the function that returns error code is : USB_HOST_xHCI_Address_Device

and this is a part of that function: 

/*4.3.3 Device Slot Initialization */
memset(xhciContext, 0, sizeof(xhci_context_wrapper_t));

xhciContext->Input_Control_Context.add_flags |= 0x3 ; /* A0 and A1 set */

/*Set Context Entries to 1 */
xhciContext->Slot_Context.device_info0 |= (LAST_CTX(1)|
(0 << 26) | /* not a hub */
((Speed & 0xF) << 20)); /* Init speed and Port */

xhciContext->Slot_Context.device_info1 |= ROOT_HUB_PORT(xhciData->xhciPortNum) |
NUM_HUB_PORTS(0); /* no hub support yet... */
/* number of ports on hub goes here */

xhciContext->Slot_Context.ttinfo = 0; /* no hub support ... yet. */
xhciContext->Slot_Context.SlotState_Devadd = 0;

xhciContext->EndPoint_Context[0].epinfo1 |= (EP_TYPE(CTRL_EP)|
MAX_PACKET(xhciData->ep0MaxPs)|
MAX_BURST(0)|
ERROR_COUNT(3)); /* Error count 3 sec 4.8.2.1 in xHCI Spec */

xhciContext->EndPoint_Context[0].TRDeqPtrLo |= EP_CTX_CYCLE_MASK; /*DCS Set to 1 */
xhciContext->EndPoint_Context[0].TRDeqPtrLo |= (uint32_t) &xhciData->EP0_Transfer_Ring[0];

/*Form the Address device command Sec 6.4.3.4 in xHCI spec */
xhciData->Command_Ring[xhciData->byCommandRingIndex].command_trb_ptr_lo =
(uint32_t)&xhciContext->Input_Control_Context;

xhciData->Command_Ring[xhciData->byCommandRingIndex++].trb_slotid =
(TRB_TYPE(TRB_ADDRESS_DEVICE) |0x01 | SLOT_ID_FOR_TRB(xhciData->Slot_ID));
/* Command Ring */
HW_WR_REG32(baseAddr + DWC_USB_DB(1), DB_VALUE_HOST);
can you help me understand what is causing this failure? I highlighted a few parts that I thought maybe need to be modified in the full-speed mode. 
Thanks,
please help me understand this part.
  • Syed

    Unfortunately the PDK/RTOS code in AM65 is provided as is, we do not have the ability to support this. We are engaging AM65 customer with Linux only mindset for most content (apart from the firmware that runs on ICSSG). The team will not be able to provide any guidance on this.

    If you are looking at RTOS reference on USB, the best bet will be to look at the MCU+ SDK offering in AM64/AM243 family or use Linux side code as reference on AM62/AM64. 

    Regards

    Mukul