Problems after migrating STM32F777 to new ethernet driver in CubeMX 6.6.1
I tried to update an existing and working STM32F7 project to the new ethernet driver.
(MCU STM32F777BIT6 / STM32Cube FW_F7 V1.17.0 / CubeMX 6.6.1)
But there are some problems with this new driver:
1. A Bug in generated function "ethernet_link_thread" in module "ethernetif.c": ETH not started with interrupt
void ethernet_link_thread(void const * argument)
{
:
if(linkchanged)
{
/* Get MAC Config MAC */
HAL_ETH_GetMACConfig(&heth, &MACConf);
MACConf.DuplexMode = duplex;
MACConf.Speed = speed;
HAL_ETH_SetMACConfig(&heth, &MACConf);
// [BUG]
// ETH not startet with enabled interrupt
// same start procedure in function low_level_init is correct, but correct function is important at this place!
//HAL_ETH_Start(&heth);
HAL_ETH_Start_IT(&heth);
netif_set_up(netif);
netif_set_link_up(netif);
}
:
}2. A Bug in generated function "low_level_output" in module "ethernetif.c": return code of transmit function not evaluated and following while loop runs into deadlock after error
static err_t low_level_output(struct netif *netif, struct pbuf *p)
{
:
// [BUG]
// returncode of function HAL_ETH_Transmit_IT is not evaluated
// so on error the following while loop runs into a deadlock!
HAL_ETH_Transmit_IT(&heth, &TxConfig);
while(osSemaphoreWait(TxPktSemaphore, TIME_WAITING_FOR_INPUT)!=osOK)
{
}
HAL_ETH_ReleaseTxPacket(&heth);
return errval;
}3. After starting ETH a fatal bus error occurs in ETHDMA - probably the DMA descriptors are configured incorrect for STM32F7 (copy and paste from STM32H7 with different behaviour?)
4. An user PHY cannot be configured anymore - advanced parameters tab for ETH was removed and on LWIP tab only DP83848 can be selected (I use KSZ8091 on custom board and have to be modify the generated DP83848 files). I think PHY configuration should be a part of ETH interface and not of mid level LWIP.
Why was this changed in new CubeMX?
So I will keep my old working legacy driver because the new driver hasn't reached a sufficient maturity.
I don't know why the new ethernet "improved" driver in current state was released for STM32F7 with CubeMX?
