-
Notifications
You must be signed in to change notification settings - Fork 0
Development Tools MCUmgr Bootloader Management
Alex J Lennon edited this page Oct 10, 2025
·
2 revisions
⏱️ 15 minutes | Board: Edge EInk | Feature: Zephyr RTOS Power Controller
MCUmgr enables firmware updates and management of the MCXC143VFM power controller running Zephyr RTOS with MCUboot bootloader.
| Command | Purpose | Example |
|---|---|---|
mcumgr-setup |
Configure connection | mcumgr-setup /dev/ttyLP2 115200 pmu |
mcumgr -c pmu image list |
Check firmware | Shows current/pending images |
mcumgr -c pmu image upload firmware.bin |
Update firmware | Upload new firmware |
mcumgr -c pmu reset |
Restart device | Apply firmware update |
- Board: imx93-jaguar-eink with MCXC143VFM power controller
-
Connection: UART via
/dev/ttyLP2at 115200 baud - Power: PMU must be running MCUboot bootloader
- MCUmgr BSP Feature: Automatically enabled on imx93-jaguar-eink
-
Serial Tools:
screen,minicom(auto-installed) -
Permissions: User must be in
dialoutgroup or usesudo
# Check mcumgr is available
which mcumgr
mcumgr version
# Check PMU connection
ls -la /dev/ttyLP2# Set up connection to PMU
mcumgr-setup /dev/ttyLP2 115200 pmu
# Verify connection works
mcumgr -c pmu echo hello# List current firmware images
mcumgr -c pmu image list
# Check device info
mcumgr -c pmu taskstat# 1. Check current firmware
mcumgr -c pmu image list
# 2. Upload new firmware
mcumgr -c pmu image upload /path/to/firmware.signed.bin
# 3. Verify upload
mcumgr -c pmu image list
# 4. Test new firmware (optional - creates test slot)
mcumgr -c pmu image test <hash>
# 5. Confirm firmware (makes permanent)
mcumgr -c pmu image confirm <hash>
# 6. Reset to apply
mcumgr -c pmu reset# If PMU is unresponsive, try bootloader mode
# Hardware reset may be required
# Check if bootloader responds
mcumgr -c pmu echo test
# Upload recovery firmware
mcumgr -c pmu image upload recovery-firmware.signed.bin
mcumgr -c pmu reset# Check memory usage
mcumgr -c pmu stat
# Monitor tasks
mcumgr -c pmu taskstat
# Check system uptime
mcumgr -c pmu echo uptime# Check battery level (if supported)
mcumgr -c pmu stat battery
# Monitor power states
mcumgr -c pmu stat power# Different baud rate
mcumgr conn add pmu_fast type="serial" connstring="dev=/dev/ttyLP2,baud=921600"
# With timeout settings
mcumgr conn add pmu_slow type="serial" connstring="dev=/dev/ttyLP2,baud=115200,timeout=30"# Script multiple operations
#!/bin/bash
CONN="pmu"
mcumgr -c $CONN image list
mcumgr -c $CONN image upload "$1"
mcumgr -c $CONN image confirm
mcumgr -c $CONN reset# Check device permissions
ls -la /dev/ttyLP2
groups # Should include 'dialout'
# Test raw serial connection
screen /dev/ttyLP2 115200
# Check for conflicts
lsof /dev/ttyLP2| Problem | Cause | Solution |
|---|---|---|
| Permission denied | User not in dialout group | sudo usermod -a -G dialout $USER |
| Device not found | PMU not powered/connected | Check hardware, power cycle |
| No response | Wrong baud rate | Try different rates: 9600, 38400, 115200 |
| Upload fails | Insufficient space | Check mcumgr -c pmu stat
|
| Bootloop | Corrupted firmware | Upload known-good firmware |
# Enable verbose logging
export MCUMGR_LOG_LEVEL=debug
mcumgr -c pmu image list
# Check serial traffic
sudo minicom -D /dev/ttyLP2 -b 115200#!/bin/bash
# update-pmu-firmware.sh
set -e
FIRMWARE="$1"
CONN="pmu"
echo "Updating PMU firmware: $FIRMWARE"
# Verify connection
mcumgr -c $CONN echo test || {
echo "PMU not responding"
exit 1
}
# Upload and confirm
mcumgr -c $CONN image upload "$FIRMWARE"
mcumgr -c $CONN image confirm
mcumgr -c $CONN reset
echo "Update complete"# Build, sign, and update in one command
cd /path/to/zephyr/project
west build -b mcxc143vfm
west sign -t imgtool -- --key signing-key.pem
mcumgr -c pmu image upload build/zephyr/zephyr.signed.bin
mcumgr -c pmu reset- Hardware: Hardware-Reference-Edge-EInk-Pinout-And-Interfaces
- Power Management: Edge-EInk-Power-Management
- Serial Setup: Development-Setup-Serial-Port-Configuration
- Troubleshooting: Development-Workflows-Debugging-and-Troubleshooting
- Bootloader: MCUboot with UART serial recovery
- Signing: ECDSA P256 signatures required
- Slots: Dual-slot configuration for safe updates
- Recovery: Hardware reset to bootloader mode
- Signed Images: All firmware must be properly signed
- Secure Boot: ECDSA signature verification
- Rollback Protection: Version-based rollback prevention
- Debug Access: Limited in production builds
- Upload Speed: ~115200 baud (13KB/s theoretical)
- Flash Time: ~30 seconds for typical firmware
- Verification: Automatic CRC checking
- Bootup Time: ~2-3 seconds after reset
💡 Pro Tip: Use mcumgr-setup for quick connection setup, and always verify firmware images with mcumgr -c pmu image list before and after updates.