2023-05-19 12:10 PM
There are some comments in STM HAL driver code:
stm32f1xx_hal_eth.c "The PTP protocol and the DMA descriptors ring mode are not supported in this driver". Can this driver work with zpehyr RTOS and the Ethernet Rx works in interrupt mode?
Also, inside stm32f1xx_hal_def.h for _HAL_LOCK_ definition, line 89:
"#if (USE_RTOS == 1U)
/* Reserved for future use */
// #error "USE_RTOS should be 0 in the current HAL release"
Does this comment indicate that the Ethernet HAL driver for STM32F107 can not work with Zephyr?
MII phy is used.
With the following Zephyr configuration:
#Ethernet MAC support
CONFIG_ETH_DRIVER=y
CONFIG_NET_L2_ETHERNET=y
# Mostly, this is ethernet MAC I need use
# But there is no way to plugin phy
# so we may need patch the STM32 driver
CONFIG_ETH_STM32_HAL=y
# Enable MII interface for STM32 PHY. This will automatically enable MII
CONFIG_ETH_STM32_HAL_MII=y
# Conduct auto PHY speed auto negotiation
# Need Alert patch
CONFIG_ETH_STM32_AUTO_NEGOTIATION_ENABLE=y
# 100M or 10M, default is 100M
CONFIG_ETH_STM32_SPEED_10M=n
CONFIG_NET_PROMISCUOUS_MODE=y
CONFIG_ETH_STM32_HAL_PHY_ADDRESS=1
With eth_stm32_hal.c of Zephyr default stm32 ethernet driver, Tx is in poll mode and Rx in interrupt. Tx flow works OK
Rx has issue such as spurious interrupt. Most time interrupts do not happen. If do, dma buffer descriptor in wrong state.
What could be the issue? To make the Rx interrupt work reliably, what special effort (or modification on eth_stm32_hal.c of Zephyr code base) need be done to make Rx to work on interrupt mode?