-
Notifications
You must be signed in to change notification settings - Fork 0
Edge EInk Power Management
Alex J Lennon edited this page Aug 25, 2025
·
1 revision
Comprehensive power management implementation for the i.MX93 Jaguar E-ink board to optimize low power consumption and provide robust suspend/resume functionality.
File: recipes-bsp/device-tree/lmp-device-tree/imx93-jaguar-eink.dts
- WiFi Power Control: MCXC143VFM-controlled regulator with startup delays
- Bluetooth/802.15.4 Power: Configurable power control with ramp delays
- LTE Power: Removable always-on for better power management
- UART Sleep States: Console and Bluetooth UART with GPIO fallback
- USDHC Sleep States: WiFi SDIO and eMMC with low-power pin configs
- SPI Sleep States: 802.15.4 interface with power-down configurations
Files:
recipes-support/eink-power-management/eink-power-management/setup-wowlan.sh
recipes-support/eink-power-management/eink-power-management/setup-wowlan.service
The system automatically configures selective WiFi wake before each suspend:
# Find correct WiFi PHY
WIFI_PHY=$(find_wifi_phy)
# Enable magic packet wake only
iw phy "$WIFI_PHY" wowlan enable magic-packet
# Verify configuration
iw phy "$WIFI_PHY" wowlan show
- Magic packets only - No wake on network scans or broadcasts
- Power efficient - Prevents unwanted wake events
- Remote wake capability - Can wake device from anywhere on network
File: recipes-support/eink-power-management/eink-power-management/eink-power-config.sh
- WiFi Power GPIO: 634 (GPIO4_26) - MCXC143VFM controlled
- Bluetooth Power GPIO: 632 (GPIO4_24) - BT_RST active-low
- WiFi Wake GPIO: 633 (GPIO4_25) - Out-of-band wake signal
# WiFi wake configured for magic packets only
WAKEUP_SOURCES=usb,wifi-magic
# Prevents unwanted wakeups from network scans/broadcasts
# Allows intentional remote wake via Wake-on-LAN
Files:
recipes-support/eink-power-management/eink-power-management/eink-suspend.sh
recipes-support/eink-power-management/eink-power-management/eink-resume.sh
# Enable WiFi power save
iw dev "$WIFI_INTERFACE" set power_save on
# Configure WoWLAN magic packet wake
iw phy mwiphy0 wowlan enable magic-packet
# Enable device-level wakeup for magic packets
echo enabled > /sys/class/net/wlan0/device/power/wakeup
# Configure GPIO wake sources
echo rising > /sys/class/gpio/gpio633/edge
- CPU governor - Set to powersave during suspend
- Runtime PM - Enable auto power management for all devices
- Filesystem sync - Ensure data integrity before suspend
# 1. Suspend the device
ssh fio@192.168.0.90 "sudo systemctl suspend"
# 2. Wait for suspend (5-10 seconds)
sleep 10
# 3. Verify device is suspended
ping -c 1 192.168.0.90 || echo "Device suspended"
# 4. Wake with magic packet
wakeonlan 22:ba:36:5c:ae:c5
# 5. Wait for wake (5-10 seconds)
sleep 10
# 6. Verify device is awake
ping -c 2 192.168.0.90 && echo "Wake successful!"
# Check suspend/resume logs
sudo journalctl -u eink-suspend.service -f
# Check WoWLAN setup logs
sudo tail -f /var/log/setup-wowlan.log
# Check GPIO configuration
find /sys/class/gpio -name "gpio*" | head -10
# setup-wowlan.service
[Unit]
Description=Setup Wake-on-WLAN for eink board
Before=sleep.target suspend.target hibernate.target hybrid-sleep.target
[Service]
Type=oneshot
ExecStart=/usr/bin/setup-wowlan.sh
RemainAfterExit=yes
[Install]
WantedBy=sleep.target suspend.target
log_message() {
echo "$(date): $1" | tee -a "$LOG_FILE"
}
# Robust PHY detection
find_wifi_phy() {
if iw phy mwiphy0 info >/dev/null 2>&1; then
echo "mwiphy0"
else
# Fallback to first available phy with WoWLAN support
for phy in $(iw phy | grep '^Wiphy' | cut -d' ' -f2); do
if iw phy "$phy" info | grep -q "WoWLAN support"; then
echo "$phy"
return 0
fi
done
fi
}
- LPUART4 for Bluetooth - Uses DAP pin mapping
- USDHC2 for WiFi - SDIO interface with proper power sequencing
- MCXC143VFM power controller - Manages WiFi/BT power rails
&iomuxc {
pinctrl_lpuart5: lpuart5grp {
fsl,pins = <
MX93_PAD_DAP_TDO_TRACESWO__LPUART5_TX 0x31e
MX93_PAD_DAP_TDI__LPUART5_RX 0x31e
MX93_PAD_DAP_TCLK_SWCLK__LPUART5_CTS_B 0x31e
MX93_PAD_DAP_TMS_SWDIO__LPUART5_RTS_B 0x31e
>;
};
};
- Symptom: Device resumes immediately after suspend
- Cause: Active wakeup sources or pending interrupts
-
Solution: Check
/sys/power/wakeup_count
and disable unwanted wake sources
- Symptom: Device doesn't wake on magic packet
- Cause: WoWLAN not configured or wrong PHY name
-
Solution: Verify
iw phy mwiphy0 wowlan show
shows magic packet enabled
-
Symptom:
export_store: invalid GPIO
errors in dmesg - Cause: Incorrect GPIO numbers for i.MX93 platform
- Solution: Use correct GPIO base calculations (GPIO4 base = 608)
# Check WoWLAN status
iw phy mwiphy0 wowlan show
# Check active wake sources
find /sys/devices -name wakeup -exec grep -l enabled {} \;
# Monitor suspend/resume kernel messages
dmesg | grep -E "(suspend|resume|PM:)" | tail -10
# Check GPIO status
cat /proc/interrupts | grep gpio
- Active mode: ~2.5W (WiFi active, display refresh)
- Suspend mode: ~50mW (WiFi wake enabled)
- Deep sleep: ~10mW (minimal wake sources)
- Magic packet wake: 3-10 seconds
- GPIO wake: <1 second
- RTC alarm wake: <1 second
-
5000mAh battery:
- Active use: 8-12 hours
- Standby with WiFi wake: 4-7 days
- Deep sleep: 2-4 weeks
This comprehensive power management implementation enables the Edge EInk board to operate efficiently in battery-powered deployments while maintaining remote wake capabilities for system management.