大量数据发送过程中,程序死循环在 USB_DeviceEhciTransfer 中的下面这段代码里。可能会是什么情况呢?
/* If QH is empty or the endpoint is not primed, need to link current dtd head to the QH. */
/* When the endpoint is not primed if qhIdle is zero, it means the QH is empty. */
if ((qhIdle) || (!(epStatus & primeBit)))
{
ehciState->qh[index].nextDtdPointer = (uint32_t)dtdHard;
ehciState->qh[index].dtdTokenUnion.dtdToken = 0U;
ehciState->registerBase->EPPRIME = primeBit;
while (!(ehciState->registerBase->EPSR & primeBit))
{
if (ehciState->registerBase->EPCOMPLETE & primeBit)
{
break;
}
else
{
ehciState->registerBase->EPPRIME = primeBit;
}
}
}
更多回帖