博士
最后登录1970-1-1
在线时间 小时
注册时间2022-7-18
|
楼主 |
发表于 2022-8-4 17:26:54
|
显示全部楼层
自己参考核心板画的板子,下载程序后老是反复重启,单步调试挂在fsl_phy.c的“启动SMI读取命令操作”位置,这是啥原因造成的?
- status_t PHY_Read(ENET_Type *base, uint32_t phyAddr, uint32_t phyReg, uint32_t *dataPtr)
- {
- assert(dataPtr);
- uint32_t counter;
- /* Clear the MII interrupt event. */
- ENET_ClearInterruptStatus(base, ENET_EIR_MII_MASK);
- /* Starts a SMI read command operation. */
- ENET_StartSMIRead(base, phyAddr, phyReg, kENET_MiiReadValidFrame);
- /* Wait for MII complete. */
- for (counter = PHY_TIMEOUT_COUNT; counter > 0; counter--)
- {
- if (ENET_GetInterruptStatus(base) & ENET_EIR_MII_MASK)
- {
- break;
- }
- }
- /* Check for timeout. */
- if (!counter)
- {
- return kStatus_PHY_SMIVisitTimeout;
- }
- /* Get data from MII register. */
- *dataPtr = ENET_ReadSMIData(base);
- /* Clear MII interrupt event. */
- ENET_ClearInterruptStatus(base, ENET_EIR_MII_MASK);
- return kStatus_Success;
- }
复制代码
|
|