Author Topic: Benefits of using Embedded Linux in real world projects  (Read 4055 times)

0 Members and 1 Guest are viewing this topic.

Offline matrixofdynamismTopic starter

  • Regular Contributor
  • *
  • Posts: 180
Benefits of using Embedded Linux in real world projects
« on: March 31, 2023, 04:47:11 pm »
By using embedded linux we can get benefits like open source drivers for peripherals like printer, usb memory stick e.t.c. and get capability to access file system and communicate on network using things like TCP/IP and UDP.

Could you give me a few examples of why you chose embedded linux and what the project did using it for ideas of how it is used in real world projects?
 

Offline shapirus

  • Super Contributor
  • ***
  • Posts: 1369
  • Country: ua
Re: Benefits of using Embedded Linux in real world projects
« Reply #1 on: March 31, 2023, 04:51:15 pm »
Let's define "embedded Linux" first.
 

Offline ppTRN

  • Regular Contributor
  • *
  • Posts: 117
  • Country: it
Re: Benefits of using Embedded Linux in real world projects
« Reply #2 on: March 31, 2023, 05:31:52 pm »
Do you mean something like a Raspberry pi?
 

Offline Foxxz

  • Regular Contributor
  • *
  • Posts: 123
  • Country: us
Re: Benefits of using Embedded Linux in real world projects
« Reply #3 on: March 31, 2023, 06:11:54 pm »
Feel like this is a question on your undergrad homework.

But... You can do things like use higher level programming languages such as python to write complex programs using less and more simplified code.
 

Offline ppTRN

  • Regular Contributor
  • *
  • Posts: 117
  • Country: it
Re: Benefits of using Embedded Linux in real world projects
« Reply #4 on: March 31, 2023, 06:19:29 pm »
Feel like this is a question on your undergrad homework.

Now that you said it i cannot unsee it  |O  ;D
 

Offline shapirus

  • Super Contributor
  • ***
  • Posts: 1369
  • Country: ua
Re: Benefits of using Embedded Linux in real world projects
« Reply #5 on: March 31, 2023, 06:22:51 pm »
Unless we have more detailed description, the answer is: embedded linux, typically understood as an OS with a reduced set of userspace software and a linux kernel compiled with a required minimum set of features, is used for narrow-purpose hardware with a limited computing power and memory size. This is the opposite of general-purpose desktop or server linux distributions which are not feature-limited to be able to run a wide range of software on a wide range of desktop (laptop) and server hardware.

Embedded or not, it's the same linux kernel in every case (sometimes with custom patches), the only difference being compile-time configuration, plus a certain set of software which, combined with the kernel, comprise an operating system.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26907
  • Country: nl
    • NCT Developments
Re: Benefits of using Embedded Linux in real world projects
« Reply #6 on: March 31, 2023, 06:43:20 pm »
Unless we have more detailed description, the answer is: embedded linux, typically understood as an OS with a reduced set of userspace software and a linux kernel compiled with a required minimum set of features, is used for narrow-purpose hardware with a limited computing power and memory size. This is the opposite of general-purpose desktop or server linux distributions which are not feature-limited to be able to run a wide range of software on a wide range of desktop (laptop) and server hardware.
Actually that is no longer true either. Only someone who loves lots of pain would go down the road of Buildroot / Yocto / Openembedded nowadays. Modern day equipment running Linux uses a regular Linux distribution like Debian or Ubuntu. Makes it much easier to keep up with security updates as well.

Feel like this is a question on your undergrad homework.
Indeed. I was thinking it is ChatGPT asking questions but noticed the OP has registered in 2011 already.

Quote
But... You can do things like use higher level programming languages such as python to write complex programs using less and more simplified code.
You can use Python on microcontrollers as well so that is hardly an advantage of having Linux.
« Last Edit: March 31, 2023, 06:45:27 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline shapirus

  • Super Contributor
  • ***
  • Posts: 1369
  • Country: ua
Re: Benefits of using Embedded Linux in real world projects
« Reply #7 on: March 31, 2023, 06:49:44 pm »
Actually that is no longer true either. Only someone who loves pain would go down the road of Buildroot / Yocto / Openembedded nowadays. Modern day equipment running Linux uses a regular Linux distribution like Debian or Ubuntu. Makes it much easier to keep up with security updates as well.
Even so, that distribution may need to be significantly tuned to fit in a small amount of memory, have certain compile-time kernel options enabled or modified, support certain methods of bootloading etc.
Take Armbian for example: it looks and feels just like a regular debian-based distro, yet it is quite a big project in terms of development and maintenance effort. It can be an example of a modern day embedded linux distro.

The lower the computing power, the more specialized (or exotic, if you want) the CPU, the lower the RAM and disk (flash or whatever) size, the more effort goes into making a standard linux distribution suitable for running on the given hardware.
« Last Edit: March 31, 2023, 06:53:11 pm by shapirus »
 

Offline shapirus

  • Super Contributor
  • ***
  • Posts: 1369
  • Country: ua
Re: Benefits of using Embedded Linux in real world projects
« Reply #8 on: March 31, 2023, 06:52:16 pm »
Indeed. I was thinking it is ChatGPT asking questions but noticed the OP has registered in 2011 already.
Lol I also had to go into the profile and check latest posts.

Captchas of the future will ask us to tell which of the two texts was produced by human and which by an AI instead of finding all traffic lights in the picture.
 

Offline JohanH

  • Frequent Contributor
  • **
  • Posts: 627
  • Country: fi
Re: Benefits of using Embedded Linux in real world projects
« Reply #9 on: March 31, 2023, 07:10:40 pm »
By using embedded linux we can get benefits like open source drivers

Could you give me a few examples of why you chose embedded linux

The first sentence answers the question.

Then you can ask, embedded Linux compared to what? Windows? A full Linux distro?

It depends entirely on your application. If you can use x86 hardware, there is no problem running a full Linux distro, which makes your life a bit easier. If it's ARM or some obscure platform, use what the hardware vendor recommends, usually some form of customized distribution. I see both being used. I also see Windows disappear from a lot of specialized applications in the industry. It's replaced by Linux and there are new things invented that weren't possible before.
 

Offline matrixofdynamismTopic starter

  • Regular Contributor
  • *
  • Posts: 180
Re: Benefits of using Embedded Linux in real world projects
« Reply #10 on: April 01, 2023, 11:42:26 pm »
The question is embedded linux vs bare metal.

I am trying to find out if I should spend my hobby time learning about this. My background is FPGAs, RTL and testbench design using VHDL.
 

Offline barshatriplee

  • Regular Contributor
  • *
  • !
  • Posts: 130
  • Country: bd
Re: Benefits of using Embedded Linux in real world projects
« Reply #11 on: April 02, 2023, 12:27:11 am »
The first advantage that comes to my mind is reduction of cost and size. Let's say, you wanna do an automation project, or maybe a machine learning project. Decades ago, you had to use a dedicated computer for each of such projects. But now you can just use an embedded linux board like the Raspberry Pi, Orange Pi or Beaglebone black etc. Not only your cost is reduced, your projects are being more compact. Many IoT projects like the following are done by Raspberry Pi.

https://www.theengineeringprojects.com/2022/11/iot-based-web-controlled-home-automation-using-raspberry-pi-4.html
 

Offline zilp

  • Regular Contributor
  • *
  • Posts: 206
  • Country: de
Re: Benefits of using Embedded Linux in real world projects
« Reply #12 on: April 02, 2023, 01:08:53 am »
I think I'd approach this differently. Forget about "embedded linux" vs. "bare metal", and instead approach it as "being competent at levels above bare-metal code".

Boadly speaking, there isn't anything all that special about embedded linux vs. any other linux. I mean, it's not like there are two linux kernels, one for embedded use and one for non-embedded use. While there sure are aspects to learn that are more important to one application vs. another, and you might end up using differently configured kernels or even different userpace implementations for various embedded use cases, the general userspace API and userspace software you can run on a linux kernel are the same between all the various uses of a linux kernel, subject to hardware limitations, obviously.

As such, I'd think that it is ultimately somewhat arbitrary whether you use "embedded linux" on a processor that directly interfaces your hardware or whether you use "server linux" on a processor that interfaces with a separate processor that runs "bare metal code" to talk to hadware, and which option you'd choose would probably primarily depend on economic considerations.

The reason for using linux is its huge set of features, and the gigantic amount of existing software that can be executed on it, with all of it coming with source code and without licence fees, and the permision to modify it for your needs.

So, if all you want to do is to blink an LED, linux obviously doesn't help you anything with that, but rather just adds a ton of complexity and hardware requirements, so ... don't do that.

On the other hand, if you need to add remote access to your project, and a complex local user interface that needs significant data collection and analysis capabilities ... you could try building all of that from scratch, of course, but then, if you just use linux with SSH, an X server with a GTK/QT application written in Perl/Python/Ruby/go/whatever, you have 90% of what's needed already implemented in very high quality, reliability and security, and you are writing your high-level application code in a language that's probably significantly more productive to write in, especially so with all the available libraries, than if you tried to do the same in C or something, so it's probably a good idea to use linux for that.

But then, again, technically, it doesn't really matter whether you have that software running on a "server" next to your machine or whatever, or on an "embedded board" mounted inside the machine - as far as how you'd implement that software it doesn't make much of a difference.

So, really, the question is whether you want to have competence in writing higher-level software, (inter-)networking, i.e., stuff that's somewhere between impossible and extremely high effort to do on bare metal--and if you do, then linux and the surrounding ecosystem certainly is a good platform for that. Whether you end up putting the software on an embedded processor on on a desktop PC next to the product or on a virtual machine on the customer's network, or on some server in a data center somewhere is kinda secondary ...
 
The following users thanked this post: IOsetting

Online betocool

  • Regular Contributor
  • *
  • Posts: 98
  • Country: au
Re: Benefits of using Embedded Linux in real world projects
« Reply #13 on: April 02, 2023, 12:42:23 pm »
I've been working on a Linux-FPGA embedded platform for pretty much the whole last year.

Let's just say I stuck with a De10-Nano board and used Buildroot to get things started. It is a steep learning curve, and yet very satisfying when you can:
- Blink your LED from and FPGA
- Blink your LED from the ARM processors
- Use the ARM processor to tell the FPGA what to do

Best option is to try and find an existing project with your platform (buildroot has an off-the-shelf configuration for DE10-Nano), I believe Yocto is used for Xilinx dev kits. I tried Yocto for about two weeks and got nowhere... Also, do all your development (FPGA + ARM) on a real Linux box, compiling a small Linux kernel for ARM takes about 1 hour on Buildroot and about 4 on Yocto.

Worth the effort? I thought it was a pain at the beginning, and I'm still learning, but yeah, being able to write a Python 3.10 script that talks to the FPGA fabric is awesome. Definitively worth doing if you're interested and patient.

Hope it helps.

Cheers,

Alberto
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26907
  • Country: nl
    • NCT Developments
Re: Benefits of using Embedded Linux in real world projects
« Reply #14 on: April 02, 2023, 12:48:28 pm »
Actually that is no longer true either. Only someone who loves pain would go down the road of Buildroot / Yocto / Openembedded nowadays. Modern day equipment running Linux uses a regular Linux distribution like Debian or Ubuntu. Makes it much easier to keep up with security updates as well.
Even so, that distribution may need to be significantly tuned to fit in a small amount of memory, have certain compile-time kernel options enabled or modified, support certain methods of bootloading etc.
Take Armbian for example: it looks and feels just like a regular debian-based distro, yet it is quite a big project in terms of development and maintenance effort. It can be an example of a modern day embedded linux distro.
Define small memory nowadays. An Emmc several GBytes in size costs a few dollars. Same for ram. You need to sell a huge number of devices (>100k) to make it worthwhile to use buildroot / Yocto. This has been true for at least a decade already. Tuning an existing distro is not that hard. Ubuntu has a minimalistic install for example. For Debian there are scripts available (from module suppliers) that create a minimal install to which you can add additional packages if you want.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline agehall

  • Frequent Contributor
  • **
  • Posts: 383
  • Country: se
Re: Benefits of using Embedded Linux in real world projects
« Reply #15 on: April 02, 2023, 12:57:42 pm »
Four words: Path of least resistance.

If you need a full fledged OS, use Linux (or some other OS supported by your platform). If you don’t need it, there are probably simpler solutions.

It all comes back to understanding your needs, requirements, skills and previous experiences. For hobby projects it is also a matter of how much new stuff you want to learn.

Some things are just easier to do in a high-level system like Linux while other things are probably easier to do in a bare-metal environment or FreeRTOS.
 

Offline shapirus

  • Super Contributor
  • ***
  • Posts: 1369
  • Country: ua
Re: Benefits of using Embedded Linux in real world projects
« Reply #16 on: April 02, 2023, 12:58:18 pm »
Define small memory nowadays.
I'd say 512MB or less. A lot of SBCs fall into this category.
RAM, of course. For storage, once there is an SD card slot, it's a non-issue.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26907
  • Country: nl
    • NCT Developments
Re: Benefits of using Embedded Linux in real world projects
« Reply #17 on: April 02, 2023, 01:44:29 pm »
Define small memory nowadays.
I'd say 512MB or less. A lot of SBCs fall into this category.
RAM, of course. For storage, once there is an SD card slot, it's a non-issue.
512MB of memory is more than enough to run a regular Linux distribution from which you select the packages you really need. Buildroot / Yocto don't help much where is comes to RAM usage, only flash storage might be reduced a little bit. In my experience you will want to use regular libc and regular system utilities because the low storage footprint versions do have compatibility issues that can eat up a lot of development time quickly.
« Last Edit: April 02, 2023, 01:49:42 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline tunk

  • Frequent Contributor
  • **
  • Posts: 981
  • Country: no
Re: Benefits of using Embedded Linux in real world projects
« Reply #18 on: April 02, 2023, 02:34:22 pm »
The minimum requirements of linux based openwrt is 128MB of RAM and 16MB of flash.
 

Offline matrixofdynamismTopic starter

  • Regular Contributor
  • *
  • Posts: 180
Re: Benefits of using Embedded Linux in real world projects
« Reply #19 on: April 02, 2023, 06:37:18 pm »
I would be gateful if you could give examples of some projects that can be qualify as embedded system and used linux to achieve their primary task. That would be sufficient as answer to this project.

By the way Yocto could be used with Xilinx but this company has created their own PetaLinux that uses Yocto under the hood.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26907
  • Country: nl
    • NCT Developments
Re: Benefits of using Embedded Linux in real world projects
« Reply #20 on: April 02, 2023, 07:06:04 pm »
My most recent Linux based embedded system is a HMI for a piece of mechanics related test equipment. Touchscreen, logging and remote control over a network (both through VNC over SSH or SCPI over a tcp/ip socket) made the choice for Linux an easy one.
« Last Edit: April 02, 2023, 07:07:51 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline matrixofdynamismTopic starter

  • Regular Contributor
  • *
  • Posts: 180
Re: Benefits of using Embedded Linux in real world projects
« Reply #21 on: April 02, 2023, 10:06:05 pm »
@nctnico, touch screen means creating GUI and having ability to process the touch inputs. How was this handled? Qt with C++ or something else?
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26907
  • Country: nl
    • NCT Developments
Re: Benefits of using Embedded Linux in real world projects
« Reply #22 on: April 02, 2023, 10:27:36 pm »
@nctnico, touch screen means creating GUI and having ability to process the touch inputs. How was this handled? Qt with C++ or something else?
Wxwidgets and C++ but it is pretty much the same compared to using Qt. I standarised on WxWidgets a long time ago when Qt wasn't free for commercial purposes.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 3700
  • Country: gb
  • Doing electronics since the 1960s...
Re: Benefits of using Embedded Linux in real world projects
« Reply #23 on: April 03, 2023, 08:42:53 am »
What sort of hardware (CPU etc) would run linux and be suitable for a production run of 10-20 years?

That's always been the huge problem with building a product which is basically a PC. I've seen so many... you have to redesign every few years, or less.

If this wasn't the case, nobody would use freertos, lwip, mbedtls, building http/https servers, etc. Just build a "PC" in a box.

Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26907
  • Country: nl
    • NCT Developments
Re: Benefits of using Embedded Linux in real world projects
« Reply #24 on: April 03, 2023, 09:05:40 am »
What sort of hardware (CPU etc) would run linux and be suitable for a production run of 10-20 years?
NXP's iMX series is a good (and about the only) choice where it comes to versability and long production runs. Some parts are guaranteed to be available for 15 years. However, you want to go for a full-custom design. Don't use modules as you don't have control over the changes and you end up having to modify the software to make it compatible with new module versions.
« Last Edit: April 03, 2023, 09:08:13 am by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf