M3: 5 autonomous LP5562 engine patterns (breathe, heartbeat, slow_pulse, rgb_cycle, color_wash) with dual LED mode support (RGBW/Mono3) and 2mA/ch current for EH-realistic power budget. M4: NTAG5Link I2C slave driver with session register reads, EEPROM write-verify, and NDEF Type 5 text record output. Config check validates CONFIG_0, CONFIG_1, EH_CONFIG against expected values and writes result as NFC-readable text. Verified on hardware: config check passes, NDEF readable via ISO15693 from phone. Key findings from hardware testing: - SRAM passthrough arbiter blocks NFC reads while I2C bus is active (resolves naturally when MCU enters STANDBY — noted in M7 plan) - NTAG5 must be in I2C slave mode (not master) for MCU communication - EH config mask set to 0x00 (skip check during external power testing) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
152 lines
5.4 KiB
Markdown
152 lines
5.4 KiB
Markdown
# xblink Project Status
|
|
|
|
**Current Milestone**: M5 — Boot-from-EEPROM
|
|
**Last Updated**: 2026-03-05
|
|
|
|
---
|
|
|
|
## Phase 0 — Project Setup (COMPLETE)
|
|
|
|
- [x] Initialize git repository and Rust project
|
|
- [x] Configure build target (thumbv6m-none-eabi)
|
|
- [x] Create project documentation (README, CLAUDE.md, STATUS, DEVELOPMENT_PLAN)
|
|
- [x] Verify `cargo build --release` compiles
|
|
- [x] Initial git commit
|
|
|
|
## Group A — LP5562 Only
|
|
|
|
**Hardware needed**: XIAO M0 + LP5562EVM + mini-USB cable
|
|
|
|
### M1: LED Smoke Test
|
|
|
|
- [x] Copy LP5562 driver from `../ntag5-samd21-lp562/src/lp5562.rs`
|
|
- [x] Create `src/led/mod.rs` with re-exports
|
|
- [x] Update `main.rs` with I2C init + GPIO EN + LP5562 direct PWM test
|
|
- [x] Verify `cargo build --release` compiles
|
|
- [x] Verify LP5562 I2C control via EVM USB-to-I2C bridge (`tools/lp5562_evm.py`)
|
|
- [x] Flash XIAO M0 and verify RGBW LED channels with Rust firmware
|
|
|
|
### M2: Engine Patterns
|
|
|
|
- [x] Build breathing pattern (1 engine, ramp up/down, branch loop)
|
|
- [x] Build heartbeat pattern (1 engine, fast ramp, slow decay)
|
|
- [x] Build RGB cycle (3 engines, trigger-synced phase offset)
|
|
- [x] Verify LP5562 runs patterns autonomously (MCU idle loop)
|
|
- [x] Verify MCU can stop and switch patterns (8s cycle between all 3)
|
|
|
|
### M3: Hardcoded Pattern Library (COMPLETE)
|
|
|
|
- [x] Define 5 const patterns in firmware (breathe, heartbeat, slow_pulse, rgb_cycle, color_wash)
|
|
- [x] Implement pattern selector (cycle through patterns, 15s each)
|
|
- [x] Reduce LED current to 2mA/ch (EH-realistic budget)
|
|
- [x] Document engine program structures (`docs/lp5562-engine-reference.md`)
|
|
|
|
## Group B — Add NTAG5Link
|
|
|
|
**Hardware needed**: + NTAG5Link Click board + I2C jumper
|
|
|
|
### M4: NTAG5 EEPROM Read/Write (COMPLETE)
|
|
|
|
- [x] Write `Ntag5Link<I2C>` driver (`src/ntag5/mod.rs`)
|
|
- [x] Implement session register access (CONFIG_0, CONFIG_1, EH_CONFIG)
|
|
- [x] Implement EEPROM block read/write with write-verify
|
|
- [x] Config check: read session regs, compare against expected, write NDEF result
|
|
- [x] NDEF Type 5 text record writer for config check output
|
|
- [x] Verified on hardware: config check passes, NDEF readable via NFC
|
|
- [ ] Register map module (`src/ntag5/registers.rs`) — deferred, constants in mod.rs for now
|
|
|
|
### M5: Boot-from-EEPROM
|
|
|
|
- [ ] Design binary pattern format (informed by M2-M3 experience)
|
|
- [ ] Implement pattern deserializer (`src/pattern/mod.rs`)
|
|
- [ ] Implement engine program builder (`src/pattern/engine.rs`)
|
|
- [ ] Update main.rs: boot → read EEPROM → parse → program LP5562 → idle
|
|
- [ ] Write Python serializer tool for PCSC pattern uploads
|
|
|
|
### M6: SRAM Mailbox
|
|
|
|
- [ ] Implement SRAM read/write (`src/ntag5/sram.rs`)
|
|
- [ ] Design command/response protocol
|
|
- [ ] Implement MCU-side protocol handler
|
|
- [ ] Test pattern update via NFC without power-cycling
|
|
|
|
## Group C — Power + Recovery
|
|
|
|
**Hardware needed**: + Hall sensor + multimeter
|
|
|
|
### M7: Sleep/Wake
|
|
|
|
- [ ] Configure SAMD21 EIC for FD pin wake
|
|
- [ ] Implement STANDBY sleep after LP5562 programming
|
|
- [ ] Verify LP5562 keeps running during MCU sleep
|
|
- [ ] Measure current: active vs standby vs total system
|
|
|
|
### M8: Recovery Mode
|
|
|
|
- [ ] Wire hall sensor to EIC-capable GPIO
|
|
- [ ] Implement boot-time hall sensor check
|
|
- [ ] Recovery: load default pattern, skip EEPROM, stay awake
|
|
- [ ] Test with magnet
|
|
|
|
### M9: Power Characterization
|
|
|
|
- [ ] Measure current at various LED current settings
|
|
- [ ] Test NTAG5Link EH output with phone NFC
|
|
- [ ] Find optimal brightness vs EH budget balance
|
|
- [ ] Document real power numbers
|
|
|
|
## Group D — Abstraction + Polish
|
|
|
|
### M10: LedController Trait
|
|
|
|
- [ ] Define trait based on proven usage patterns from Groups A-C
|
|
- [ ] Implement for LP5562 wrapper
|
|
- [ ] Refactor main.rs to trait-based API
|
|
|
|
### M11: SimplePwm Driver
|
|
|
|
- [ ] Implement only if single-color LED hardware is available
|
|
|
|
## Group E — Future
|
|
|
|
### Custom PCB (SAMD21E)
|
|
|
|
- [ ] Port to `atsamd-hal` with `samd21e` feature
|
|
- [ ] Custom `memory.x` linker script
|
|
- [ ] PCB design and fabrication
|
|
|
|
### Companion App (React Native)
|
|
|
|
- [ ] NFC communication + pattern editor + upload
|
|
|
|
### Firmware Update (NFC OTA)
|
|
|
|
- [ ] Custom bootloader if needed post-implant
|
|
|
|
---
|
|
|
|
## Open Questions
|
|
|
|
| Question | Status | Notes |
|
|
|----------|--------|-------|
|
|
| Energy harvesting power budget | TBD | Multimeter measurements in M9 |
|
|
| Optimal LED current per channel | TBD | Probably 2-5mA/ch, verify in M9 |
|
|
| Firmware update strategy | Deferred | UF2 for dev, NFC OTA evaluated later |
|
|
| NTAG5Link I2C slave address | Assumed 0x54 | Verify in M4 with Click board |
|
|
| Pattern binary format | Deferred to M5 | Design after M2-M3 engine experience |
|
|
| Hall sensor + EN circuit | Designed | Wired-AND: hall + MCU open-drain on EN with 1M pull-up. See `docs/plans/2026-03-03-hall-en-design.md` |
|
|
| Hall sensor part selection | Decided | DRV5032FB (SOT-23, 8.4mT, prototype) → DRV5032FE (X2SON 1x1mm, final PCB) |
|
|
| EN pull-up value | Decided | 1M — zero steady-state draw, 3µA when EN low, ~10µs rise time |
|
|
|
|
## Hardware Inventory
|
|
|
|
| Item | Status | Notes |
|
|
|------|--------|-------|
|
|
| Seeed XIAO M0 | Available | Dev board MCU (SAMD21G18A) |
|
|
| LP5562EVM | Available | TI eval module, RGBW LEDs, I2C addr 0x30 |
|
|
| Mini-USB cable | Available | USB-C, used for flashing XIAO M0 |
|
|
| NTAG5 Link Click | Available, partially wired | Missing I2C jumper to XIAO |
|
|
| Hall effect sensor | Not available | Need to source — TI DRV5032FB (SOT-23) for prototype |
|
|
| ACR1552 PCSC reader | Available | For ntag5sensor Python tooling |
|
|
| Multimeter | Available | For power budget measurements |
|