Tool/software: TI-RTOS
Hi there,
Using AM5728/C66x/TI-RTOS, the AM5728 communicates with a FPGA by PCIe and It works well. However, I test ECRC test function but It doesn't work.
(AM5728 supposed to send a corrupted TX TLP, FPGA couldn't checked it).
To corrupt a PCIe TX TLP, I used PCIECTRL_TI_CONF_DIAG_CTRL register.
My questions are:
1. ECRC is always enabled?
2. My test code is shown below. Is this code send a corrupted TX TLP?
... while(1) { Task_sleep(1000); irqRaised1 = 0; retVal = pcieRcSendECRC(handle); drvInst->shadowRegs->ESR = 1UL << 1; //send PCIe TX TLP by DMA while (!irqRaised1); } ... } pcieRet_e pcieRcSendECRC (Pcie_Handle handle) { pcieRegisters_t regs; pcieTiConfDiagCtrlReg_t eCRCAssert; pcieRet_e retVal; PCIE_logPrintf ("RC sending ECRC to EP\n"); /* Now send ECRC error TLP */ memset (®s, 0, sizeof(regs)); memset (&eCRCAssert, 0, sizeof(eCRCAssert)); /* Read the current value */ regs.tiConfDiagCtrl = &eCRCAssert; retVal = Pcie_readRegs (handle, pcie_LOCATION_LOCAL, ®s); if (retVal != pcie_RET_OK){ PCIE_logPrintf("Can't read ECRC control regs in ticonf\n"); return pcie_RET_UNSUPPORTED; } if (eCRCAssert.invEcrc){ PCIE_logPrintf("ECRC control already asserted\n"); } else{ /* Send it */ eCRCAssert.invEcrc = 1U; retVal = Pcie_writeRegs (handle, pcie_LOCATION_LOCAL, ®s); if (retVal != pcie_RET_OK){ PCIE_logPrintf("Can't write Ecrc control regs in ticonf\n"); return pcie_RET_UNSUPPORTED; } else{ PCIE_logPrintf("ECRC asserted\n"); } } return pcie_RET_OK; } |
Thank you in advance
Sangwook Han