Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Advantages of Embedded Linux Over Bare Metal PIC Code

Status
Not open for further replies.

matrixofdynamism

Advanced Member level 2
Joined
Apr 17, 2011
Messages
550
Helped
24
Reputation
48
Reaction score
23
Trophy points
1,298
Activity points
7,216
I am not sure what embedded Linux does for us which we cannot do with bare metal code. I want to see Embedded Linux in action. Is there some website that contains basic projects which demonstrate Embedded Linux in action and I can look at the code and learn as well?
 

Aussie Susan

Advanced Member level 4
Joined
Jan 5, 2015
Messages
1,192
Helped
365
Reputation
730
Reaction score
362
Trophy points
83
Activity points
12,912
I'm not sure what the point of this would be. PIC devices, even the larger PIC32 families generally have small RAM and ROM sizes and I would imagine that performance would be terrible, even if you could have enough spare RAM/ROM for your application.
The Microchip C runtime code that comes with the XC families of compilers often give you APIs that simulate the standard I/O devices (after you provide the interface to the UART), but the whole purpose of an embedded device is to do one thing repeatedly, rather than running a general purpose OS.
Also there are RTOSs such as FreeRTOS that can make it a bit easier to run multiple 'threads' on a device. I've used FreeRTOS on a dsPIC33EP series device and that works quite well.
Susan
 

matrixofdynamism

Advanced Member level 2
Joined
Apr 17, 2011
Messages
550
Helped
24
Reputation
48
Reaction score
23
Trophy points
1,298
Activity points
7,216
My question is not PIC specific. PIC is not the only microcontroller I have worked with, but it is the one I have worked with the most. I just want to know what can Linux do that one cannot do with bare metal code. I mean using bare metal code we can communicate with all the peripherals and use interrupts and other features of a target device. Why would one want to move to Linux in this case then?

I am also aware of FreeRTOS.
 

legend01

Newbie level 1
Joined
Sep 26, 2014
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
37
Linux is always preferred because it is free, has very large support and it has great flexibility. one thing that is sure about linux is that the next big thing in operating systems will be available in the next version release which makes it easy for u to port and implement in your application...which is also free.
 

Tahmid

Advanced Member level 5
Joined
Jun 17, 2008
Messages
4,758
Helped
1,791
Reputation
3,574
Reaction score
1,650
Trophy points
1,393
Location
Silicon Valley, California, USA (from Dhaka, Bangl
Activity points
30,545
Ignoring Linux and PIC and speaking in terms of generics, using an OS lets you focus on the application tasks/processes instead of you also having to perform task management. Just a simple example:

You are making a circuit that has a small LCD display that shows time and temperature. Additionally you're connecting to some serial peripheral to retrieve information periodically. With the OS, you can write three processes, one for each required task and not have to worry about time-sharing or task-handling and let the OS do it for you. With bare-bones code, you'd have functions and you'd need to juggle between them as required and managed that yourself. The example I gave is fairly simple but you can imagine how it would be helpful if you scale up.

With Linux or other OS, you get task handling as well as additional capabilities such as networking, IO, file system, etc that makes it easier to get started than dealing with all these yourself.
 

legend01

Newbie level 1
Joined
Sep 26, 2014
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
37
Tahmid, you are just right.. that is a very big advantage which reduces time to market in a production environment and reduces cost of production greatly with an operating system such as Linux or freeRtos depending on the Real Time Requirement. Linux is generally more flexible though.
 

matrixofdynamism

Advanced Member level 2
Joined
Apr 17, 2011
Messages
550
Helped
24
Reputation
48
Reaction score
23
Trophy points
1,298
Activity points
7,216
perfect,

In that case, what is the decided factor between Linux and FreeRTOS? besides the fact that one is RTOS and the other is not?
 

legend01

Newbie level 1
Joined
Sep 26, 2014
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
37
mostly, the decision os based of if you need strict preemptive real time system,
You can go for FreeRtos.. otherwise linux is much more preferable due to ots robustness
 

matrixofdynamism

Advanced Member level 2
Joined
Apr 17, 2011
Messages
550
Helped
24
Reputation
48
Reaction score
23
Trophy points
1,298
Activity points
7,216
As far as I understand, there is also something about Linux have more "apps" and "drivers" which may not be available for FreeRTOS. Does this also count?
 

legend01

Newbie level 1
Joined
Sep 26, 2014
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
37
Yes it counts alot but it really depends on your project
 

Tahmid

Advanced Member level 5
Joined
Jun 17, 2008
Messages
4,758
Helped
1,791
Reputation
3,574
Reaction score
1,650
Trophy points
1,393
Location
Silicon Valley, California, USA (from Dhaka, Bangl
Activity points
30,545
Firstly do you know which target MCU/processor you are running? If you are running eg a PIC32, there's no point in even thinking about Linux ... you can't run it. So, that's a starting point. Alternately, you could start by saying that your design must run Linux and you can choose a target processor accordingly.
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top