Skip to content

F-33: Task stack headroom unmeasured #36

Open

Description

@bazauto

Severity: MEDIUM · Effort: Small · Batch: 5 · Status: Instrumented in #21 (29b54d2); the bench measurements and any resizing are still open

Found in the second full review of the firmware. Recorded with the rest of the pass (F-19…F-44) in docs/REVIEW_REMEDIATION_PLAN_2.md, which is where its status is kept.

Description

rotary_enc (3 KB) and withrottle_rx (4 KB) run the whole updateAllThrottles LVGL repaint
on their own stacks; the receive task also ran JmriJsonClient::connect from the PW callback
(see F-34). A too-small stack fails as corruption, not as an error.

Plan

Log uxTaskGetStackHighWaterMark for every application task on the bench under load, record
the results in THREADING_MODEL.md, and resize with a margin.

Acceptance Criteria

  • CONFIG_THROTTLE_STACK_REPORT (menuconfig → Diagnostics, off by default) logs every
    application task's high-water mark every 10 s, and the one-shot tasks log theirs as
    they exit. Compiled out when off; the option builds.
  • THREADING_MODEL.md has a table for the measurements and the procedure.
  • Bench: build with the option on, drive under load, fill in the table, and resize any
    task left with less than about a quarter of its stack. Nothing was resized blind.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions