cancel
Showing results for 
Search instead for 
Did you mean: 

Stm32f7 ad Marvell switch over mii

Ashi
Associate II

Hi all,

We need to interface a stm32f7xx with marvel switch over mii connection to port 0. If you have any example of interfacing such switch please share. 

Normal stm32 network example show only assigning ip address to phy. How do we handle switch? In our case we initialised the mii interface and rest the switch using a gpio pin. But hal_ethernet_init is stuck in waiting for soft reset. 

 this code is failing in HAL_Eth_Init() :
 /* Wait for software reset */
  while (READ_BIT(heth->Instance->DMABMR, ETH_DMABMR_SR) > 0U)
 {
   if (((HAL_GetTick() - tickstart) > ETH_SWRESET_TIMEOUT))
   {
     /* Set Error Code */
     heth->ErrorCode = HAL_ETH_ERROR_TIMEOUT;
     /* Set State as Error */
     heth->gState = HAL_ETH_STATE_ERROR;
     /* Return Error */
     return HAL_ERROR;
   }
 }

1 REPLY 1
Pavel A.
Evangelist III

Marvel switch? Which switch?

> How do we handle switch?

Assuming the switch has a special PHY-less port for connection of a MCU: Handle the switch as a permanently connected cable (no need to detect connect/disconnect) with fixed speed and duplex. STM32F7 ETH is capable of 100 Mbps full duplex. Configure this on the switch port attached to the MCU.

Advanced switches have SPI or I2C configuration interface, so connect that to your STM32. Simple ones have only MDIO interface.