2018-07-16 01:15 AM
Hello there,
I have some problem understanding the ReadPHYRegister-Function from the stm32f4xx_hal_eth.c.
I am using the Stm32f429 and a LAN8742A. On a nucleo board and on a custom board.
Primary with the parameter uint16_t PHYReg.
So in the datasheet the Register indexes are number 0-31 with skipping some numbers. So i expected to use those indexes for the param PHYReg. But I am not sure if i read the registers with the correct index.
The 'Interrupt Source Flag Register' has Index 29 (0x1D) and the 'Interrupt Mask Register' 30(0x1E)
In stm32f4xx_hal_conf.h is the definition for the ' Interrupt Source Flag register offset'
&sharpdefine PHY_ISFR ((uint16_t)0x000Bu)
and more irritating
/* Phy link down interrupt offsett */
&sharpdefine PHY_ISFR_INT4 ((uint16_t)0x000Bu)
which is described in the data sheets as Bit 4( 0x04). For this i can explain when you count from the msb but not for the PHY_ISFR.
On the nucleo board i have no problems with the cubemx drivers all interrupts get detected. On my custom board it was working once unfortunatley now the interrupts dont get detected. So i need to debug the lan8742A and reading the registers correct is mandatory for this.
#external-phy #hal_eth #stm32f429 #ethernetif #lan8742a