2016-10-11 04:52 AM
Hi,
I'm creating new project for CubeMx and using freeRtos and lwip. i was able to get eth tx workin(verified in tcpdump) dhcp request with correct mac. I was unable to get ethernet to react on receive -> there is no ethernet RX IRQ. Thing that i've done: - Changed PHY ADDR to 0 (default is 1) - added 1s delay before mac and phy init In these changes we managed to get TX working When i enable eth dma error irq flags i i get TBUIE: transmit buffer unavailable interrupt and and ethernet is not working any more in neither direction. Using stm32f407 and micrel ksz8081 phy All ideas are welcome! #smt32f4-cubemx2016-10-11 10:50 AM
Hi ,
Frist which version of STM32CubeMx you are using ? Check of you are not at the same conditions described in this . Otherwise, I submit your feedback tou our CubeMx team for check. -Hannibal-2016-10-12 07:45 AM
Yes! i get ethernet working! i update cube and that do the trick. I found one thing. Ethernet interrupt priority is generated 0 and it must be configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY or higher in value.
FYI: I have other board with stm32f427and ksz8794cnx phy(4 port switch). default generated code didn't work(complete silent) but i tinker with eth settings. i get it work by force -> DuplexMode = ETH_MODE_HALFDUPLEX and Speed = ETH_SPEED_100M. I'm not sure why autonegotation went wrong but now it works! Thanks! br Teijo2017-05-22 06:42 PM
Teijo,
I'm having a similar problem. The HAL Ether driver assumes a single PHY. My designs use a MICREL 3-port and 5-port switch. So i've modified the code to configure all PHY.
Also, some of the steps during the initialisation don't make sense for my switch. For example, soft reset is not supported, so this step blows away my default settings; i.e. it disables Auto-negotiation. Also, the last step of auto-negotiation is to read back the speed and duplex. I'm using MIIM to configure the PHY, which means I don't have access to the extended registers. The register value which is read back is nonsense (0xFF), which results in further unexpected behavior.
I think what you have done is the best way forwards, but it's unfortunate having to use a fixed speed and duplex.
On my chip I have access to all registers using the MICREL propitiatory SMI protocol. However, I really was trying to avoid doing this.
If you have learnt anything further, please let me know.
Regards, Matt.