cancel
Showing results for 
Search instead for 
Did you mean: 

RMII mode, KSZ8081RNBI PHY with external oscilator problem

highimpedance
Associate III
Posted on January 02, 2018 at 14:58

Hello everyone,

I have STM32F107RC MCU connected RMII mode to PHY => KSZ8081RNBIA

PHY's clock source is 50 MHZ oscilattor connected to XI pin and  ETH_RMII_REF_CLK (PA1)

I tried source MCU with HSI (8MHz) and also external 16 MHZ HSE source.

I created a cubex library and tried lots of things. PHY address 0 and 1, changed PHY_SR macro (default 0x10) to 0x1E. Also I inserted code below according to PHY datasheet for RMII. What am I missing? I really miss DP83848 PHY.

Is there anyone worked with Micrel clocked by external oscilattor? Is my reference clock to MCU  correct or acceptable?

HAL_ETH_ReadPHYRegister(&heth, 0x1F, &phyreg);

if((HAL_ETH_WritePHYRegister(&heth, 0x1F, phyreg | 0x0080)) != HAL_OK)

{

HAL_UART_Transmit_IT(&huart1,(uint8_t *)''1F write ok'',11);

}

else

{

HAL_UART_Transmit_IT(&huart1,(uint8_t *)''1F write fail'',13);

}

I couldnt see any link, blink, movement on RJ45 both Leds. Also from debug uarth writing registers returning false.

0690X00000609JfQAI.png

#stm32f107-phy-micrel-ethernet #reset_n #ksz8081 #ksz8081rnbi #stm32f107-with-rmii #rmii-with-50-mhz-external-oscilator
1 ACCEPTED SOLUTION

Accepted Solutions
highimpedance
Associate III
Posted on January 03, 2018 at 15:03

Resolved!

@STRAP-IN OPTIONS

0690X00000609ErQAI.png

I connected pin 18 to VCC and set bit 7 of 0x1F register. Do it at file stm32f1xx_hal_eth.c after delay function shown below.

/* Delay to assure PHY reset */

HAL_Delay(PHY_RESET_DELAY);

Pinging worked after I added

MX_LWIP_Process();

function on while(1) loop in main.

  • DONT FORGET

*RST# pin of PHY was pulled up and GPIO of Reset Pin must be set.

https://community.st.com/tags#/?tags=stm32f107%20phy%20micrel%20ethernet

https://community.st.com/tags#/?tags=reset_n

View solution in original post

1 REPLY 1
highimpedance
Associate III
Posted on January 03, 2018 at 15:03

Resolved!

@STRAP-IN OPTIONS

0690X00000609ErQAI.png

I connected pin 18 to VCC and set bit 7 of 0x1F register. Do it at file stm32f1xx_hal_eth.c after delay function shown below.

/* Delay to assure PHY reset */

HAL_Delay(PHY_RESET_DELAY);

Pinging worked after I added

MX_LWIP_Process();

function on while(1) loop in main.

  • DONT FORGET

*RST# pin of PHY was pulled up and GPIO of Reset Pin must be set.

https://community.st.com/tags#/?tags=stm32f107%20phy%20micrel%20ethernet

https://community.st.com/tags#/?tags=reset_n