cancel
Showing results for 
Search instead for 
Did you mean: 

32F417 to LAN8742 very slow configuration data link

PHolt.1
Senior III

Can anyone explain why there is a 1ms delay here

/**
  * @brief  Disables the MAC transmission.
  * @param  heth pointer to a ETH_HandleTypeDef structure that contains
  *         the configuration information for ETHERNET module  
  * @retval None
  */
static void ETH_MACTransmissionDisable(ETH_HandleTypeDef *heth)
{ 
  __IO uint32_t tmpreg1 = 0U;
  
  /* Disable the MAC transmission */
  (heth->Instance)->MACCR &= ~ETH_MACCR_TE;
  
  /* Wait until the write operation will be taken into account:
     at least four TX_CLK/RX_CLK clock cycles */
  tmpreg1 = (heth->Instance)->MACCR;
  ETH_Delay(ETH_REG_WRITE_DELAY);
  (heth->Instance)->MACCR = tmpreg1;
}

I am trying to power down the LAN8742 PHY, ahead of putting the CPU in Standby. I have tried the obvious like

ETH->MACCR = 0x00008000;

but the above code snippet shows one has to then read back MACCR and write it back in after a long delay. That delay above is actually 1ms, which is way too long for my purpose.

I can see there is some sort of "USART" link along which this stuff gets sent. The 8742 data sheet describes the registers. Its SMI timing shows a max clock of ~2MHz.

11 REPLIES 11
PHolt.1
Senior III

I can't find anything in the 32F417 errata which applies to this.

RROY.1
Associate II

sir can you give me steps for hardware configure of lan8742A with stm32f429 nucleo board. I cant config that hardware.Please help me sir its too much emergency for me. my mail id is roy.rajdip1@gmail.com.please give steps how to configure.I tried static ip configure on that board.