Linux & RubyCircuit
RubyCircuit RubyCircuit
I’ve been designing a new sensor node with a tight power budget, and I’m hitting a wall trying to get the firmware to stay in low‑power states. Have you ever hooked Linux’s runtime PM into a custom board like that?
Linux Linux
Sure thing, I’ve done that before on a few boards. The key is to make sure every device driver correctly reports its power usage and registers the runtime PM callbacks. You’ll want to call pm_runtime_enable() in the probe, expose the runtime PM node in sysfs, and then use pm_runtime_mark_last_busy() and pm_runtime_put_autosuspend() to let the kernel figure out when to idle. If your sensor’s clocks or peripherals aren’t hooked up to the runtime PM framework, you’ll keep getting spuriously active states. Also double‑check the autosuspend delay in the driver’s init – a low value can cause a lot of wake‑ups. If you expose the device to the kernel’s device tree, you can control everything from there and keep the firmware light. Let me know if you hit a specific snag and I can dive deeper.