cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 Ethernet RMII reference clock can be input?

Pavel A.
Evangelist III

I have a board where STM32H743 is connected to a Microchip KSZ8873 for the PHY.

In CubeMX generated code and examples, pin PA1 (RMII_REF_CLK) is configured as alt. function GPIO_AF11_ETH, mode GPIO_MODE_AF_PP.

This works fine on eval. boards with a normal PHY such as LAN8742.

Now, the hardware engineer says that for KSZ8873, pin 29 (REFCLKO_3) connected to the STM's PA1 is output, so on the MCU side PA1 should be input.

It's much over my level of understanding :( so I'm asking here...

Can STM32 AF pins be input at all? In the gpio .h file there are only two options for AF pins: output push/pull or open drain. That's all.

And specific question about RMII_REF_CLK function of STM32H7: is there option to set it in more than one way, via SYSCONFIG or other esoteric way?

With LAN8742, is RMII_REF_CLK output or input from the MCU side?

Thanks in advance...

-- pa

1 ACCEPTED SOLUTION

Accepted Solutions
Piranha
Chief II

On MCU side RMII_REF_CLK is always 50 MHz input. Typically you feed it from PHY or feed both from some external clock source.

> Can STM32 AF pins be input at all?

Yes. It depends on specific alternate function and is managed by the respective peripheral. For example, I2C SDA pin changes direction even during one transfer. UART in half-duplex mode uses only Tx pin, which then changes direction by changing Tx and Rx modes respectively.

View solution in original post

1 REPLY 1
Piranha
Chief II

On MCU side RMII_REF_CLK is always 50 MHz input. Typically you feed it from PHY or feed both from some external clock source.

> Can STM32 AF pins be input at all?

Yes. It depends on specific alternate function and is managed by the respective peripheral. For example, I2C SDA pin changes direction even during one transfer. UART in half-duplex mode uses only Tx pin, which then changes direction by changing Tx and Rx modes respectively.