docs: expand Arduino firmware best practices, add debugging & connectivity docs#26
Merged
Merged
Conversation
…tivity docs Fix errors in existing Arduino docs, expand best_practices.md with Notecard response checking and general embedded firmware guidance, add new debugging and connectivity document types, and wire them into the discovery path. - Fix printf-in-println bug, stale arduino_note_templates tool reference, and typos in best_practices.md; fix .c/.h and wrong power_management doc ref in index.md - Expand best_practices.md: response checking (responseError/deleteResponse) and general embedded firmware best practices (non-blocking timing, ISR discipline, watchdog, timeouts, fixed-width types, state machines) - Add debugging.md (serial output, logging, card.trace, monitoring) - Add connectivity.md (hub.set tuning, hub.sync, inbound data, resilience) - Advertise new document_types in index.md, tools.go, and handlers.go Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018mdMQc7sPbtAAGhiLnR8t6
Reframe index.md (served by firmware_entrypoint) from a reference page into an orientation document that sequences the build. - Add a "Before You Start" preflight checklist of requirements to gather from the user (ProductUID, hardware, interface, sensors, sync cadence) - Add an ordered "Recommended Workflow" where each step points to the relevant document_type, ending with power optimisation - Fold the duplicated standalone Power Management and Available Documentation sections into the workflow to remove redundancy - Preserve Code Layout, Design Patterns, and the header-comment template Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018mdMQc7sPbtAAGhiLnR8t6
…uino Mine the note-arduino examples and public API for Arduino best practices, verifying every Notecard request against the live API before documenting it. - connectivity.md: add interrupt-driven inbound via the ATTN pin (card.attn file-watch, volatile ISR flag, re-arm + drain). Written against the current arm,files/rearm API — the note-arduino example uses a stale "reset" mode. - debugging.md: add the debugSyncStatus() helper for watching a sync live, cross-referenced from connectivity.md - best_practices.md: document the sendRequestWithRetry / requestAndResponseWithRetry retry variants for requests that must succeed Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018mdMQc7sPbtAAGhiLnR8t6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves the Arduino documentation served by the
firmware_best_practicesandfirmware_entrypointMCP tools: restructures the entrypoint into a guided workflow, fixes several errors in the existing docs, expandsbest_practices.md, adds two new document types, and mines the note-arduino examples/API for additional patterns. All new content was grounded against the live Blues docs (docs_search/api_docs) — every Notecard request was API-verified before being documented.Firmware entrypoint (
index.md)Reframed the entrypoint (served by
firmware_entrypoint) from a reference page into an orientation document that sequences the build:document_type, ending with power optimisation.Fixes to existing docs
best_practices.md: corrected a printf-in-println()bug, replaced the nonexistentarduino_note_templatestool reference withfirmware_best_practices+templates, and fixed a typo.index.md: fixed.c/.h→.cpp/.h, a typo, and corrected the Power Management section, which pointed at the wrongdocument_type.Expanded
best_practices.mdresponseError/deleteResponse/NULL-guard pattern, plus thesendRequestWithRetry/requestAndResponseWithRetryretry variants.millis()timing (overflow-safe), ISR discipline /volatile, bounded waits, fixed-width types, watchdog, state machines, and heap-fragmentation avoidance.New document types
debugging.md—setDebugOutputStream,logDebug/logDebugf, thedebugSyncStatus()helper,card.tracemode, STLinkV3, AUX/FTDI and in-browser terminal monitoring, plus a debugging checklist.connectivity.md—hub.setmode/outbound/inboundtuning and persistence, forcing syncs (sync:true,hub.sync), status checks, polled inbound (note.get/note.changes), interrupt-driven inbound via theATTNpin (card.attn), and offline resilience.From the note-arduino repo
card.attn) added toconnectivity.md. Note: the note-arduino example arms ATTN with aresetmode that no longer exists in the current API — documented the verifiedarm,files/rearmform instead.debugSyncStatus()added todebugging.mdfor watching a sync live.sendRequestWithRetry/requestAndResponseWithRetry) documented inbest_practices.md.Discoverability
Since the handler reads
docs/<sdk>/<type>.md, a new topic file is only reachable if something advertises it. Wired the new types into the entrypoint workflow inindex.mdand updated thedocument_typeexamples intools.goandhandlers.go.Verification
go build ./...passes.document_typefiles +indexresolve through the handler's exact embed read path (removed after verifying).🤖 Generated with Claude Code