Embedded Linux system development

Thread Starter

Parth786

Joined Jun 19, 2017
642
I have seen in many job application. They mention skill's like Embedded Linux/Linux application/driver/kernel development. I just want to know about Embedded Linux System. I know about embedded system.

An embedded system is some combination of computer hardware and software that is designed for a specific function or for specific functions. In our day-to-day life we frequently use many electronic devices which are designed using embedded systems ...
Operating system is nothing but the millions and millions lines of program run on hardware. Embedded Linux are operating system which are designed for embedded systems. Linux is open source and Linux kernel is designed to emphasize real-time tasks, and run the real-time tasks with a high priority. I think embedded Linux is nothing but program which run on hardware (processor / microcontroller )

Example: Android is type of embedded Linux, developed by Google

Can you tell me simple example embedded Linux. let's suppose a new boy want to make embedded linux operating system. What simple he could be design?

Note : I am not going to make linux operating system. I am just looking very simple example of embedded linux OS which can be run on Processor. When I was searching on internet, I find difficult example like android. I am just looking simple one with small features
 
Last edited:

Thread Starter

Parth786

Joined Jun 19, 2017
642
A very good example of an embedded Linux system is the Raspberry PI.
Thanks @nsaspook

The link that you posted is very useful but still I am not clear about embedded linux development.

let's suppose I want to make fire alarm system. Suppose I have Raspberry PI connected with fire sensor or flame sensor. definitely I have to write program that will run on Raspberry PI and control flame sensor . Linux is operating system and we can install linux operating system on Raspberry PI. I don't think we will modify linux kernel to control flame sensor

I don't understand what is embedded linux programming for fire alarm project and when embedded linux is being used in fire alarm project?

Note : The example I have taken is just for basic understanding
 
Last edited:

spinnaker

Joined Oct 29, 2009
7,835
Thanks @nsaspook

The link that you posted is very useful but still I am not clear about embedded linux development.

let's suppose I want to make fire alarm system. Suppose I have Raspberry PI connected with fire sensor or flame sensor. definitely I have to write program that will run on Raspberry PI and control flame sensor . Linux is operating system and we can install linux operating system on Raspberry PI. I don't think we will modify linux kernel to control flame sensor

I don't understand what is embedded linux programming for fire alarm project and when embedded linux is being used in fire alarm project?

Note : The example I have taken is just for basic understanding

It simply provides a base OS. Makes it easier for your code to talk to peripherals like the monitor, disk drive etc.
 

nsaspook

Joined Aug 27, 2009
8,181
It simply provides a base OS. Makes it easier for your code to talk to peripherals like the monitor, disk drive etc.
It does more than that at the OS low-level. It provides a standard Linux interface(s) for single bit and higher hardware functions that allows you to build drivers that can communicate and interact with a real fire sensor or flame sensor at the kernel level while providing a consistent user program applications interface.

If your sensor has digital I/O for alarms status then you could use the Linux GPIO interface for that.
https://learn.sparkfun.com/tutorials/raspberry-gpio
http://derekmolloy.ie/kernel-gpio-programming-buttons-and-leds/

If you also need to monitor or send analog signals then you could use a device on a serial communications bus (i2c, spi) with a Linux driver (SPI kernel module in the linked example) for that type of device to write a user program (in Python) to send and/or receive analog signals.
https://learn.adafruit.com/raspberry-pi-analog-to-digital-converters?view=all

If you have a somewhat custom requirement that's not already in a standard Linux driver then you can write your own to provide a standard user interface for applications programs.
https://github.com/nsaspook/daq_gert/blob/master/daq_gert.c
http://www.comedi.org/
 

spinnaker

Joined Oct 29, 2009
7,835
For the TS

"It simply provides a base OS. Makes it easier for your code to talk to peripherals like the monitor, disk drive etc."

Don't overwhelm with detail.
 

nsaspook

Joined Aug 27, 2009
8,181
For the TS

"It simply provides a base OS. Makes it easier for your code to talk to peripherals like the monitor, disk drive etc."

Don't overwhelm with detail.
Underwhelming doesn't work either.:(
I'm giving the guy a reading list about embedded Linux and am willing to answer his questions in the small chance he will actually read and have good questions.
 

joeyd999

Joined Jun 6, 2011
4,477
Underwhelming doesn't work either.:(
I'm giving the guy a reading list about embedded Linux and am willing to answer his questions in the small chance he will actually read and have good questions.
Also, there are those of us in the peanut gallery who appreciate your links.

All my embedded work is on PIC. Someday I may actually have reason to use embedded Linux. I appreciate you doing the advance research for me.
 

be80be

Joined Jul 5, 2008
2,051
Linux is a big door. It's open in every way most people don't have a clue to how things would be today without
embedded linux.

I remember the good old days when people wrote the frame work that now makes the cellphones we have so good.
The best way is to install Linux and dig in you can use your box to compile code for about anything you can dream of. That's what got me into using pic chips playing with older arm chips and mips chips that was running around 17 years ago. The PI is a great way to play with hardware there are some older routers laying around that can be lots of fun to for free but you have to read a lot to find the right stuff to get started with.

https://en.wikipedia.org/wiki/Linux_on_embedded_systems
 

Thread Starter

Parth786

Joined Jun 19, 2017
642
I have not responded so far because I really did not understand what is embedded Linux. I really want to learn about embedded Linux. That's why I bought the Raspberry Pi 3. I do not have all the stuff right now. I just have Pi 3 and 16 Micro SD Card with adopter. I thought I could install into SD card until I get the full stuff. I did google and found out below Operating Systems for Raspberry Pi 3

1) Raspbian OS
2) Windows 10 IoT Core.
3) RISC OS Pi.
4) Retro Pi.
5) OSMC.
6) New Linutop OS.
7) Arch Linux ARM.

I visited on offical site of Pi3 https://www.raspberrypi.org/downloads/ There are two options Raspbian and NOOBS. In my research, I found that Raspbian is good. Should I download Raspbian. What is Best Operating Systems for Raspberry Pi 3?
 

simozz

Joined Jul 23, 2017
119
I really did not understand what is embedded Linux
In a few words embedded Linux refer to Linux running on micro-processor devices usually mounted on SOC boards.
These micro-processors have embedded peripherals as SPI, I2C, UART etc. and you must be able to use them.

Suppose you want to use the SPI interface of the ARM micro-processor, no matter what board you are using.
If the SPI is enabled by default in your Linux distro and if everything works fine from the first moment (this only happens in an ideal world :(), if you want to use an SPI from user space, you just need to use the user space libraries and you are fine.

If the SPI is not enabled and you have to enable it by yourself, there come the problems. In order to enable it, in general you need refer to data-sheet of the micro-processor (and we are not talking about a 8 bit micro) to know almost everything needed to write a device-tree file, or modify the available device-tree files (dts extension) from the kernel source (in arch/arm/boot/dts or arch/arm64/boot/dts) or modify a kernel driver source code.
This is usually the hardest task (can be a pain in the ...) because Linux is a huge project and constantly growing up, so it's easy to say 'modify a source code', but you need to know what you are doing before you start to do it.

After each modification you need to recompile the kernel and how to boot it into the device. This could be another problem because each board or device have it's own methods..

In general each manufacturer provides some facilities to work with its devices and boards, but you always will be facing with some problem to solve and read a lot of documentations.

For example, I am now trying to use the hardware CS of an SPI embedded in the micro-processor because it's not working (CS down for the whole transmission), and I am studying the sources to understand what I have to modify etc...
 
Last edited:

Thread Starter

Parth786

Joined Jun 19, 2017
642
Thanks @simozz for detail explanation.

I just want to learn something by doing some practice on board. Have you worked with Raspberry Pi 3. I think we can install Linux operating system into Raspberry Pi 3. I want to install operating system in Raspberry Pi 3. So that I can get more information about embedded Linux.

Please look at my post # 11. Can you tell me which version of Linux should I install in Raspberry Pi 3 ?
 

simozz

Joined Jul 23, 2017
119
You're welcome.
I never used the Raspberry PI 3 neither none of its versions, but you can run a Linux system on it, sure.

In general, look always at the support the manufacturesr give to you. As more documentation and support you have, you better will work.
 
Last edited:

nsaspook

Joined Aug 27, 2009
8,181
Thanks @simozz for detail explanation.

I just want to learn something by doing some practice on board. Have you worked with Raspberry Pi 3. I think we can install Linux operating system into Raspberry Pi 3. I want to install operating system in Raspberry Pi 3. So that I can get more information about embedded Linux.

Please look at my post # 11. Can you tell me which version of Linux should I install in Raspberry Pi 3 ?
Install Raspbian because most embedded Pi systems will use that as the base OS. It's what I normally use on a Raspberry Pi.
 

nsaspook

Joined Aug 27, 2009
8,181
For example, I am now trying to use the hardware CS of an SPI embedded in the micro-processor because it's not working (CS down for the whole transmission), and I am studying the sources to understand what I have to modify etc...
There should be a option on the SPI transfer structure to toggle CS if you use Linux. Unfortunately this part of the SPI code is frequently mangled for some devices. I can't say more without detail on your problem but sometimes you have to construct a SPI message as a sequence of SPI transfers to get the CS toggles correct.
http://ww2.cs.fsu.edu/~rosentha/linux/2.6.26.5/docs/DocBook/kernel-api/re1189.html
All SPI transfers start with the relevant chipselect active. Normally it stays selected until after the last transfer in a message. Drivers can affect the chipselect signal using cs_change.

(i) If the transfer isn't the last one in the message, this flag is used to make the chipselect briefly go inactive in the middle of the message. Toggling chipselect in this way may be needed to terminate a chip command, letting a single spi_message perform all of group of chip transactions together.

(ii) When the transfer is the last one in the message, the chip may stay selected until the next transfer. On multi-device SPI busses with nothing blocking messages going to other devices, this is just a performance hint; starting a message to another device deselects this one. But in other cases, this can be used to ensure correctness. Some devices need protocol transactions to be built from a series of spi_message submissions, where the content of one message is determined by the results of previous messages and where the whole transaction ends when the chipselect goes inactive.
 
Top