Skip to content

docs(sdo): configure aligned write buffering for block downloads - #682

Open
timothyanderson096-ocdealcheck wants to merge 1 commit into
canopen-python:masterfrom
timothyanderson096-ocdealcheck:docs/618-aligned-block-buffer
Open

timothyanderson096-ocdealcheck wants to merge 1 commit into
canopen-python:masterfrom
timothyanderson096-ocdealcheck:docs/618-aligned-block-buffer

Conversation

@timothyanderson096-ocdealcheck

Copy link
Copy Markdown

The block-download example reads 1024-byte input chunks while implicitly using a 1024-byte write buffer. Specify buffering=7 * 1024, keep the input reads, and fix the missing multiline with continuation so the literal example parses.

Addresses #618. This follows @christiansandberg's aligned-buffer guidance in #379 and @acolomb's decision when closing that issue. Thanks to @DrJMH for the #618 trace and @Jef-GB for the earlier report. Only doc/sdo.rst changes; runtime code and default buffering remain unchanged.

Validation recorded 25 October 2026, Linux / CPython 3.12.14 / python-can 4.6.1: the original literal example fails syntax parsing. A separate syntactically valid reproduction through the real Network/SdoClient/BufferedWriter path fails after 2044 payload bytes and emits premature DD with default buffer/read size 1024; six configuration controls pass. The corrected actual RST example executes 10 cases, independently rerun: sizes 1, 7, 1024, 7168 and 34680 with CRC off/on. Full base suite 280 passed, one optional-export skip; export-enabled 281 passed; docs build succeeds. Optional mypy retains 44 inherited errors in seven files, exit 1.

The in-memory endpoint checks exact bytes, sequence/final-unused count and CRC. Synthetic data substitutes for unavailable original firmware; its failure response differs from the embedded trace. This matches the client stopping point/premature command, not a hardware replay. Empty/unknown-size streams, arbitrary partial-I/O/backpressure, retransmission, varying block sizes, Win11/STM32/PCAN hardware and the minimum-version matrix remain unvalidated. Python 3.9 grammar was checked; execution used 3.12.

On 27 October, public head 3d2a8275b4da1f40abc020268a5f45b3dec2758a has tree 0764943ae051e69c90b58e9a43106f5038509542, exactly matching clean tested ba01dd9 on unchanged master 14b3336. Saved archive identity, test results and independent review were checked during publication preparation; no fresh project suite rerun is claimed. Closed/unmerged #384's runtime design is not incorporated; current #559/#359 work is separate from this documentation correction.

Prepared with AI assistance and independent inspection during original preparation.

Timothy Anderson — Spotted Ridge Engineering / OC Labs
Independent software verification · GDN (Global Decision Network)
timothyanderson096@gmail.com · Engineering evidence

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.

1 participant