You are continuing work on the eink-power-cli project, a Rust-based command-line tool for communicating with the MCXC143VFM power management controller. Phase 1 is 100% complete and the project is ready for Phase 2 implementation.
- ✅ Complete CLI Framework: All commands, arguments, help system working
- ✅ Cross-Compilation: AArch64 builds working for i.MX93 target
- ✅ Target Deployment: Successfully deployed and tested on actual hardware
- ✅ Project Structure: Professional Rust project with proper licensing
- ✅ Build System: Automated build and deployment scripts
- ✅ Documentation: Comprehensive README, implementation plan, changelog
eink-microcontroller/
├── app/ # MCXC143VFM firmware (60+ shell commands analyzed)
└── tools/eink-power-cli/ # ← THIS PROJECT (submodule)
├── src/
│ ├── main.rs # CLI entry point ✅ COMPLETE
│ ├── cli/mod.rs # Command definitions ✅ COMPLETE
│ ├── serial/
│ │ ├── connection.rs # 🚧 NEEDS IMPLEMENTATION
│ │ └── protocol.rs # 🚧 NEEDS IMPLEMENTATION
│ ├── power/ # Power management modules ✅ READY
│ └── error.rs # Error handling ✅ COMPLETE
├── build-aarch64.sh # Cross-compilation script ✅ WORKING
├── deploy-target.sh # Target deployment ✅ WORKING
└── README.md # Complete documentation ✅ DONE
- Board: i.MX93 Jaguar E-ink (imx93-jaguar-eink-fa0dc45a244b189e6ddc3a84426e24af)
- SSH Access:
fio@62.3.79.162:25(SSH key authentication working) - OS: Linux-microPlatform Dynamic Devices Headless 4.0.20-2130-94
- Architecture: aarch64 (ARM 64-bit)
- Binary Location:
/var/rootdirs/home/fio/bin/eink-power-cli - Status: Binary deployed and all CLI commands working perfectly
- Repository:
git@github.com:DynamicDevices/eink-power-cli.git(submodule) - Location:
/home/ajlennon/data_drive/esl/eink-microcontroller/tools/eink-power-cli/ - Cross-Compilation:
aarch64-unknown-linux-gnutarget configured - Build:
./build-aarch64.sh(2.0MB optimized binary) - Deploy:
./deploy-target.sh(automated deployment)
Current Status: All CLI commands show "Command execution not yet implemented" - this is the ONLY thing that needs to be done.
-
Serial Communication (
src/serial/connection.rs):// Currently: Placeholder implementation // Needed: Actual tokio-serial UART communication // Target: /dev/ttyUSB0 at 115200 baud to MCXC143VFM
-
Command Execution (
src/main.rsline ~100):// Currently: println!("Command execution not yet implemented"); // Needed: Actual command routing to serial communication
-
Response Parsing (
src/serial/protocol.rs):// Currently: Placeholder parsing // Needed: Parse MCXC143VFM shell responses (with emojis)
The target controller has 60+ shell commands across 5 modules:
- Debug:
debug:~$ - Production:
prod:~$
# System commands (WORKING IN CLI)
version # Get firmware version
ping # Connectivity test
system info # System information
# Power commands (WORKING IN CLI)
power pmic on|off # Control PMIC
power wifi on|off # Control WiFi
power disp on|off # Control display
# Battery commands (WORKING IN CLI)
ltc2959 read # Read all measurements
ltc2959 status # Battery status
ltc2959 enable # Enable monitoring
# GPIO commands (WORKING IN CLI)
gpio get <port> <pin> # Read GPIO
gpio set <port> <pin> <val> # Set GPIO
# NFC commands (WORKING IN CLI)
nfc status # NFC status
nfc info # Device info📊 LTC2959 Measurements:
🔋 Voltage: 3850 mV
⚡ Current: 125 mA
🔋 Charge: 2450 mAh
🌡️ Temperature: 23°C
// File: src/serial/connection.rs
// Replace placeholder with actual tokio-serial implementation
// Handle: /dev/ttyUSB0, 115200 baud, timeout handling// File: src/main.rs (around line 100)
// Replace: println!("Command execution not yet implemented");
// With: Actual command execution via serial connection// File: src/serial/protocol.rs
// Parse controller responses with emojis and structured data
// Handle: Human and JSON output formats# Build for target
./build-aarch64.sh
# Deploy to target
./deploy-target.sh
# Test on target
ssh -p 25 fio@62.3.79.162
~/bin/eink-power-cli --device /dev/ttyUSB0 version- MCXC143VFM power controller connected via USB serial
- Serial device should appear as
/dev/ttyUSB0or/dev/ttyACM0 - Controller running debug or production firmware
src/serial/connection.rs- Implement actual UART communicationsrc/main.rs- Replace placeholder with command routingsrc/serial/protocol.rs- Add response parsing logic
-
eink-power-cli versionreturns actual controller version -
eink-power-cli pinggets "pong" response from controller -
eink-power-cli battery readshows real LTC2959 data -
eink-power-cli power pmic onactually controls power - JSON output format works with real data
- Error handling for disconnected/missing controller
- Start with
versioncommand - simplest to implement and test - Use existing Python scripts as reference for expected responses
- Test incrementally - deploy and test each command as implemented
- Handle controller prompts - wait for
debug:~$orprod:~$ - Parse emoji responses - controller uses emojis in output
The project is in perfect state for Phase 2 implementation. All infrastructure, build system, deployment, and CLI framework is complete and working. The only task is implementing the actual serial communication protocol.
Next command: Start implementing src/serial/connection.rs with actual tokio-serial UART communication to replace the placeholder.
- Maintainer: Alex J Lennon ajlennon@dynamicdevices.co.uk
- Company: Dynamic Devices Ltd
- License: Commercial
- Repository: https://github.com/DynamicDevices/eink-power-cli