Skip to content

Add a TX bounce buffer to the STM32 HAL Ethernet driver and document STM32H7R/S MPU traps - #194

Merged
aidangarske merged 3 commits into
wolfSSL:masterfrom
dgarske:stm32h7rs_mpu_note
Nov 12, 2026
Merged

aidangarske merged 3 commits into
wolfSSL:masterfrom
dgarske:stm32h7rs_mpu_note

Conversation

@dgarske

@dgarske dgarske commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Description

Follow-up to #191 from the work on #192: one driver change and two documentation entries for STM32H7R/S.

Transmit from a static buffer

wolfIP builds each outgoing frame on the stack of the task that sends it, and hal_eth_send() passed that pointer straight to the Ethernet DMA. The DMA cannot read core-coupled memory, so with a stack in DTCM (or CCM on other families) nothing was transmitted. With STM32_HAL_ETH_TX_BOUNCE, hal_eth_send() copies the frame into a static, cache-line-aligned buffer and sends from there. It is on by default for STM32H7R/S, whose vendor linker scripts put the main stack in DTCM, and STM32_HAL_ETH_NO_TX_BOUNCE turns it off there. Other families are unchanged unless they define it.

Documentation

IDE/STM32Cube/README.md gains two troubleshooting entries:

  • A BusFault in atomic operations when the AXI SRAM region is marked Shareable, and the fact that Shareable memory is not D-cached.
  • Task stacks in DTCM or CCM, the define above, and that the driver's static buffers must be linked into DMA-reachable memory.

Testing

NUCLEO-H7S3L8, FreeRTOS port. With every task stack in DTCM the driver without the copy transmits nothing and with it serves HTTP normally; with stacks in AXI SRAM both behave the same. The atomics BusFault was reproduced on the same board. Not tested on other STM32 families.

@dgarske dgarske self-assigned this Nov 12, 2026
Copilot AI balanced review requested due to automatic review settings November 12, 2026 17:39

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #194

Scan targets checked: wolfip-src, wolfip-bugs
Not reviewed (no scan target covers them): IDE/STM32Cube/README.md
Coverage: 1 of 1 in-scope changed file(s) opened by the reviewer

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

Review tier: Max

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The README incorrectly generalizes the speculative-read hazard to peripheral registers, so the explanation should be scoped to the GFXMMU window in the default map’s Normal-memory range.

1 open issue
What changed in this PR

This documentation-only PR explains an STM32H7R/S freeze relevant to issue #192, caused by speculative reads into the unclocked GFXMMU window. It places the mitigation in the application’s MPU configuration rather than the wolfIP Ethernet driver.

Changes:

  • Adds freeze symptoms, a debugger confirmation step, and an MPU no-access configuration example.
  • Adds a pointer to the troubleshooting guidance in the Ethernet driver’s implementation notes.
File Description
src/​port/​stm32_hal/​stm32_hal_eth.h Adds a documentation pointer for the GFXMMU freeze and mitigation.
IDE/​STM32Cube/​README.md Documents the freeze, diagnostic check, and application-level MPU mitigation.

Review effort: Balanced

Comment thread IDE/STM32Cube/README.md Resolved
@dgarske dgarske changed the title Document the STM32H7R/S freeze from speculative reads into the GFXMMU window Add a TX bounce buffer to the STM32 HAL Ethernet driver and document STM32H7R/S MPU traps Nov 12, 2026
@dgarske
dgarske requested review from wolfSSL-Fenrir-bot and a balanced review from Copilot November 12, 2026 21:40

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #194

Scan targets checked: wolfip-src, wolfip-bugs
Not reviewed (no scan target covers them): IDE/STM32Cube/README.md
Coverage: 1 of 2 in-scope changed file(s) opened by the reviewer; not opened: src/port/stm32_hal/stm32_hal_eth.h

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

Review tier: Lite

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the STM32 Ethernet TX bounce-buffer and memory-configuration documentation changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@dgarske dgarske assigned wolfSSL-Bot and aidangarske and unassigned dgarske Nov 12, 2026
@dgarske
dgarske requested a review from aidangarske November 12, 2026 22:09
Comment thread IDE/STM32Cube/README.md Resolved
@aidangarske
aidangarske merged commit a4a9499 into wolfSSL:master Nov 12, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants