STM32F4XX_HAL_ETH.C .H BUGS

Created at 2024-05-17 14:03:13

The RT-THREAD eth_driver has no error, but when dealing with the LAN8720 transceiver it happens that using a direct cable connection with a PC all is working well, but when using an intermediate hub or switch the auto-enumeration process fails and the embedded ethernet devic e is always recognised as hal-duplex.
There is a bug in the ST driver, whose code is not portable and makes a reference to the wrong register ( i.e. not a LAN8720 register )
I changed the parameters but no success yet.
Something more needs to be understood.

stm32f4xx_eth.c

/* Configure the MAC with the Duplex Mode fixed by the auto-negotiation process */

if((phyreg & PHY_DUPLEX_STATUS) == PHY_DUPLEX_STATUS) // != (uint32_t)RESET)

{
  /* Set Ethernet duplex mode to Full-duplex following the auto-negotiation */
  (heth->Init).DuplexMode = ETH_MODE_FULLDUPLEX;  
}
...

stm32f4xx_hal_conf.h

// ARE THESE PARAMETERS SET FOR LAN8720A ?
// ORIGINALLY IT WAS 0x10 -> NOW 0x1F
// #define PHY_SPEED_STATUS ((uint16_t)0x0002U) /!< PHY Speed mask /
// #define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask

-> #define PHY_SR ((uint16_t)0x001FU) /!< PHY special status register Offset /
-> #define PHY_SPEED_STATUS ((uint16_t)0x0004U) /!< PHY Speed mask /
-> #define PHY_DUPLEX_STATUS ((uint16_t)0x0010U) /!< PHY Duplex mask /

More

Follower
0
Views
47
0 Answer
There is no answer, come and add the answer

Write Your Answer

Log in to publish your answer.,Click here to log in.

Create
Post

Share