Extreme Pi Boot Optimization
The Raspberry Pi Zero 2 W is optimized for a solar-powered WiFi camera project, achieving a boot time of approximately 3.5 seconds by minimizing energy consumption and disabling unnecessary hardware features.
Read original articleThe article discusses optimizing the boot process of a Raspberry Pi Zero 2 W for a solar-powered WiFi camera project, SolarCamPi. The goal is to minimize energy consumption by reducing both power usage and boot time. The author emphasizes the importance of balancing current consumption and operational time, as excessive time spent booting can negate the benefits of lower current draw. Various strategies are employed, including disabling unnecessary hardware features like HDMI and LEDs, and tweaking CPU turbo settings. The setup involves using tools like the Nordic Power Profiler Kit II for accurate power measurement and the USB-SD-Mux for efficient SD card management. The boot process is modified to execute a custom script that toggles GPIO pins, allowing for precise timing measurements. The article details specific configurations that lead to a significant reduction in current consumption and boot time, ultimately achieving a boot time of approximately 3.5 seconds to reach the Linux user space. The author provides insights into the boot sequence, highlighting the importance of disabling probing for unused peripherals to streamline the process.
- The Raspberry Pi Zero 2 W is optimized for a solar-powered WiFi camera project.
- Energy consumption is minimized by reducing both power usage and boot time.
- Disabling unnecessary hardware features contributes to lower current draw.
- Tools like the Nordic Power Profiler Kit II aid in measuring power consumption accurately.
- The final boot time achieved is approximately 3.5 seconds to reach the Linux user space.
Related
Netboot (PXE) Armbian on an Orange Pi Zero 3 from SPI with NFS Root Filesystem
Guide on netbooting Orange Pi Zero 3 with Armbian for Kubernetes experimentation on SBC cluster. Setup involves SPI, u-boot, TFTP, NFS servers, static IP, PoE switch, u-boot updates, TFTP config, and console access.
Kernel tweaks improve Raspberry Pi performance, efficiency
Development efforts for Raspberry Pi include kernel tweaks like "Suspend to idle" for older models and NUMA support for Pi 5, improving performance and power efficiency. These advancements demonstrate adapting techniques for better computing.
Linux Up and Running on the Raspberry Pi RP2350's Hazard3 RISC-V Cores
Jesse Taube successfully booted a minimal Linux distribution on the Raspberry Pi Pico 2's RP2350 microcontroller, overcoming challenges related to memory management and limited SRAM capacity. Instructions are on GitHub.
New 2GB Raspberry Pi 5 has 33% smaller die, 30% idle power savings
Raspberry Pi launched a 2GB Pi 5 for $50, featuring a smaller, efficient chip with reduced power consumption. It may struggle with modern software requiring more RAM, making it suitable for specific uses.
Jesse Taube Gets Linux Running on the Raspberry Pi RP2350's Hazard3 RISC-V Cores
Jesse Taube successfully booted a minimal Linux distribution on the Raspberry Pi Pico 2's RP2350 microcontroller, overcoming challenges related to memory management and limited SRAM capacity. Instructions are on GitHub.
- Many commenters suggest alternative hardware, like the ESP32, for better power efficiency and faster boot times.
- There is a focus on optimizing boot processes, including using initramfs and custom kernels to reduce boot time.
- Concerns are raised about the proprietary nature of Raspberry Pi's boot code, limiting tinkering and customization.
- Some users share experiences with other platforms, highlighting the importance of power management features in hardware.
- Several comments emphasize the need for granular power consumption data to make informed decisions about performance versus energy use.
I built some cameras for an application like this using a Google Coral mini, whose camera is not nearly as good as the HQ cam, unfortunately, but it supports a built in suspend + wake from onboard RTC that is very easy to use and perfect for a periodic camera app - while still having enough oomph and 2GB of memory to handle a high resolution image. (You can physically hook an HQ camera up but the software pipeline doesn't exist to manage it on the coral AFAIK.)
The Rpi ecosystem is a lot more mature and (sorry, friends) I trust the future availability of rpi more than I trust Google to keep delivering the coral line, but it really underscored how helpful good power support in the hw was.
(Ironically, we ended up outsourcing the next version of these cameras to a firm that built them using an rpi and we just threw in a much larger battery to compensate. Which means I have a stack of 100 unopened coral dev minis + cameras looking for either good ideas or to sell to someone. Oops.)
In some cases, you can even replace something like BusyBox init with a simple bash script that does the bare minimum to boot your application. Mounting devtmpfs, proc, sysfs, etc. Dumping glibc is also worth exploring, if feasible.
Chroot is a good tool to test your initramfs and see if all the necessary application dependencies are present before bundling it into the kernel. If you can run it in a chroot, the kernel can run it during boot, and the development loop is much tighter.
Disabling kernel modules and enabling only the features needed linked into the kernel will save further space and boot time.
It would also be helpful to test zstd compression instead of gzip.
- https://www.furkantokac.com/rpi3-fast-boot-less-than-2-secon...
- http://himeshp.blogspot.com/2018/08/fast-boot-with-raspberry...
I used these two to make a digital photo frame with a Pi that boots very quickly to a browser in kiosk mode. If you have very minimal requirements, you can get some very impressive boot times.
How horrible that a tinkering/hobbies project has to have these hidden secret blackboxes that can't be modified.
> For example: Disabling CPU turbo just to save some current consumption is a bad choice, because the resulting extra time will use more energy than just getting the job done quickly and shutting off.
In one of my computer engineering classes, I learned that power consumption rises as the square of clock frequency - so doubling the clock will quadruple the power.
That seems like it'd imply that you'd actually have to measure the power difference to determine if the quadratic increase from the clock boost will outweigh the product of the constant power consumption with the additional time spent on the task.
Related - it'd be nice if the Pi's CPUs included granular power consumption information, either derivable from the datasheet, or as real-time values exposed in registers.
I'm not a hw person so curious how to complete the task with minimum budget.
Interesting read. Thank you!
In addition, I wonder if it would be possible to optimize the EFI/BIOS on such a device. At least on my standard Arch Linux desktop, it takes a significant amount of boot time:
$ systemd-analyze
Startup finished in 10.076s (firmware) + 1.339s (loader) + 1.569s (kernel) + 2.974s (initrd) + 3.894s (userspace) = 19.854s
Lowering the power usage is awesome too.
Also I feel (but don't know for sure) most of the time before executing the user space program would be spent by systemd.
0.15 s is the going rate these days.
Is that not a thing on a pi?
Related
Netboot (PXE) Armbian on an Orange Pi Zero 3 from SPI with NFS Root Filesystem
Guide on netbooting Orange Pi Zero 3 with Armbian for Kubernetes experimentation on SBC cluster. Setup involves SPI, u-boot, TFTP, NFS servers, static IP, PoE switch, u-boot updates, TFTP config, and console access.
Kernel tweaks improve Raspberry Pi performance, efficiency
Development efforts for Raspberry Pi include kernel tweaks like "Suspend to idle" for older models and NUMA support for Pi 5, improving performance and power efficiency. These advancements demonstrate adapting techniques for better computing.
Linux Up and Running on the Raspberry Pi RP2350's Hazard3 RISC-V Cores
Jesse Taube successfully booted a minimal Linux distribution on the Raspberry Pi Pico 2's RP2350 microcontroller, overcoming challenges related to memory management and limited SRAM capacity. Instructions are on GitHub.
New 2GB Raspberry Pi 5 has 33% smaller die, 30% idle power savings
Raspberry Pi launched a 2GB Pi 5 for $50, featuring a smaller, efficient chip with reduced power consumption. It may struggle with modern software requiring more RAM, making it suitable for specific uses.
Jesse Taube Gets Linux Running on the Raspberry Pi RP2350's Hazard3 RISC-V Cores
Jesse Taube successfully booted a minimal Linux distribution on the Raspberry Pi Pico 2's RP2350 microcontroller, overcoming challenges related to memory management and limited SRAM capacity. Instructions are on GitHub.