I know boot optimization has been already discussed but none of the discussions I read completely solved the problem.
I’m working on this device which needs:
- 4 UARTs
- a number of GPIO as output and some as input
- one PRU
- wireless (internet over WiFi and BT)
Everything is manged by a Python script which is started automatically by a systemd service (nfc-multireader.service).
I’m trying to reduce the boot time since, at some point of the work, from power-on to the device to be usable (application running) it was more than 90s.
For now I performed these steps in order to reduce it:
- updated bootloader and kernel (see version.sh below)
- removed the file /boot/initrd.img-4.14.xxxxx (I read this somewhere, I don’t remember where…it reduces the kernel loading time)
- turned off the wifi AP. This makes the bb-wl18xx-wlan0.service to start much faster
- masked ttyGS0 device (serial port through the microUSB)
(I decided to do the last two point because using systemd-analyze I saw dev-ttyGS0.device and bb-wl18xx-wlan0.service to be blocked in wating state for 60s during boot)
Now systemd-analyze shows pretty good performance (see image)
my application (nfc-multireader.service) is started at t=15s, which is acceptable and I don’t pretend to have it faster, however some of the resources it relies on (in particular internet connectivity and the PRU) become available a while later.
In particular, PRU takes further 25s to be ready (before this time, the /dev/uio device is not there), while internet other 10s.
Then, even if the application is launched at t=15s, it becomes usable only at t=50s.
I also noticed that if I remove the enable_uboot_cape_universal=1 option in the /boot/uEnv.txt everything is faster (the system is up and running in 30s approximately), however this makes GPIOs unavailable (all the other functionalities are still there).
Then I ask three questions:
given my boot (see image above) is it normal that dev-mmcblk1p1.device is in ‘activating’ state for such a long time? Can I make it faster?
can anybody guess why is it taking so long to create /dev/uio and to connect to internet?
as workaround I could remove enable_uboot_cape_universal=1, but then is there any way to enable GPIOs once booted without the universal cape?
Thank you very much, here my version.sh:
dogtag:[BeagleBoard.org Debian Image 2018-08-30]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2019.04-00002-gc8b5ad3a1f]:[location: dd MBR]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade ]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal i2c bluetooth netdev cloud9ide gpio pwm eqep admin spi tisdk weston-launch xenomai]
cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet]
dmesg | grep pinctrl-single
[ 0.690027] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
dmesg | grep gpio-of-helper
[ 0.702147] gpio-of-helper ocp:cape-universal: ready