STM32F107 Ethernet DMA TBUS bit always set and not other useful info
Hi,
i'me trying to develop a firmware for STM32F107RCT with a 4 port Microchip switch.
The switch has 3 port with phy and 1 port in MAC/PHY mode. I've set it in MII PHY mode.
It get's the 25MHz clock from MCO1 pin (set HSE that use a 25MHz quartz) and gives back RXC and TXC to MII MAC iface of 107.
The switch has not MIIM interface (I use SPI interface to control it). So HAL ethernet init was set to disable autoneg and 100mbit/s FD static status.
The RX from ethernet is working fine. Debugging I can find ARP request coming in and ARP response ready to be transmitted. Both RX and TX buffer are correct. TX buffer contains a valid ARP answer.
The problem is that when the frame shoud be transmitted (HAL_ETH_TransmitFrame), it finds the TBUS bit set in DMASR register. The HAL code successfully reset it and restart DMA TX buffer polling. DMA TX should now wait for OWN bit to set in TDES0. In next HAL_ETH_TransmitFrame call it finds again TBUS bit set, and so on. So it never transmits the frame.
No other useful bits are set in register or TDEF0 to get errors (TDEFs are update just after having set the OWN bit).
I'm thinking that it was and HW bug, but everything seems to be right as I've checked alla signals and are right (even if I can check only RX signal as TX are never be used for this problem).
Reading the reference manual, TBUS bit should be set only in case of buffer underrun or in case of OWN bit not set in TDES0. In first case I should have some bit set in TDES0 indicating and error, but I've not got them. In second case, I should have AIS or TU bit set in DMASR reg, But I've not any of them set.
Can you suggest whats setting TBUS bit other than these two cases?
Thanks
Luca