Showing results for 
Search instead for 
Did you mean: 

How to integrate/use CMSIS driver for custom ETH PHY KSZ8061RNB under FreeRTOS & LwIP ?



i have custom board with STM32F779 and custom Ethernet PHY KSZ8061RNB.

I'm using CubeMX and only 2 PHYS are supported. I haven't found any documentation how to

do configuration with custom PHY device.

I have found CMSIS driver for  KSZ8061RNB, but it doesn't look like it could be easily integrated. Also ETH initialization code is integrated under LwIP and I have no clue how to change lower level of initialization or to switch it off completely and do initialization in custom code...

Any help would be appreciated,

thanks in advance,



Pavel A.
Evangelist III

> I have found CMSIS driver for KSZ8061RNB, but it doesn't look like it could be easily integrated. 

Have you found this driver?

The ETH of STM32 provides the interface to the 16-bit PHY registers, it should work with your PHY in the same way as in the ST examples.

IMHO the first step would be understanding why your board has KSZ8061RNB rather than anything else?

Does your product require specific features of this chip? (low power states, special signal tweaking, diagnostics ...) that you need to access in software.

Otherwise (most likely) - just study how the ST examples deal with PHY and transplant that to the ARM's driver.

It should take a day or two at most.

If this still looks too hard or time consuming, look for somebody else to help (a.k.a. hire a consultant).

-- pa


thanks for informations... I've tried to go by defining Custom PHY Device. In this way, result will be useful also to other users.

I've checked the registers and they are much similar to those for supported PHYs. But still it isn't working...

It timeouts on SW reset - I guess that means that it is not working.

Not sure if related, but do have a question regarding reference clock.

In Ref. Manual for STM32F7xxx it says that reference clock source should be transferred to both MAC and PHY devices.

In Datasheet for my PHY it says that it generates ref. clock for MAC.

Do I have to do anything else beside default definitions in RMII interface ( I guess it is already defined as input) ?

Thanks in advance,



Chief II

There is no separate PHY driver in ST's code.

The only things you need to modify are PHY_SR, PHY_SPEED_STATUS, PHY_DUPLEX_STATUS values. Adapt those to your PHY's register 1Eh bits 0 and 2.

That said, it will still not make the broken bloatware working:

P.S. The typical PHY connections and clocks are shown in datasheet figure 3-2.

Associate II

Hello! Is any success on this way? Maybe you have find some tutorial?


Hello I'm dealing with the same issue. Has ST published a specification to explain how user can develop his own BSP driver component?.

I'm using stm32h753zi with ksz8041nl as phy interface.