fix: serialize SCServo bus transactions and recover malformed responses - #697
meganetaaan wants to merge 4 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Validation update: CoreS3 release host build passed using an isolated worktree combining this patch with #692 (bf5153f). The Stack-chan AI MOD release archive also builds. XS behavioral tests passed on SDK 9.0 and 9.5; firmware unit tests: 404 passed. Hardware validation has NOT run: another task owns /dev/ttyACM0 via serial2xsbug (PID 508857, started 2026-09-06 15:29 JST). No firmware was flashed or other debugger stopped. Waiting for device handoff; PR remains draft. |
Cloudflare PR previewOpen the latest preview for commit Immutable deployment: https://80421e1f.stack-chan-pr-preview.pages.dev Warning Pull request previews contain untrusted web and firmware code. Review the changes before granting WebSerial/Bluetooth permissions or flashing a device. |
|
実機確認(2026-09-06、CoreS3 ttyACM0): 修正を含む9.5統合release Hostは実機フラッシュとのdigest一致を確認。MODは起動時のXS archive mappingで全体digestが変わるため、同一SIGN c90e3bb6edb180dc23fe80b01bfe2ce9を確認。Cloudflare経由で音声+動作2要求のうち1要求が device_action_failed / scservo command timed out after 120ms、次の1要求は同一sessionでcompleted。発話なし4要求は全てcompleted(audio_duration_ms=0)。この結果からUART timeout解消は未確認で、追加の実機診断が必要です。予定の20/20/10反復試験は未達。失敗request_id: f53122d7-bbd9-46ff-839b-c1608de9384c、2026-09-06T08:43:40.814Z。試験後Cloudflareは元の配信へ復元済み。 |
SCServoの複数IDへの要求を共通キューで直列化し、タイムアウトからの復旧中に次の要求が割り込むことを防ぎます。外部動作の終了時には、片軸の失敗後も両軸のトルクOFFを試み、最初のエラーを呼び出し元へ返します。
追加で、タイムアウト判定の前にUARTの受信FIFOを処理します。ACKが到着済みでもonReadableの通知が遅れると失敗していたケースを修正しました。次の要求の開始前には、待機中に残ったバイトと部分フレームを破棄します。書き込みの自動再送や、失敗を成功扱いする処理は追加していません。
変更規模はpatchです。Changesetを含みます。SDK 9.5対応の #692 とは独立しています。
検証
残っている実機の問題
再起動後はACKの欠落・破損とタイムアウトが再発します。上記40件は再起動をまたぐ安定性を保証しません。サーボ電源の入れ直し、およびUARTの100 nsノイズフィルターも安定した改善にならず、試験変更は撤去しました。通信が破損する原因は未確定のため、Draftを維持します。
関連: meganetaaan/stack-chan-ai#94、#95。通常会話への割込み後も、トルク解除失敗を含む一連の動作の再検証が必要です。