[BUG] STM32 H7 ETH driver copy misses ST fixes from HAL H7 1.11.7 (RX tail pointer barrier, descriptor list re-init)

Aperta
#1,392 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
66/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
c

Direzione di ricerca

Read source/portable/NetworkInterface/STM32/Drivers/H7/stm32h7xx_hal_eth.c and compare ETH_UpdateDescriptor() and the ETH_DMA*DescListInit() functions with ST HAL H7 v1.11.7. Check how NetworkInterface.c reinitializes the driver after HAL_ETH_STATE_ERROR; done means the RX barrier and descriptor state resets match the cited fixes and cannot leave stale buffers to be freed twice.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Describe the bug
source/portable/NetworkInterface/STM32/Drivers/H7/stm32h7xx_hal_eth.c is a
copy of ST's HAL ETH driver. STM32CubeH7 v1.13.1 (HAL H7 v1.11.7, 2026-10-26)
fixes two issues that are still present in the copy, both on the LTS
202604.01 (FreeRTOS-Plus-TCP V4.4.1) and on current main:

  1. Barrier before the RX tail pointer write – ETH_UpdateDescriptor()
    uses __DMB() before writing DMACRDTPR. ST replaced it with __DSB()
    ("Fix intermittent RX packet loss from descriptor/DMA race condition"):
    the DMA may observe the new tail pointer before the descriptor writes
    have completed.

  2. Incomplete descriptor list initialisation – ETH_DMATxDescListInit()
    / ETH_DMARxDescListInit() do not reset PacketAddress[],
    CurrentPacketAddress, BuffersInUse, releaseIndex, TX
    BackupAddr0/1, RxDataLength, pRxLastRxDesc, pRxStart/End and the
    RX timestamp. NetworkInterface.c calls HAL_ETH_Init() again to
    recover from HAL_ETH_STATE_ERROR; stale PacketAddress[] entries can
    then be passed to HAL_ETH_TxFreeCallback() by
    HAL_ETH_ReleaseTxPacket(), i.e. a network buffer released twice.

Expected behavior
Same behaviour as ST HAL H7 v1.11.7 (stm32h7xx_hal_eth.c: see the
ETH_UpdateDescriptor() and ETH_DMA*DescListInit() diffs between
v1.11.6 and v1.11.7).

Platform
STM32H743, GCC (GNU Tools for STM32), FreeRTOS-LTS 202604.01,
FREERTOS_PLUS_TCP_NETWORK_IF=STM32, FREERTOS_PLUS_TCP_STM32_IF_DRIVER=H7,
buffer allocation 1.

Additional context

  • The RX timestamp context-descriptor fix in the same ST release only
    matters with PTP enabled, so it is not included here.
  • I can open a PR with the change (about 20 lines in the H7 driver only).
    Would you prefer this targeted fix or a full re-sync of the driver with
    HAL v1.11.7?
Lingua principale
C
Stelle
215
Fork
222
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di FreeRTOS/FreeRTOS-Plus-TCP

Tutte le issue di FreeRTOS/FreeRTOS-Plus-TCP

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.