RT-Thread / RT-Thread/rt-thread
stm32 drv_eth.c当接收数据线程比tcpip_thread线程优先级低时,会卡在rt_stm32_eth_tx函数里
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 12.2k
- Forks
- 5.4k
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 40
Description
芯片:STM32F4
BSP:drv_eth.c
函数:rt_stm32_eth_tx
问题1:以太网接收数据线程优先级低,tcpip_thread线程优先级高,当在接收数据,执行HAL_ETH_GetReceivedFrame_IT时,被tcoip_thread线程强占,那么会一直卡在while (EthHandle.Lock == HAL_LOCKED);语句里
问题2:STM32 HAL库是否存在缺陷,HAL_ETH_GetReceivedFrame_IT和HAL_ETH_TransmitFrame用了同一把锁_HAL_LOCK(heth),收发不同同时进行,tcpip有重发机制,数据不会丢,但如果是udp,数据不就丢了?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in BSP drv_eth.c at rt_stm32_eth_tx and inspect the HAL_ETH_GetReceivedFrame_IT, HAL_ETH_TransmitFrame, and while (EthHandle.Lock == HAL_LOCKED) paths. Reproduce the priority scenario on STM32F4 and determine whether the shared HAL lock blocks reception and can lose UDP data; done means the cause and impact are clearly established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100