Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

Advantages of Embedded Linux Over Bare Metal PIC Code

Status
Not open for further replies.

matrixofdynamism

Advanced Member level 2
Advanced Member level 2
Joined
Apr 17, 2011
Messages
593
Helped
24
Reputation
48
Reaction score
23
Trophy points
1,298
Activity points
7,681
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?
 

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
 
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.
 

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.
 

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.
 
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.
 

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?
 

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
 

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?
 

Yes it counts alot but it really depends on your project
 

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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top