Showing posts with label FreeRTOS. Show all posts
Showing posts with label FreeRTOS. Show all posts

Monday, June 13, 2011

An Interview with Richard Barry

Introduction
Fig1: FreeRTOS Logo
Few days ago, we were honored by a visit of Richard Barry to our blog. We asked him to have an interview for our blog. He agreed. The interview focused on various aspects. I tried to get the best out of it for all embedders and FreeRTOS fans.

About Richard Barry
Richard Barry is the founder of FreeRTOS organization, director of Real Time Engineers 
Ltd., and head of innovation in WITTENSTEIN. Richard Barry graduated with 1st Class Honors
in Computing for Real Time Systems. He's been directly involved in the start up of several 
companies, primarily working in the industrial automation and aerospace and simulation 
markets.
 
Fig 2: Richard Barry in  his lab
FreeRTOS Story
Q: FreeRTOS, how did the idea start? How did the idea of the company start?
FreeRTOS originated from a consulting project I did a long time ago.  I was asked to research RTOS solutions, with the aim of recommending a replacement for an RTOS that was used in an existing product. It had been decided that the existing RTOS should be changed because of the royalty based licensing model it used.

During the research, I concluded that the application only required a simple, small, solution, and the existing commercial solutions did not represent good value.  So, I then looked at open source solutions as an alternative, but found these cumbersome to configure, build, and understand - especially on a Windows (as opposed to Linux) host.  My customer and I were both Windows-centric.

I ended up recommending one of the commercial options as ‘best fit’ rather than a ‘perfect fit’ solution.  The project showed me there was a gap in the market – if, indeed, you can call giving software away for free a market.  I thought there must be a lot of engineers going through the same process I had gone through, and coming to the same conclusion, and that these engineers would benefit from a Windows friendly, robust, easy to use, documented, supported, open source solution.  I therefore created FreeRTOS with the intention of it being just that, and also, I must admit, because I'm a geek at heart and it was fun.

I had no intention of taking it further than writing it, and publishing it on the web.  When I set it wild on the internet though, it seemed I had been right - there was demand for it - and some eight years later this has been proven by the results of the latest EETimes Embedded Market Survey.

Yes, I saw a gap in the market, and successfully filled it, but there was also some luck, as around that time the low cost microcontroller market was evolving such that the time was just right for FreeRTOS.

FreeRTOS is extremely liberally licensed, you can use it in commercial applications without risking your own propitiatory IP (provided that IP is outside of the kernel itself).  All the same, I was often asked for commercial licenses, training and commercial support contracts.  I partnered with WITTENSTEIN high integrity systems to meet the commercial and legal need which I could not address myself.  High Integrity Systems are a safety company, and used their knowledge, skill set, and investment to get SafeRTOS certified.  SafeRTOS was originally derived from FreeRTOS, so it was a mutually beneficial arrangement.

WITTENSTEIN also add options for FreeRTOS users by providing the code fully integrated with other embedded software components such as TCP/IP stacks, file systems, USB stacks, etc.  This is done under the OpenRTOS brand. FreeRTOS also provides integrated solutions, with free components.
 

FreeRTOS is intended to provide a resource for engineers, and the business model requires very modest commercial support, in part due to the high level of participation by the engineering community. It is not our goal to become, or indeed would it be possible to become, the next Wind River or Green Hills.

FreeRTOS Markets
Q: What industries do you see that FreeRTOS and its related products can play a role in as a backbone software solution platform?

It would be easier to list which industries it is not used in.  FreeRTOS has had 150,000 downloads in the last two years.  It is found everywhere.  Even I am surprised about some of the places it turns up.

FreeRTOS Business Model
Q: Why the business model followed for FreeRTOS was not followed for the related products?

FreeRTOS does not, yet, provide related products, unless you include the
kernel aware debugger plug-ins, but they are also provided for free download. I provide integration with other open source components though, but again, they too are available for free download.

FreeRTOS Role in facing the Embedded Designers Challenges
Q: What are the challenges embedded developers face and how is FreeRTOS and its related products are aiding their customers to face them?

There are lots of well documented ‘typical’ challenges faced by embedded
engineers.  For example, reducing time to market.  FreeRTOS addresses that particular challenge by providing “out of the box” examples for each of the 50 or so officially supported FreeRTOS ports.  Another typically quoted challenge is cost reduction – well there the instant free download provided by FreeRTOS is an obvious benefit – you don’t even have to part with any personal information to get the code, just take it.

However, I think one of the primary challenges that FreeRTOS aids in addressing, is how to migrate a software design pattern from one that is appropriate for low cost, low resource, 8/16-bit microcontrollers, to a design pattern that is appropriate for one of the new generation of low cost, 32-bit architectures.  The low cost 32-bit architectures come with a lot more RAM, Flash, and a greater number of peripherals.  That in turn, inevitably, leads to larger, more complex, and more feature rich software requirements.  FreeRTOS, along with the FreeRTOS tutorial books, provides an easy solution for engineers that are not familiar with the software challenges this poses.  In fact, I would go as far as to say, FreeRTOS provides an easy solution even for engineers that are familiar with these challenges.

FreeRTOS Coping with Future Trends in Embedded Market
Q: What are the trends you forsee in embedded systems and coping with?

Again there are a lot of well documented trends.  Machine to machine communications, smart metering, hand held devices, near field communications, to name just a few.  The trend I am most interested in,
though, and the one that is relevant to all the above and more, is the trend towards lower costs in 32-bit processing solutions, and lower costs in tools for 32-bit microcontrollers.

FreeRTOS vs Others
Q: What specializes your products compared to others?

That is a difficult question.  From a technical perspective, what is to differentiate one kernel solution from another – don’t they all do the same thing?  Each will do better than others for some criteria, while simultaneously doing worse than others for other criteria.  You have to choose the best for your particular application.

If I was to try and answer that question, I would probably have to talk about non technical attributes.  For example:  

  • Code quality, which can be quantified in a number of ways. I know of
    several people who have done independent analysis of the code, in various ways, and have satisfied themselves of its robustness and quality.

  •  FreeRTOS is a truly cross platform defacto standard.  It will not lock
    you into any architecture, or any toolchain.  It supports 27 architectures (that is, architectures, not devices) and 17 tool chains.  Take your pick, mix and match, and don’t lose the time invested when you move onto your next project.  Not only that, but whatever you do, it need not cost you anything.  Even the time investment required can be lower than with commercial solutions.

  • The FreeRTOS open source model is (somewhat) innovative in a way that
    is beneficial to users.  For example, FreeRTOS is “moderated open source”.  This means that, when you download FreeRTOS, the code is truly free and open source to you.  However, contributions back to FreeRTOS are made publicly available while simultaneous kept separate from the ‘official’ code.  This allows the FreeRTOS project to strictly control the quality of the code, ensuring a robust product.  It also provides assurance to end users that their open source choice has no
    unintentional or unknown IP contamination.

  • The business model allows users the freedom to access, use, evaluate,
    distribute, etc. the code, completely free of charge.  However, they have the security of knowing there is a third party infrastructure there
    should they ever need commercial licensing or support contracts.

  •   FreeRTOS is professional grade and robust, yet still free.  Users can have the confidence in knowing that SafeRTOS, which originated from FreeRTOS, has been independently certified by TUV SUD for use in safety
    critical systems.

  •  I am told, and have not attempted to quantify, that the support provided with FreeRTOS is better and faster than that provided with many commercial products.

  •  FreeRTOS has a *massive* user base.

Final Word
Q: Any final word to embedded developers all over the globe?

I would recommend finally putting the old and repetitive “buy or build yourself” RTOS question away.  There is a free, documented, widely ported, and supported option just a few mouse clicks away, so why would you do either?







Friday, April 22, 2011

New Software Timers in FreeRTOS under MS Windows

SW Timers
Embedded applications need to schedule future events. This can be accomplished using timers and timers' services.

Timers are an integral part of any real-time system. A timer can be seen as an event scheduling according to a predefined time value in the future, exactly like setting an alarm clock.

Embedded systems that have time-sensitive activities use 2 types of timers; hard-timers and soft-timers. Hard timers are based on physical timers on the chip that directly interrupt the CPU. A hard-timer is a must in case of an application demanding high precision and predication. On the other hand soft-timers are scheduled through a software facility that enables soft-timer's maintenance, installation, and removal.

But if hard-timers are more accurate than their soft counterparts, why are they used? The answer is in their nature. The can be programmed with timeouts of course granularity. In addition, the high-precision is not always needed in most of embedded systems. Another prevailing reason is reducing system interrupt overhead. Facilities of soft-timers are built using only 1 hardware-timer.


SW Timers in FreeRTOS
Starting from FreeRTOS V7.0.0, FreeRTOS added the soft-timers feature. FreeRTOS timers have 2 modes of operations; autorelaod and 1-shot modes. Whenever a timer timeouts, a callback function is executed. This service is implemented as a FreeRTOS kernel task and a FreeRTOS queue. This task is assigned a stack size and priority defined the macros configTIMER_TASK_STACK_DEPTH and configTIMER_TASK_PRIORITY respectively. The timers APIs are implemented through the queue. Whenever a task calls a timer API it send s a command to the timer task through the timers queue. This task continually gets the next expire time, either process the expired timer or blocks until a timer expires or  it receives a command  and processes it. Like any other FreeRTOS service, this service is highly configurable. In order to use it you have to:
  1. Define configUSE_TIMERS to 1
  2. Define configTIMER_TASK_PRIORITY and configTIMER_STACK_DEPTH
  3. Define configTIMER_QUEUE_LENGTH
  4. Add FreeRTOS/Source/timers.c to your application.
  5. Use the timers in your application

Demoing the SW Timers under MS Windows
Last year, I showed how to run the industrial PC port under MS Windows. Recently, FreeRTOS team made a windows simulator. Unlike the PC port that used Open Watcom and 80x86 assembly, it uses MS VC or MingW and Windows APIs. 

The following steps shows how to test the SW timers with the FreeRTOS MS Windows simulator:
  1. Download MS VC++ 2010 Express edition from here.
  2. After Installing the compiler, download FreeRTOS from here.
  3. Open the project using MS VC and here you go.



Sunday, July 25, 2010

FreeRTOS Course - Semaphore/Mutex Management

  • Binary Semaphore
  • Counting Semaphore
  • Mutex
  • More about Semaphore/Mutex
  • Semaphore/Mutex Management APIs
  • Lab4: Semaphore Mutex Management

Saturday, July 3, 2010

Free RTOS Course - Queue Management

  • Queues
  • More About Queues
  • Queue Management APIs
  • Lab 3: Queue Management

Sunday, June 27, 2010

Free FreeRTOS Course - Task Management

  • Task C/Cs
  • Task States and Transitions
  • Task Priorities
  • Implementing a Task
  • Task's Hook
  • Idle Task
  • Idle Task Hook
  • Task Management APIs
  • Lab 2: Task Management

Monday, June 21, 2010

Free FreeRTOS Course - Introduction to FreeRTOS

  • At the Beginning
  • FreeRTOS in Literature
  • FreeRTOS History
  • FreeRTOS V6.0.0
  • FreeRTOS Features
  • Related Products
  • Licensing
  • FreeRTOS Variants
  • Free Support
  • Lab 0: Getting Started

Thursday, June 17, 2010

FreeRTOS Free Course

FreeRTOS the Real-Time Kernel

FreeRTOS is a small, yet powerful real-time operating system developed by Richard Barry and FreeRTOS Team and described in his book "Using the FreeRTOS Real-Time Kernel – a Practical Guide". The operating system is highly CPU independent and has been ported to numerous microprocessor platforms. The source code is available via this web site. It is distributed under the GPL with an optional exception. The exception permits users' proprietary code to remain closed source while maintaining the kernel itself as open source, thereby facilitating the use of FreeRTOS in proprietary applications.

FreeRTOS is designed to be small and simple. The kernel itself consists of only three or four C files. To make the code readable, easy to port, and maintainable, it is written mostly in C, but there are a few assembler functions included where needed (mostly in architecture specific scheduler routines). The download contains prepared configurations and demonstrations for every port and compiler, allowing rapid application design.

There are two forks of this OS; OpenRTOS and SafeRTOS. OpenRTOS, which has an identical code base to FreeRTOS but with different licensing. The OpenRTOS license removes all reference to the GPL and its implications. For example, one of the conditions of using FreeRTOS in a commercial product is that the user is made aware of the use of FreeRTOS and the source code must be provided upon request. OpenRTOS doesn't have this requirement. The other spin, SafeRTOS, is based on the FreeRTOS code base but has been updated, documented, tested and audited to enable its use in safety-critical products.

About the Free Course

The course scope is to teach students how to use FreeRTOS APIs. The course is based on V6.05. The course is organized in 8 modules. They are:

· Introduction to FreeRTOS

· Kernel Structure

· Task Management

· Queue Management

· Semaphore/Mutex Management

· Co-Routine Management

· Advanced Features

· FreeRTOS Porting

The labs for these modules are available based on the 80x86 industrial ports that use the open watcom compiler and ARM 7/Cortex that use the Keil compiler. Labs are only available commercially to our customers.

Feel free to post any comments, questions, ad feedback through the blog. I promise I will answer your post within 5 working days ISA.

This free course is for free use as long as the original copyright is reproduced. Feel free to spread, share, modify, or any other verb you can do with the material. Knowledge is every body's right just like air and water.

FreeRTOS GUI

After the course, I will publish a post on how to port an open source GUI for FreeRTOS. This post will help in demonstrating the power of FReeRTOS and how easily it can be extend with middleware. I have tested it only my PC. Work is currently on progress to test it on one of STM32 boards based on the ARM Cortex M3 processors.

Thursday, April 29, 2010

Running FreeRTOS with Microsoft Windows Vista in 1 Hour

About FreeRTOS

FreeRTOS is a real-time operating system for embedded systems, being ported to several microcontrollers. It is distributed under the GPL with an optional exception. The exception permits users' proprietary code to remain closed source while maintaining the kernel itself as open source, thereby facilitating the use of FreeRTOS in proprietary applications.

FreeRTOS is designed to be small and simple. The kernel itself consists of only three or four C files. To make the code readable, easy to port, and maintainable, it is written mostly in C, but there are a few assembler functions included where needed (mostly in architecture specific scheduler routines). The download contains prepared configurations and demonstrations for every port and compiler, allowing rapid application design.

Another related project is OpenRTOS, which has an identical code base to FreeRTOS but with different licensing. The OpenRTOS license removes all reference to the GPL and its implications. For example, one of the conditions of using FreeRTOS in a commercial product is that the user is made aware of the use of FreeRTOS and the source code must be provided upon request. OpenRTOS doesn't have this requirement.

SafeRTOS is a derivative version of FreeRTOS that has been analyzed, documented and tested to meet the stringent requirements of the IEC 61508 safety standard. Complete safety lifecycle documentation artifacts have been created and independently audited to verify IEC 61508 SIL 3 conformance.

FreeRTOS and Windows Simulation

Can the Industrial PC port run under Windows? The answer is yes. In FreeRTOS, there is an x86 port that can run in a dos emulation box. But you should take care that it is a simulation and won't give you the correct response. In addition, there is an ARM port that can be simulated within Keil.

Steps to Run the x86 Port Under Microsoft Windows

1. Download the latest FreeRTOS from here

2. Unpack it under C Drive

3. Download the OpenWatcom tools for windows from here and install it under C drive

4. Open the Open Watcom project in the FreeRTOS/Demo/PC directory - it is called rtosdemo.wpj

5. In main.c, comment the line "vStartComTestTasks( mainCOM_TEST_PRIORITY, serCOM1, ser115200 );" or you will get errors about COM1 not available

Figure 1: FreeRTOS Running Under Microsoft Windows Vista

Next

I think the next step is to make a complete free course about FreeRTOS. This tutorial will serve as a starting point to build complete labs based on windows simulation. I hope, they will be a success like the uCOS-II courses I made earlier.