Stress test report
DMA feed margin under memory-subsystem load - STM32F030x6
Summary
- On the primary bench, every level and clock is clean at the 1 us floor (a 2 us window).
- cndtr_late is 0, no DMA error was latched, and no channel-stop timeout occurred in any primary-bench cell.
- Load activity: at 8 MHz channel 1 restarted 1400 times; at 48 MHz channel 1 restarted 8300 times (level 4; level 5 adds the CPU hammer).
- The default guard is a 6 us window and the 1 us floor a 2 us window; the delay tolerance is a separate measurement (it grows with the guard), so neither window is a safety factor.
- STM32F446xx: 2 default-guard level/clock cells fail (7 cells across the guard sweep).
- STM32H503xx: every level is clean at the default guard.
- STM32F446xx with high load placement: every level is clean at the default guard.
- STM32H503xx with high load placement: 5 default-guard cells fail (22 across the guard sweep); the failing cells show start_timeout=0 and load_error=0.
- STM32F446xx Search ROM: 3 of 20 stressed cells fail at 8 MHz, 16 MHz.
- The priority knob clears every default-guard failure at the measured minimum class (STM32F446xx: 1; STM32H503xx: 3); the library still ships class 0.
- Search ROM on the primary bench returned the same 7 devices and checksum in all 36 cells.
- A delayed feed fails the checks at 72 us (48 MHz) and 74 us (8 MHz); a delayed capture fails at 200 us (both clocks). The harness catches a late transfer on both clocks.
This test checks whether memory load can delay the CCR3 feed DMA past its slot deadline. The primary bench stays clean; the additional benches show where a higher-ranked load can starve the feed. The integration rule below makes that constraint explicit.
What can go wrong
Each write slot is one TIM1 period. At CC2, DMA1 channel 3 is asked for the
next CCR3 value. The update event starts the next slot, so the zero-margin
deadline is guard + 1 microseconds after CC2 (the counter runs
from 0 to ARR inclusive).
| Late transfer | What the wire shows |
|---|---|
| A transfer past the update | the slot keeps its previous value, so a run of equal bits hides it; the first visible damage is at the release - an extra low pulse and the final release never comes. |
| A transfer inside the next low pulse | the pulse stretches or a second edge appears; the slot no longer matches a '1' or a '0' width. |
| A transfer never serviced | CNDTR stays non-zero at completion and the line can be parked low - complete starvation. |
On DMA-fed paths OC3PE is off. A late CCR3 write takes effect immediately, so a failure can appear inside the current slot, not only at the next one.
The delayed-feed sweep shows that this deadline is not where the frame
actually breaks. The first fed slots are '0' bits, whose compare sits about
60 us into the slot, so a write that lands after the update can still reach the
compare in time and the DMA catches up. The measured hold at the first failure
is 72 us at 48 MHz and 74 us at 8 MHz - near that '0' compare, not near
guard + 1. The first detected failure is the release: the
kept failing frames have 65 low pulses instead of 64 and the last pulse never
rises - an extra edge with the final release missing, not a repeated bit. The
measured boundary is therefore much later than guard + 1 and
depends on the pattern and the clock; the delay sweep below measures it, and
the zero-margin rule stays as the conservative design limit.
Rig and method
examples/0_dma_pressure sends a fixed 8-byte pattern (64 slots
plus the release) back to back while a selectable load runs beside the bus. The
bench is STM32F030x6; D0 is the 1-Wire line on PA10. The capture
runs at 4.0 MS/s. The harness flashes the firmware halted and resets it,
so only the intended run is measured.
| MCU | STM32F030x6 |
|---|---|
| Clocks | 8 MHz, 48 MHz |
| Pattern | 00FFAA550FF03CC3 (LSB first, per byte) |
| Firmware frames per cell | 100 |
| Load channels | DMA1 channel 1 (restarted finite bursts) and channel 2 (finite bursts), all at the default priority |
| On-chip check | cndtr_late (DMA1_Channel3->CNDTR
at completion) and TEIF3, read back over SWD |
| Wire check | every low pulse is a '1' or a '0' width, the slot period matches the build, all 64 bits decode, and the frame has exactly 64 pulses and a release |
The first slot is armed by a register write, not the feed DMA. Its width includes the CPU gap between enabling OC3 and starting the timer (about 1 us at 48 MHz, 7 us at 8 MHz), so the check skips that slot's width and the first period of each frame. Guard 0 is not an operating point: CC2 then coincides with the update, and the release write adds a spurious end-of-frame pulse.
Load ladder
| Level | Load | What it does | Evidence at the default guard |
|---|---|---|---|
| 0 | none | The driver's own margin: no load beside the bus. | 8 MHz: -; 48 MHz: - |
| 1 | CPU SRAM hammer | The CPU walks the 1 KiB destination array in the onewire_bus_done() poll loop. | 8 MHz: CPU passes 700; 48 MHz: CPU passes 3300 |
| 2 | finite DMA burst, ~1 ms | A 512-halfword mem-to-memory burst on DMA1 channel 2, started about once per millisecond. | 8 MHz: DMA bursts 501; 48 MHz: DMA bursts 500 |
| 3 | finite DMA burst, back to back | The same channel-2 burst restarted as soon as it drains, so the channel competes for nearly every slot. | 8 MHz: DMA bursts 1400; 48 MHz: DMA bursts 8200 |
| 4 | ch1 burst stream | A finite mem-to-memory burst on DMA1 channel 1, restarted as soon as it drains. Circular mode is not allowed in memory-to-memory (RM0091); channel 1 is the lowest channel number at equal priority. | 8 MHz: ch1 bursts 1400; 48 MHz: ch1 bursts 8300 |
| 5 | ch1 burst stream + CPU | Level 4 plus the CPU SRAM hammer. | 8 MHz: ch1 bursts 700, CPU passes 700; 48 MHz: ch1 bursts 3500, CPU passes 3500 |
Results
Smallest clean guard per level and clock. The parenthetical is the real
transfer window (guard + 1 us). A clean cell has no width, period,
length or decode violation in the frames the analyzer decoded; the firmware
frame counter is shown separately because the analyzer can miss a frame.
| Level | Clock | guard_min | Frames @ 5 us (decoded / firmware) | Violations @ 5 us | CNDTR late | DMA error | Stop timeout | Load evidence | Viewer |
|---|---|---|---|---|---|---|---|---|---|
| 0 | 48 MHz | 1 us (2 us) | 100 | 0 | 0 | 0 | 0 | - | 100 us 5 us 1 us |
| 1 | 48 MHz | 1 us (2 us) | 100 | 0 | 0 | 0 | 0 | CPU passes 3300 | 100 us 5 us 1 us |
| 2 | 48 MHz | 1 us (2 us) | 100 | 0 | 0 | 0 | 0 | DMA bursts 500 | 100 us 5 us 1 us |
| 3 | 48 MHz | 1 us (2 us) | 100 | 0 | 0 | 0 | 0 | DMA bursts 8200 | 100 us 5 us 1 us |
| 4 | 48 MHz | 1 us (2 us) | 99 / 100 | 0 | 0 | 0 | 0 | ch1 bursts 8300 | 100 us 5 us 1 us |
| 5 | 48 MHz | 1 us (2 us) | 100 | 0 | 0 | 0 | 0 | ch1 bursts 3500, CPU passes 3500 | 100 us 5 us 1 us |
| 0 | 8 MHz | 1 us (2 us) | 100 | 0 | 0 | 0 | 0 | - | 100 us 5 us 1 us |
| 1 | 8 MHz | 1 us (2 us) | 100 | 0 | 0 | 0 | 0 | CPU passes 700 | 100 us 5 us 1 us |
| 2 | 8 MHz | 1 us (2 us) | 100 | 0 | 0 | 0 | 0 | DMA bursts 501 | 100 us 5 us 1 us |
| 3 | 8 MHz | 1 us (2 us) | 100 | 0 | 0 | 0 | 0 | DMA bursts 1400 | 100 us 5 us 1 us |
| 4 | 8 MHz | 1 us (2 us) | 100 | 0 | 0 | 0 | 0 | ch1 bursts 1400 | 100 us 5 us 1 us |
| 5 | 8 MHz | 1 us (2 us) | 100 | 0 | 0 | 0 | 0 | ch1 bursts 700, CPU passes 700 | 100 us 5 us 1 us |
The viewer opens one representative frame (64 slots, 1 ms lead-in and tail). The pattern is not a 1-Wire command, so the protocol tree stays empty; the Detail view shows the measured low and slot widths. The JSON holds every tested cell, including the 100 us control and the bisection probes.
Frame-count gap: 48 MHz level 4 at 5 us: 99 decoded, 100 run by the firmware. Where two numbers appear, the second is the firmware's SWD frame counter. The analyzer decoded fewer frames than the firmware ran; every decoded frame passed and the DMA counters are zero, so this is a capture/decode loss, not a feed fault.
CPU-side work
CPU passes completed while the bus was running, at the default guard. The ch1 burst stream does not reduce them here: the DMA interleaves between CPU accesses. The burst count in the table shows the load.
Both loads ran, and the feed still met the 2 us floor.
Capture drain under load
The Search ROM pass reads every bit through the capture DMA (channel 4), so
it tests the other deadline. One search runs per boot at each level and clock,
at every measured guard (1 us, 5 us and 100 us). The unloaded level-0 pass is the baseline (48: 7 devices, 88DB0C9D, 8: 7 devices, 88DB0C9D); a
stressed pass must return the same DS18B20 count and FNV-1a checksum.
| Level | Clock | Guard | DS18B20s | ROM checksum | ROM callbacks | Matches baseline | Viewer |
|---|---|---|---|---|---|---|---|
| 0 | 8 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 1 | 8 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 2 | 8 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 3 | 8 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 4 | 8 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 5 | 8 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 0 | 8 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 1 | 8 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 2 | 8 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 3 | 8 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 4 | 8 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 5 | 8 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 0 | 8 MHz | 100 us | 7 | 88DB0C9D | 7 | yes | frame |
| 1 | 8 MHz | 100 us | 7 | 88DB0C9D | 7 | yes | frame |
| 2 | 8 MHz | 100 us | 7 | 88DB0C9D | 7 | yes | frame |
| 3 | 8 MHz | 100 us | 7 | 88DB0C9D | 7 | yes | frame |
| 4 | 8 MHz | 100 us | 7 | 88DB0C9D | 7 | yes | frame |
| 5 | 8 MHz | 100 us | 7 | 88DB0C9D | 7 | yes | frame |
| 0 | 48 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 1 | 48 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 2 | 48 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 3 | 48 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 4 | 48 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 5 | 48 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 0 | 48 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 1 | 48 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 2 | 48 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 3 | 48 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 4 | 48 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 5 | 48 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 0 | 48 MHz | 100 us | 7 | 88DB0C9D | 7 | yes | frame |
| 1 | 48 MHz | 100 us | 7 | 88DB0C9D | 7 | yes | frame |
| 2 | 48 MHz | 100 us | 7 | 88DB0C9D | 7 | yes | frame |
| 3 | 48 MHz | 100 us | 7 | 88DB0C9D | 7 | yes | frame |
| 4 | 48 MHz | 100 us | 7 | 88DB0C9D | 7 | yes | frame |
| 5 | 48 MHz | 100 us | 7 | 88DB0C9D | 7 | yes | frame |
All 36 stressed cells match. The search filters family 0x28, so
the firmware counts 7 sensors while the viewer shows 8 responders (7 DS18B20
plus 1 DS2431). SEARCH_MAX caps the count at 8, so this is not a
full bus census. At high load the poll loop can stretch the gaps between bits;
the firmware count/checksum is the main check; the gaps are real host idle
time, not dropped samples.
Negative control: a deliberately delayed transfer
This control checks that the harness notices a late transfer.
STRESS_INJECT_US sets a nominal hold: it disables the
feed channel (write mode) or the capture channel (search mode), then re-enables
it. The write path also drops the D1 marker for the real hold, which the
analyzer measures: the busy loop runs 4-5x longer than the nominal value at
both clocks, so the measured column, not the nominal one, is the physical
delay. The delay must make the cell fail.
| Path | Clock | Nominal hold | Measured hold | Result | First failure | Viewer |
|---|---|---|---|---|---|---|
| capture (Search ROM) | 8 MHz | 0 us | - | clean | - | frame |
| capture (Search ROM) | 8 MHz | 200 us | - | detected | 0 devices (checksum 811C9DC5) | frame |
| capture (Search ROM) | 8 MHz | 400 us | - | detected | 0 devices (checksum 811C9DC5) | frame |
| capture (Search ROM) | 8 MHz | 600 us | - | detected | 0 devices (checksum 811C9DC5) | frame |
| capture (Search ROM) | 8 MHz | 1000 us | - | detected | 0 devices (checksum 811C9DC5) | frame |
| capture (Search ROM) | 48 MHz | 0 us | - | clean | - | frame |
| capture (Search ROM) | 48 MHz | 200 us | - | detected | 0 devices (checksum 811C9DC5) | frame |
| capture (Search ROM) | 48 MHz | 400 us | - | detected | 0 devices (checksum 811C9DC5) | frame |
| capture (Search ROM) | 48 MHz | 600 us | - | detected | 0 devices (checksum 811C9DC5) | frame |
| capture (Search ROM) | 48 MHz | 1000 us | - | detected | 0 devices (checksum 811C9DC5) | frame |
| feed (write frame) | 8 MHz | 0 us | 0 us | clean | - | frame |
| feed (write frame) | 8 MHz | 8 us | 34 us | clean | - | frame |
| feed (write frame) | 8 MHz | 10 us | 42 us | clean | - | frame |
| feed (write frame) | 8 MHz | 12 us | 50 us | clean | - | frame |
| feed (write frame) | 8 MHz | 14 us | 58 us | clean | - | frame |
| feed (write frame) | 8 MHz | 16 us | 66 us | clean | - | frame |
| feed (write frame) | 8 MHz | 18 us | 74 us | detected | extra low pulse; final release missing | frame |
| feed (write frame) | 8 MHz | 20 us | 82 us | detected | extra low pulse; final release missing | frame |
| feed (write frame) | 48 MHz | 0 us | 0 us | clean | - | frame |
| feed (write frame) | 48 MHz | 8 us | 36 us | clean | - | frame |
| feed (write frame) | 48 MHz | 10 us | 45 us | clean | - | frame |
| feed (write frame) | 48 MHz | 12 us | 54 us | clean | - | frame |
| feed (write frame) | 48 MHz | 14 us | 63 us | clean | - | frame |
| feed (write frame) | 48 MHz | 16 us | 72 us | detected | extra low pulse; final release missing | frame |
| feed (write frame) | 48 MHz | 18 us | 82 us | detected | extra low pulse; final release missing | frame |
| feed (write frame) | 48 MHz | 20 us | 90 us | detected | extra low pulse; final release missing | frame |
The first delayed feed is detected at 72 us (48 MHz) and 74 us (8 MHz) (measured); the
first delayed capture at 200 us (both clocks). The hold starts at the frame's
first CC2 request, 65 us into the frame, so these values pin how long the first
feed transfer may be held after that request. A window from the frame
start could not show anything below 65 us: the feed had not asked yet. The
measured hold comes from a separate marker build
(STRESS_INJECT_MARKER=1); the marker write is test-only and does
not change the feed path. The search's first capture is later, so its threshold
is higher. The viewer links on the detected rows show the corrupted frame or
search.
Feed delay tolerance vs the guard window
The negative control above runs at the default guard. The same sweep at
several guards shows how the tolerance moves. The values are the measured
hold on the D1 notch (the build knob is nominal and runs 4-5x short), so the
question is whether the last harmless hold tracks guard + 1 plus
a constant.
| Clock | Guard | Clean through | First detected | Guard window | Viewer |
|---|---|---|---|---|---|
| 8 MHz | 1 us | 58 us | 66 us | 2 us | failing frame |
| 8 MHz | 5 us | 66 us | 74 us | 6 us | failing frame |
| 8 MHz | 10 us | 74 us | 82 us | 11 us | failing frame |
| 8 MHz | 20 us | 82 us | 90 us | 21 us | failing frame |
| 48 MHz | 1 us | 54 us | 63 us | 2 us | failing frame |
| 48 MHz | 5 us | 63 us | 72 us | 6 us | failing frame |
| 48 MHz | 10 us | 63 us | 72 us | 11 us | failing frame |
| 48 MHz | 20 us | 72 us | 81 us | 21 us | failing frame |
It does not. The offset over guard + 1
(measured: 8 MHz: +64/+68/+71/+69 us; 48 MHz: +61/+66/+61/+60 us) is roughly constant at 60-70 us: the boundary sits near the first fed
slot's low-pulse compare (about 60 us for a '0'), not near the guard window.
The first fed slots are '0' bits, so a late write still lands before their
compare; the guard only sets the timer's nominal window. The offset varies by
about 10 us across guards and clocks, so a single formula would still be a fit
to noise; the measured boundary is the design number.
The sweep steps by 2 us of nominal hold (about 8-10 us of measured hold),
so the boundary is good to roughly ±5 us: it pins the tolerance to the sweep's
resolution, not to the microsecond. At the default guard the feed survives
well past the 6 us window, which is why the guard window and the delay
tolerance must not be compared as if they were the same quantity. The number to
design against is still the load-placement rule: a higher-ranked burst must not
outlast guard + 1 us. That rule is conservative by construction -
it keeps the request inside the timer's window regardless of how much extra
slack a particular DMA IP tolerates - and the measured survival above shows the
margin it leaves, not an exact failure point.
STM32F4 (STM32F446xx)
| Level | Clock | guard_min | Default guard | Viewer |
|---|---|---|---|---|
| 0 | 180 MHz | 1 us | clean | frame |
| 1 | 180 MHz | 1 us | clean | frame |
| 2 | 180 MHz | 1 us | clean | frame |
| 3 | 180 MHz | 1 us | clean | frame |
| 4 | 180 MHz | 1 us | clean | frame |
| 5 | 180 MHz | 1 us | clean | frame |
| 0 | 16 MHz | 1 us | clean | frame |
| 1 | 16 MHz | 1 us | clean | frame |
| 2 | 16 MHz | 1 us | clean | frame |
| 3 | 16 MHz | 1 us | clean | frame |
| 4 | 16 MHz | 1 us | clean | frame |
| 5 | 16 MHz | 89 us | not clean | failing frame |
| 0 | 8 MHz | 1 us | clean | frame |
| 1 | 8 MHz | 1 us | clean | frame |
| 2 | 8 MHz | 1 us | clean | frame |
| 3 | 8 MHz | 1 us | clean | frame |
| 4 | 8 MHz | 1 us | clean | frame |
| 5 | 8 MHz | never clean | not clean | failing frame |
Search ROM under load returned no devices in 3 of 20 cells (l5/8 MHz/g5, l5/8 MHz/g1, l5/16 MHz/g1); the capture JSON keeps both attempts.
| Level | Clock | Guard | DS18B20s | ROM checksum | ROM callbacks | Matches baseline | Viewer |
|---|---|---|---|---|---|---|---|
| 0 | 8 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 5 | 8 MHz | 1 us | 0 | 811C9DC5 | 0 | no | frame |
| 0 | 8 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 5 | 8 MHz | 5 us | 0 | 811C9DC5 | 0 | no | frame |
| 0 | 16 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 5 | 16 MHz | 1 us | 0 | 811C9DC5 | 0 | no | frame |
| 0 | 16 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 5 | 16 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 0 | 180 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 1 | 180 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 2 | 180 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 3 | 180 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 4 | 180 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 5 | 180 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 0 | 180 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 1 | 180 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 2 | 180 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 3 | 180 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 4 | 180 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 5 | 180 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
Every row links the capture on this bench. The gaps between slots are real host idle time, not dropped samples, so the slot intervals are captured correctly. Whether the ROM search found devices is the Matches column, not the capture quality: a zero-device row still has valid intervals. A failed capture returns 0 devices with checksum 811C9DC5, which is also what an empty bus returns, so check the DMA counters and the capture window before reading a zero as absent sensors.
The floor is the smallest clean guard measured. not clean means even the widest guard tested did not pass. The capture links open one representative frame per cell.
STM32H5 (STM32H503xx)
| Level | Clock | guard_min | Default guard | Viewer |
|---|---|---|---|---|
| 0 | 64 MHz | 1 us | clean | frame |
| 1 | 64 MHz | 1 us | clean | frame |
| 2 | 64 MHz | 1 us | clean | frame |
| 3 | 64 MHz | 1 us | clean | frame |
| 4 | 64 MHz | 1 us | clean | frame |
| 5 | 64 MHz | 1 us | clean | frame |
| 0 | 250 MHz | 1 us | clean | frame |
| 1 | 250 MHz | 1 us | clean | frame |
| 2 | 250 MHz | 1 us | clean | frame |
| 3 | 250 MHz | 1 us | clean | frame |
| 4 | 250 MHz | 1 us | clean | frame |
| 5 | 250 MHz | 1 us | clean | frame |
| 0 | 8 MHz | 1 us | clean | frame |
| 1 | 8 MHz | 1 us | clean | frame |
| 2 | 8 MHz | 1 us | clean | frame |
| 3 | 8 MHz | 1 us | clean | frame |
| 4 | 8 MHz | 1 us | clean | frame |
| 5 | 8 MHz | 1 us | clean | frame |
Search ROM under load matched the baseline in all 36 cells.
| Level | Clock | Guard | DS18B20s | ROM checksum | ROM callbacks | Matches baseline | Viewer |
|---|---|---|---|---|---|---|---|
| 0 | 8 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 1 | 8 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 2 | 8 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 3 | 8 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 4 | 8 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 5 | 8 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 0 | 8 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 1 | 8 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 2 | 8 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 3 | 8 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 4 | 8 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 5 | 8 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 0 | 64 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 1 | 64 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 2 | 64 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 3 | 64 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 4 | 64 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 5 | 64 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 0 | 64 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 1 | 64 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 2 | 64 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 3 | 64 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 4 | 64 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 5 | 64 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 0 | 250 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 1 | 250 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 2 | 250 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 3 | 250 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 4 | 250 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 5 | 250 MHz | 1 us | 7 | 88DB0C9D | 7 | yes | frame |
| 0 | 250 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 1 | 250 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 2 | 250 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 3 | 250 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 4 | 250 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
| 5 | 250 MHz | 5 us | 7 | 88DB0C9D | 7 | yes | frame |
Every row links the capture on this bench. The gaps between slots are real host idle time, not dropped samples, so the slot intervals are captured correctly. Whether the ROM search found devices is the Matches column, not the capture quality: a zero-device row still has valid intervals. A failed capture returns 0 devices with checksum 811C9DC5, which is also what an empty bus returns, so check the DMA counters and the capture window before reading a zero as absent sensors.
The floor is the smallest clean guard measured. not clean means even the widest guard tested did not pass. The capture links open one representative frame per cell.
Load placement and DMA priority
On a classic DMA controller or an F4 DMA stream, equal software priority is
broken by the lower channel/stream number. The historical load sits on the low
numbers (F0 channels 2/1, F4 streams 0/1), so it outranks the feed; the "high"
runs move the same burst to the higher numbers, where the feed wins. GPDMA has
no such tie: CCR.PRIO selects the class, so the H5 "high" run keeps
channels 0/1 and raises the load to PRIO 3 against the feed's PRIO 0. The rows
below are the same levels and guards with only that placement or priority
changed.
| Family | Part | Load placement | Clean cells (default guard) | Failing cells (default guard) |
|---|---|---|---|---|
| STM32F0 | STM32F030x6 | DMA1 channels 2 and 1 | 12 | 0 |
| STM32F4 | STM32F446xx | DMA2 streams 0 and 1 | 16 | 2 |
| STM32H5 | STM32H503xx | GPDMA1 channels 0/1, CCR.PRIO 0 | 18 | 0 |
| STM32F4 | STM32F446xx | DMA2 streams 5 and 6 | 18 | 0 |
| STM32H5 | STM32H503xx | GPDMA1 channels 0/1, CCR.PRIO 3 | 13 | 5 |
These are level/clock cells in the write-frame matrix
at the default guard, not the Search ROM matrix above. A failing cell is a
write frame that did not decode clean. On the H503 PRIO 3 row every failing
cell has start_timeout = 0 and load_error = 0, so the
higher priority starved the feed; the equal-priority H503 row is clean. A part
that is clean in both rows has spare bandwidth; a part that is clean only with
the load below the feed is sensitive to arbitration order.
Why F0 is immune and F4/H5 are not. F0's DMA1 arbitrates one
transfer at a time, so a load channel cannot hold the bus across a whole feed
window. An F4 DMA stream can hold a burst/FIFO, and equal priority is broken by
the lower stream number; the historical load on streams 0/1 therefore wins
against the feed on stream 2. H5 GPDMA uses CCR.PRIO classes
instead of channel-number ties, so a PRIO 3 load can starve the default-priority
feed outright. G0, G4, F1, F3 and H7 are not measured here; predict them from
their arbitration granularity and priority rules rather than from the F0
result.
Integration rule. A higher-ranked, uninterruptible load
burst must not last longer than the feed window (guard + 1 us).
If it can, lower its priority, split it into shorter bursts, or raise the feed
and capture priority above it. The library's reset-default priority is not a
guarantee against an application channel with a higher rank.
That rule is deliberately conservative. The delayed-feed sweep above shows
the feed tolerated 14-16 us at 48 MHz and 16-18 us at 8 MHz at the default
guard, so a burst slightly longer than guard + 1 is not
automatically fatal; the extra slack depends on the DMA IP, the clock and the
bus position, so it is not a design budget. Measure the burst duration under
the worst SRAM contention, not at its nominal length: on the F446 the load on
streams 0/1 is clean at levels 3 and 4 and fails only at level 5, where the
CPU hammer is added. A lower stream number is necessary but not sufficient to
explain a failure.
These rows move the load, not the library. The direct test of the build knob is the next section: the same failing cells re-run with the feed and capture raised.
DMA priority knob: measured effect
OW_DMA_PRIO is the only lever that changes the library itself.
This table takes the write cells that fail at the default guard plus the Search
ROM cells that fail at the guards the Search matrix covers (1 and 5 us), and
re-runs them at each measured class, leaving the load where it was. The
Default column is the committed run with the same load placement: the
F446 default streams for the F446 rows, and the raised H503 load for the H503
rows, because that is the placement the knob was tested against.
| Bench | Load | Matrix | Clock | Level | Guard | Default | OW_DMA_PRIO=1 | OW_DMA_PRIO=2 | OW_DMA_PRIO=3 |
|---|---|---|---|---|---|---|---|---|---|
| STM32F446xx | default | write frame | 8 MHz | 5 | 5 us | fail | clean | clean | clean |
| STM32F446xx | default | write frame | 16 MHz | 5 | 5 us | fail | clean | clean | clean |
| STM32F446xx | default | Search ROM | 8 MHz | 5 | 5 us | fail (0 devices) | clean | clean | clean |
| STM32F446xx | default | Search ROM | 8 MHz | 5 | 1 us | fail (0 devices) | clean | clean | clean |
| STM32F446xx | default | Search ROM | 16 MHz | 5 | 1 us | fail (0 devices) | clean | clean | clean |
| STM32H503xx | high (load PRIO 3) | write frame | 8 MHz | 2 | 5 us | fail | fail | fail | clean |
| STM32H503xx | high (load PRIO 3) | write frame | 8 MHz | 3 | 5 us | fail | fail | fail | clean |
| STM32H503xx | high (load PRIO 3) | write frame | 8 MHz | 4 | 5 us | fail | fail | fail | clean |
| STM32H503xx | high (load PRIO 3) | write frame | 8 MHz | 5 | 5 us | fail | fail | fail | clean |
| STM32H503xx | high (load PRIO 3) | write frame | 64 MHz | 5 | 5 us | fail | fail | fail | clean |
The smallest measured class that clears every default-guard failure is STM32F446xx: 1; STM32H503xx: 3. For the minimal class, the other guards are clean too: STM32F446xx at class 1: 4 of 4 other-guard cells clean; STM32H503xx at class 3: 24 of 24 other-guard cells clean. On classic DMA and F4 streams an equal-class load is still ordered by
channel/stream index, so the knob is not a substitute for the
guard + 1 rule there. On the H5 GPDMA only class 3 is a fixed higher
class; classes 0-2 share a weighted round-robin (RM0492, GPDMA channel
arbitration), which is why classes 1 and 2 do not outrank a PRIO 3 load. The
measured equal class was clean: CCR.PRIO does not break ties by
channel number. The library keeps class 0 by default:
raising it gives the library's pending feed and capture requests precedence
over lower-priority DMA requests during a 1-Wire frame, potentially delaying
those channels. The library asks for one halfword per slot (about every 70 us),
so a victim channel loses one arbitration round per slot, not a frame-long
stall. Victim cost measured: STM32F446xx level 4 ch1 burst counter (class 0 vs class 1): 8 MHz 1800 vs 1800, 16 MHz 3500 vs 3500, 180 MHz 39101 vs 39101 - no measurable loss at this resolution. Where class 1 clears every failure on F4, the cost of raising it is
the open question, not the benefit.
Interpretation
- On the primary bench, no wire-visible slip at the 2 us floor under any load. The additional benches are summarised in their own sections.
cndtr_late = 0everywhere on the primary bench: every feed transfer was serviced before completion, including the final release.- Load activity: channel 1 restarted thousands of times per run (see the table), and the CPU hammer ran too. The feed still met the 2 us floor on the primary bench.
- The default guard is a 6 us window; the 1 us floor is a 2 us window. A late feed is tolerated well past either window (see "Feed delay tolerance vs the guard window"), so the window and the delay tolerance are different quantities, not a safety factor. The library default is sufficient on F0 and on the equal-priority H5 row; the F4 default-placement and H5 PRIO 3 rows show that a higher-ranked load can still starve the feed.
Caveats
- Default priority plus one high-placement row. The default
load channels use their reset priority. The priority section adds one explicit
higher-ranked load per family; an arbitrary application priority is still a
different case. On F4 the equal-priority tie-break is covered by moving the
load to higher stream numbers; on H5 the load is raised to
CCR.PRIO 3against the feed's default. - One rig, several benches, write-only. F0, F4 and H5 used the same firmware and loader. On parts with fewer channels the high-placement load uses the next free number (the F030F4 has no channel 6, so it uses 4). Wiring and marker pins differ per board. The pattern is not a 1-Wire transaction and the devices are never addressed, so this measures master timing, not a protocol exchange.
- Search coverage. Search ROM is measured on F0, F4 and H5. The F4 matrix covers 180 MHz for levels 0-5 and 8/16 MHz for levels 0/5 (guards 1/5); the priority-knob runs add guard 100 for those two clocks. The H5 matrix is 36 cells at 8/64/250 MHz, guards 1/5. The other backends have no Search capture.
- Timer floor. The 1 us timer cannot resolve a guard below 1. The report says "a 2 us window was enough", not "the latency is exactly 1 us".
- Provenance. Each section carries the commit it was measured
at, and the benches were run at different commits as the harness and the
priority knob evolved.
OW_DMA_PRIOwas added after the earliest runs, but with the default class 0 the priority field is the reset value: the0_dma_pressure.binbuilt at2a98b2f2(before the knob) and at the current tree withOW_DMA_PRIO=0are byte-identical (SHA-2560DA3C3D5CC7A9A8A64DED1D925BF2E66C234477974BA076A23843A02F7CA2A6A, 2464 bytes, STM32F030x6), so those runs use the same DMA configuration as a knob build. The knob changes no timing constant and no ABI.
Reproduce
make APP=0_dma_pressure OW_MCU=STM32F030x6 \
EXT="-DOW_PARASITE_POWER=0 -DSTRESS_LEVEL=5 -DONEWIRE_GUARD_BAND=1"
python tests/hil/dma_pressure.py \
--json docs/stress/results.json \
--sr-dir docs/stress/captures
# the priority staircase: the load placement is fixed and the feed/capture
# class is the variable. One file pair per class and bench.
python tests/hil/dma_pressure.py \
--json docs/stress/platforms/h503/results-prio1.json \
--levels 2,3,4,5 --clocks 8,64,250 --guards 1,5,100 \
--gpdma-prio 3 --feed-prio 1
python tests/hil/dma_capture.py \
--json docs/stress/platforms/f446/capture-prio1.json \
--levels 0,5 --clocks 8,16 --feed-prio 1
python tools/stress_report.py \
--data docs/stress/results.json \
--capture docs/stress/capture.json \
--out docs/stress/index.html
The matrix needs an fx2lafw logic analyzer and an ST-Link; it
prints SKIP when either is missing. A full 12-cell run takes a few minutes
because every cell is rebuilt and flashed. The \ above is the
POSIX shell line continuation; in cmd.exe use ^ or
keep each command on one line.
Artifacts
- results.json - every tested write-matrix cell, counters and SWD telemetry.
- capture.json - the Search ROM cells, the deliberately delayed transfer cells and the feed-delay-vs-guard sweep.
- matrix.txt - the exact console output of the write matrix run only.
captures/- one representative frame per cell, in sigrok.srform; the Viewer column above links each one.platforms/- per additional bench:results.json,capture.json, where the load placement was testedresults-high.jsonwith itscaptures-high/, and the priority staircaseresults-prio1/2/3.jsonpluscapture-prio1/2/3.jsonwhere Search ROM was measured (for exampleplatforms/f446/;platforms/h503/has the three write runs, no Search captures).- examples/0_dma_pressure/main.c and tests/hil/dma_pressure.py - the rig and the harness.