Skip to content

Dual-Device Boot Log Analysis - Document Index

Date: November 28, 2025 Status: Complete Devices Tested: Dev A (CLIENT), Dev B (SERVER) Test Duration: Two full boot cycles


Overview

Comprehensive analysis of two consecutive dual-device boot cycles revealing two critical synchronization failures that prevent the device from meeting EMDRIA therapeutic standards.


Documents in This Analysis

1. DUAL_DEVICE_BOOT_ANALYSIS.md (PRIMARY)

Comprehensive Technical Analysis (2500+ lines)

  • Executive summary with severity assessment
  • Complete root cause analysis for both issues
  • Detailed boot 1 timeline (full table format)
  • Detailed boot 2 timeline (offset inversion sequence)
  • Root cause suspects and code locations
  • Design improvement recommendations
  • Test results summary with pass/fail assessment

Use This For: Technical deep-dive, code review, architecture discussions


2. BOOT_ANALYSIS_SUMMARY.txt (EXECUTIVE)

High-Level Summary with Actionable Fixes

  • Quick overview of Issue #1 and Issue #2
  • Timeline summaries for both issues
  • Detailed explanations in plain language
  • Root cause hypotheses
  • Therapeutic impact assessment
  • Corrective actions with specific file locations
  • Testing checklist
  • Device approval status

Use This For: Management briefing, developer quick-start, initial handoff


3. TIMELINE_TABLES.md (REFERENCE)

Detailed Timing Tables and Comparative Analysis

  • Boot 1 full timeline broken into phases
  • Boot 2 full timeline with offset values
  • Comparative analysis (Boot 1 vs Boot 2)
  • Impact on 20-minute session calculation
  • BLE notification delivery analysis
  • RTT offset inversion mathematical analysis
  • Expected behavior after fixes

Use This For: Debugging, timing validation, regression testing


4. ANALYSIS_QUICK_REFERENCE.txt (POCKET GUIDE)

Quick Reference Card

  • Files created summary
  • Issue #1 summary (3.7 second delay)
  • Issue #2 summary (offset inversion)
  • Therapeutic impact
  • Debugging checklist
  • Code review priorities
  • Expected behavior after fixes

Use This For: Quick lookup, desk reference, testing protocol


Critical Issues Identified

Issue #1: SERVER Motor Starts 3.7 Seconds Before CLIENT

Severity: CRITICAL (Blocks therapeutic use)

Impact: Unilateral vibration (SERVER only) for first 3.7 seconds

Root Cause: MOTOR_STARTED BLE notification latency (3745 ms instead of 50 ms)

Location: src/ble_manager.c - MOTOR_STARTED characteristic write

Timeline: - 12029 ms: SERVER sends MOTOR_STARTED - 15774 ms: CLIENT receives MOTOR_STARTED - Delay: 3745 ms (3 complete motor cycles + partial)

Therapeutic Standard Violation: - EMDRIA requires bilateral alternation from session start - Unilateral vibration is contraindicated - Device does not meet safety/efficacy standards


Issue #2: CLIENT Offset Inverted During RTT Update

Severity: SEVERE (Blocks therapeutic use)

Impact: Antiphase operation (opposite directions) for 12+ seconds

Root Cause: RTT offset calculation sign error in time sync formula

Location: src/time_sync.c - RTT offset recalculation

Timeline: - 6064 ms: Initial offset +353346 µs (correct) - 16314 ms: RTT update inverts to -394378 µs (wrong) - 16454 ms onwards: Antiphase operation (motors opposite directions) - 37044 ms: Catch-up stops with residual -337 µs error

Therapeutic Standard Violation: - EMDRIA requires bilateral alternation throughout - Antiphase disrupts vestibuloocular coordination - Residual error prevents full recovery


How to Use These Documents

For Developers

  1. Quick understanding: Read BOOT_ANALYSIS_SUMMARY.txt
  2. Deep dive: Read DUAL_DEVICE_BOOT_ANALYSIS.md
  3. Reference during coding: Use TIMELINE_TABLES.md and ANALYSIS_QUICK_REFERENCE.txt
  4. Testing: Use debugging checklist in BOOT_ANALYSIS_SUMMARY.txt

For Code Review

  1. Overview: BOOT_ANALYSIS_SUMMARY.txt sections "Root Cause Suspects"
  2. Context: DUAL_DEVICE_BOOT_ANALYSIS.md sections "Root Cause Analysis"
  3. Code locations: ANALYSIS_QUICK_REFERENCE.txt section "FILES TO MODIFY"
  4. Validation: TIMELINE_TABLES.md section "Expected Behavior After Fixes"

For Testing/QA

  1. Test protocol: BOOT_ANALYSIS_SUMMARY.txt section "Testing Checklist"
  2. Expected results: TIMELINE_TABLES.md section "Expected Behavior"
  3. Quick reference: ANALYSIS_QUICK_REFERENCE.txt section "TESTING PROTOCOL"
  4. Verification: BOOT_ANALYSIS_SUMMARY.txt section "Device Status"

For Project Management

  1. Executive summary: BOOT_ANALYSIS_SUMMARY.txt
  2. Impact: BOOT_ANALYSIS_SUMMARY.txt section "Therapeutic Impact"
  3. Timeline: BOOT_ANALYSIS_SUMMARY.txt section "Key Findings"
  4. Next steps: BOOT_ANALYSIS_SUMMARY.txt section "Corrective Actions"

Key Findings Summary

What Works

  • BLE pairing completes successfully
  • Time sync handshake works (initially)
  • Initial motor activation logic correct
  • Catch-up/drift correction algorithm appropriate
  • Individual component testing successful

What Fails

  • Issue #1: BLE MOTOR_STARTED notification delivery extremely delayed
  • Issue #2: RTT offset calculation inverts sign instead of refining
  • Result: Device fails to meet EMDRIA bilateral alternation requirement

Combined Impact

  • Unilateral period: 3.7 seconds (Issue #1)
  • Antiphase period: 12+ seconds (Issue #2)
  • Total non-therapeutic period: 15.7+ seconds (0.8% of 20-minute session)
  • Verdict: Device NOT APPROVED for therapeutic testing

For Different Audiences

Developers (Code Change): 1. BOOT_ANALYSIS_SUMMARY.txt (2 min) 2. ANALYSIS_QUICK_REFERENCE.txt (5 min) 3. TIMELINE_TABLES.md - "Expected Behavior" section (5 min) 4. DUAL_DEVICE_BOOT_ANALYSIS.md - "Root Cause Suspects" (10 min) 5. Code locations and fixes (30+ min implementation)

Project Managers (Status Update): 1. BOOT_ANALYSIS_SUMMARY.txt - Executive summary only (2 min) 2. ANALYSIS_QUICK_REFERENCE.txt - "THERAPEUTIC IMPACT ASSESSMENT" (3 min) 3. ANALYSIS_QUICK_REFERENCE.txt - "SUMMARY" section (2 min)

Testers (Validation Protocol): 1. BOOT_ANALYSIS_SUMMARY.txt - "Testing Checklist" (5 min) 2. TIMELINE_TABLES.md - "Expected Behavior" section (10 min) 3. ANALYSIS_QUICK_REFERENCE.txt - "TESTING PROTOCOL" (3 min)

Technical Reviewers (Deep Analysis): 1. BOOT_ANALYSIS_SUMMARY.txt (complete) (10 min) 2. TIMELINE_TABLES.md (complete) (15 min) 3. DUAL_DEVICE_BOOT_ANALYSIS.md (sections 1-4) (20 min)


Critical Timestamps Reference

Issue #1 Timeline (Boot 1)

Event Time Significance
SERVER motor starts 12029 ms Issue begins
CLIENT notification arrives 15774 ms 3745 ms late
Unilateral period ends 15774 ms Bilateral begins

Issue #2 Timeline (Boot 2)

Event Time Significance
Initial offset set 6064 ms +353 µs (correct)
RTT update occurs 16314 ms Offset becomes -394 µs (wrong)
Antiphase operation starts 16454 ms Motors opposite directions
Catch-up convergence stops 37044 ms Residual -337 µs error remains

Code Locations to Review

Priority 1 (BLOCKING)

  • src/time_sync.c - RTT offset calculation (Issue #2)
  • src/ble_manager.c - MOTOR_STARTED notification (Issue #1)

Priority 2 (SUPPORTING)

  • src/motor_task.c - May need adjustment
  • src/time_sync.h - Offset calculation constants
  • src/ble_manager.h - Notification timing

Test Acceptance Criteria

Device is approved for therapeutic testing ONLY if ALL of the following pass:

Boot 1 Tests

  • MOTOR_STARTED arrives within 100 ms of SERVER motor start
  • Bilateral alternation begins by 6 second mark
  • No unilateral vibration period observed
  • Motor pattern matches LEFT-RIGHT-LEFT-RIGHT

Boot 2 Tests

  • RTT offset stays within ±100 µs of initial offset
  • Offset does NOT invert sign
  • Motors never enter antiphase operation
  • Residual phase error < 50 µs after convergence

Both Boots

  • Back-EMF measurements valid throughout
  • Motor timing matches ±50 µs precision
  • Bluetooth connection stable throughout
  • No watchdog resets or crashes

Document Statistics

Document Type Size Purpose
DUAL_DEVICE_BOOT_ANALYSIS.md MD 2500+ lines Technical deep-dive
BOOT_ANALYSIS_SUMMARY.txt TXT 300 lines Executive summary
TIMELINE_TABLES.md MD 800+ lines Detailed reference tables
ANALYSIS_QUICK_REFERENCE.txt TXT 250 lines Pocket guide
BOOT_ANALYSIS_INDEX.md MD This file Navigation/overview

Total Documentation: 3850+ lines of analysis


Next Steps

  1. Immediate: Distribute to development team
  2. Review: Code review of time_sync.c and ble_manager.c
  3. Implementation: Fix Issue #2 (RTT offset), then Issue #1 (BLE latency)
  4. Testing: Run full test suite with new acceptance criteria
  5. Validation: Verify bilateral alternation from t=0 in both boots
  6. Approval: Only approve for therapeutic testing after all tests pass

Contact & Questions

For questions about this analysis: - Refer to DUAL_DEVICE_BOOT_ANALYSIS.md for detailed explanations - Check TIMELINE_TABLES.md for specific timing questions - Use ANALYSIS_QUICK_REFERENCE.txt for quick lookup - Review code locations in BOOT_ANALYSIS_SUMMARY.txt


Analysis completed November 28, 2025 Device Status: NOT APPROVED FOR TESTING Required Fixes: 2 critical issues Timeline to Resolution: Estimated 1-2 days