2024-04-10 01:02 AM
Hi supporter,
I'm developing STM32H573I-DK and trying HAL_ETH_ReadPHYRegister to check link status. But this API seems be changed.
Previous prototype is:
HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef *heth, uint16_t PHYReg, uint32_t *RegValue)
But now is:
HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef *heth, uint32_t PHYAddr, uint32_t PHYReg,uint32_t *pRegValue)
I have no idea what PHYAddr is. And PHY_BSR is also not defined in STM32H5. So, I don't know how to fill PHYReg.
Is there any example?
I've referenced to GitHub - STMicroelectronics/STM32CubeH5.
But there are no examples about this API. Thanks for your help.
Solved! Go to Solution.
2024-04-10 10:51 PM - edited 2024-04-10 10:53 PM
Hi all,
I found that the Ethernet chip on STM32H573I-DK is LAN8742A. So, I referenced document and understood the registers map.
HAL_ETH_ReadPHYRegister(&heth, 0, 1, &tempReg)
where 1 is Basic Status Register and Bit 3 is Link Status.
But I don't know why PHYAddr is 0.
Hope this can help others.
2024-04-10 10:51 PM - edited 2024-04-10 10:53 PM
Hi all,
I found that the Ethernet chip on STM32H573I-DK is LAN8742A. So, I referenced document and understood the registers map.
HAL_ETH_ReadPHYRegister(&heth, 0, 1, &tempReg)
where 1 is Basic Status Register and Bit 3 is Link Status.
But I don't know why PHYAddr is 0.
Hope this can help others.
2024-04-11 04:30 PM
> But I don't know why PHYAddr is 0.
IIRC the "PHY address" is documented in the PHY chip datasheet. Otherwise you can scan all 32 addresses and find who responds.