Page 1 of 1

Stm32f4discovery and Embest Base Board

Posted: Mon Nov 25, 2013 11:27 am
by shinelikerain
I have been porting ChibiOS to the Stm32f4discovery and the Embest DM-STF4BB Base Board to get Ethernet capability.

I couldnt work out why the code was waiting for MAC Software Reset flag to clear down in mac_lld_start().

I rechecked the clock routing and then I noticed STM32_MAC_ETH1_CHANGE_PHY_STATE in mac_lld_init(). The PHYS was being powered down, shutting off the clock in RMII mode (the LAN8720 on the Base Board is only RMII capable).

I'm not sure all PHYS devices do this, but I wonder if a conditional #ifdef BOARD_PHY_RMII on the STM32_MAC_ETH1_CHANGE_PHY_STATE check in mac_lld_start()may be an idea to catch this case.

Of course I may have been particularly dim :-(

Re: Stm32f4discovery and Embest Base Board

Posted: Mon Nov 25, 2013 11:34 am
by Giovanni
Hi,

If I remember well somebody already ported to that board, try a search in the forum, there are several topics regarding the MAC driver.

I need to study what you are suggesting becasue it is not immediately clear for me but the code is working on many boards with diferent PHYs.

Giovanni

Re: Stm32f4discovery and Embest Base Board

Posted: Tue Nov 26, 2013 11:54 am
by rubenswerk
Hi,
the same applies for RMII phy KSZ8031.
STM32_MAC_ETH1_CHANGE_PHY_STATE has to be disabled for this phy.
Bye, RuWe

Re: Stm32f4discovery and Embest Base Board

Posted: Mon Mar 24, 2014 3:24 am
by thomash505
Hey,
I am doing the same thing and trying to get LWIP to work with the embest bb. Is there example code to get the MAC subsystem to work with the LAN8720 PHY? I have set STM32_MAC_ETH1_CHANGE_PHY_STATE to FALSE and changed the PHY_ID to be appropriate for the LAN8720, but the code won't progress past initialisation.

Any ideas?

Thanks, Thomas.