Author Topic: Quick boot on Raspberry for embedded application  (Read 2836 times)

0 Members and 1 Guest are viewing this topic.

Offline luiHS

  • Frequent Contributor
  • **
  • Posts: 465
  • Country: es
Re: Quick boot on Raspberry for embedded application
« Reply #25 on: May 27, 2021, 06:57:13 am »
 
Fourth and last attempt, and the same thing happens again, there comes a time that it becomes locked and no longer continues. In htop I  see four compilation processes (I suppose) in state D. All this on a Raspberry pi4 with Debian 10 (not Raspbian).

I have ordered an SSD to install a Linux on my PC and try again.

« Last Edit: May 27, 2021, 06:58:51 am by luiHS »
 

Offline dunkemhigh

  • Super Contributor
  • ***
  • Posts: 3160
Re: Quick boot on Raspberry for embedded application
« Reply #26 on: May 27, 2021, 08:28:41 am »
Quote
All this on a Raspberry pi4 with Debian 10 (not Raspbian)

I'm a bit confused with this - I thought you were building in a VM on a PC, but this suggests you're running it on an actual Pi?
 

Online paf

  • Regular Contributor
  • *
  • Posts: 69
Re: Quick boot on Raspberry for embedded application
« Reply #27 on: May 27, 2021, 11:06:09 am »
A good light Linux distribution for Raspberry is Diet Pi:
https://dietpi.com

You want fast boot times and WifI?
Wifi takes some time to connect. 
 

Offline dunkemhigh

  • Super Contributor
  • ***
  • Posts: 3160
Re: Quick boot on Raspberry for embedded application
« Reply #28 on: May 27, 2021, 11:35:36 am »
Quote
Wifi takes some time to connect.

But booting doesn't have to wait for that to complete. Or even start.
 

Online paf

  • Regular Contributor
  • *
  • Posts: 69
Re: Quick boot on Raspberry for embedded application
« Reply #29 on: May 27, 2021, 03:00:32 pm »
Quote
Wifi takes some time to connect.

But booting doesn't have to wait for that to complete. Or even start.

Yes, you are right.  But he wants to use the system through the Wifi network, so while Wifi is connecting the system has already booted, but he cannot use it...   
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 7306
  • Country: fr
Re: Quick boot on Raspberry for embedded application
« Reply #30 on: May 27, 2021, 05:52:13 pm »
As I've said and others have said, just use an existing, ready-to-use distro, and uninstall whatever you don't need. As I already said, the thing that will matter most is X and the desktop environment. By disabling both just to have a command line when it boots should get you boot times within a few seconds.

I don't know exactly what you're going to do with this, but even if you need a GUI, you don't need a desktop environment. You may not even need X.

You can take a look at this for instance: https://jmeosbn.github.io/blog/minimal-raspbian-pi/
 

Offline luiHS

  • Frequent Contributor
  • **
  • Posts: 465
  • Country: es
Re: Quick boot on Raspberry for embedded application
« Reply #31 on: May 28, 2021, 04:02:17 pm »
 
Today I received the Samsung EVO 870 SSD hard disk that I ordered, and on Monday I will receive a Windows 10 that I ordered from the Microsoft Store.

I will take the opportunity to change my current Windows 7, for a Windows 10, and install both Linux Ubuntu and Windows 10 on the same SSD. I don't have the Windows 10 yet, so I'll install Ubuntu now and rerun the whole buildroot compilation process for Raspberry pi3 and 4.

All of the above (VirtualBox in W7 with Linux, buildroot compiled in Raspberry pi4) I already tried it and it did not work, also when I enabled virtualization in the BIOS to be able to create a 64bit Linux in VirtualBox it disabled the Windows7 license, and it did not work either VirtualBox, it gave me an error. I no longer waste time with those things, now I will work directly on Linux.

I have insisted on working with buildroot, because I have read of people who have achieved versions that boots even in less than 2 seconds, perfect for embedded applications. And from what I was seeing in the buildroot configuration menu there are a lot of options that allow you to create a custom linux only with what you need for the Raspberry. There are preconfigured configuration files for Raspberry 3 and 4, 32 and 64 bit, pretty much the only thing I modified was to include ssh and wifi then run the compilation with make, very easy.

« Last Edit: May 28, 2021, 04:05:27 pm by luiHS »
 

Offline luiHS

  • Frequent Contributor
  • **
  • Posts: 465
  • Country: es
Re: Quick boot on Raspberry for embedded application
« Reply #32 on: May 28, 2021, 06:51:36 pm »
 
With system-analyze I have been looking at the time it takes to start each service, and I see that dhcpcd takes a long time in relation to the others, just over 17 seconds.

Does anyone know if I can remove that service or optimize it so it doesn't take that long?. I have a static IP configured in /etc/dhcpcd.conf

Another thing I do not know is if my application does not start until all services have started. My application is for auto start in /etc/rc.local and does not need WIFI to work, I only put WIFI to access the system to upload files instead of doing it with an Ethernet cable.


« Last Edit: May 28, 2021, 06:54:47 pm by luiHS »
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 7306
  • Country: fr
Re: Quick boot on Raspberry for embedded application
« Reply #33 on: May 28, 2021, 09:38:54 pm »
I have insisted on working with buildroot, because I have read of people who have achieved versions that boots even in less than 2 seconds,

I see, and I admit I don't know what buildroot does exactly on RPi's.

On stock RPi's, the initial "boot" process is handled by the Video Core, and it is closed source. It does what is required to initialize the hardware, load a boot sequence from the SD card and hand it over to the main processor. That part itself takes about 2 seconds on average, even before any OS starts to boot. Does buildroot replace that? Is it even possible on RPi to replace the original bootloader executed on the Video Core?
 

Offline luiHS

  • Frequent Contributor
  • **
  • Posts: 465
  • Country: es
Re: Quick boot on Raspberry for embedded application
« Reply #34 on: May 29, 2021, 04:14:06 pm »
Does buildroot replace that? Is it even possible on RPi to replace the original bootloader executed on the Video Core?


I do not know it, my knowledge about Linux is quite scarce, a few commands from when I managed a dedicated server that I had years ago, and some basic things in Raspberry.

I just googled the way to boot a Raspberry as fast as possible, and the buildroot seems to be the fastest of all.

On the other hand, the configuration is simple and very complete, select one of the presets that are already defined (raspberrry, 3, 4, zero, 32 or 64 bit), run the menuconfig program, select what we want to add and compile with make, I just added ssh and wifi.
« Last Edit: May 29, 2021, 04:48:09 pm by luiHS »
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 7306
  • Country: fr
Re: Quick boot on Raspberry for embedded application
« Reply #35 on: May 29, 2021, 08:59:54 pm »
OK, I think the bootloader on RPis can't be bypassed, and as I said, it lasts about 2 seconds from power on to the OS booting. You'll see that if a display is connected - it displays some kind of rainbow image, and the OS then starts to boot when the image disappears.

So, the overall boot time (from power on) will always be over 2 seconds. In my experience 3 to 5 is achievable. Less than this, I don't think so. Just so you know what to expect.
 

Offline eti

  • Frequent Contributor
  • **
  • Posts: 628
  • Country: gb
Re: Quick boot on Raspberry for embedded application
« Reply #36 on: June 03, 2021, 03:45:00 am »
Why not just boot directly from a USB 3 SSD? Wouldn't this be quick enough? It may not be the cheapest solution, but might be the easiest.

As noted above, you could also turn off unwanted services for extra speed: e.g.
systemctl disable bluetooth
systemctl stop bluetooth

Yep. I timed my Pi 400 booting from a "Leven" JS-600 SSD in a USB 3 caddy, to be around 15 seconds from cold.
 

Offline eti

  • Frequent Contributor
  • **
  • Posts: 628
  • Country: gb
Re: Quick boot on Raspberry for embedded application
« Reply #37 on: June 03, 2021, 03:47:51 am »
not sure you can play videos on the Pi with this minimal linux distro ?

"omxplayer" can play videos without a window a window manager, that's if you can stop it crashing.
 

Offline Monkeh

  • Super Contributor
  • ***
  • Posts: 7233
  • Country: gb
Re: Quick boot on Raspberry for embedded application
« Reply #38 on: June 03, 2021, 03:56:00 am »
I see, and I admit I don't know what buildroot does exactly on RPi's.

The same thing it does on everything else. It's a suite of tools for (cross)compiling a kernel and userspace for embedded applications. It has nothing to do with the bootloader or the hardware of a Pi.


Fourth and last attempt, and the same thing happens again, there comes a time that it becomes locked and no longer continues. In htop I  see four compilation processes (I suppose) in state D. All this on a Raspberry pi4 with Debian 10 (not Raspbian).

You appear to have essentially deadlocked it by running catastrophically out of RAM.

This is what happens when you try and use an embedded system as a workstation.
 

Offline girishv

  • Regular Contributor
  • *
  • Posts: 91
  • Country: in
Re: Quick boot on Raspberry for embedded application
« Reply #39 on: June 05, 2021, 06:44:43 am »
Anyone with experience in the field?

I just need Wifi and the UART. If there was an .img file to create the SD, all the better, because it is complex for me to have to compile and it can take hours before it does not work.
The OpenWRT build system is pretty straight forward. But, you need a working linux system with development libraries installed. As you pointed out it takes few hours to get the build system up and running.

Send a personal message if you want an image.
 

Online DiTBho

  • Frequent Contributor
  • **
  • Posts: 962
  • Country: gb
Re: Quick boot on Raspberry for embedded application
« Reply #40 on: June 05, 2021, 09:31:38 am »
the bootloader on RPis can't be bypassed

There are some experimental attempts. Guys trying to crack the binary code.
It still doesn't work and I think it won't be added to any official repository for a long time.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf