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.


13 comments:

  1. Free RTOS is a very good RTOS to start with. The only hiccup is that it doesn't have good documentation.
    I will eagerly looking towards your next tutorials in this regard.
    Also, please make a tutorial on how to port this RTOS on to ARM processors.

    Thanks for your effort,
    Pavan

    ReplyDelete
  2. Pavan, as if you are reading my mind. I am currently designing a free course about FreeRTOS.
    I am just digging into the code of FreeRTOS V 6 to understand a little bit more and make a good course Inshallah.
    --
    Amr Ali

    ReplyDelete
  3. Salam Alikom Warhmatu Allah,

    I'm interested to learn FreeRTOS.
    I could not download the presentations.
    Can you please send me the whole set of FreeRTOS presentations.

    Cheers, Iman

    ReplyDelete
  4. We Alikum El Salam Wa Rahmut Allah,
    Presentations are not downloadable through the website.
    Contact me for further details.
    --
    Amr Ali

    ReplyDelete
  5. Hello, I am newbie and i want to know whether I can recompile the code included in
    FreeRTOS/Demo/PC , so that I can use another IDE such as Code::Blocks,
    what are the reasons to use OpenWatcom (i had never heard about it). Any advice would be appreciated. Cheers.
    Javier

    ReplyDelete
  6. I used Open Watcom cause the port was developed using Open Watcom. Lately, they made a new port that uses Windows APIs that use MS VS.

    To use same code with another IDE, you have to try it.

    ReplyDelete
  7. my name is fedrick
    while running demo free rtos program following error msg .please give me tips to remove my problem not even c program is running in my open watcom

    cd D:\Downloads\FreeRTOS\Demo\PC
    wmake -f D:\Downloads\FreeRTOS\Demo\PC\rtosdemo.mk -h -e
    wcc ..\..\SOURCE\croutine.c -i=D:\WATCOM\h;..\common\include;..\..\source\include;..\..\source\portable\owatcom\16bitdos\common -w4 -e25 -za -dOPEN_WATCOM_INDUSTRIAL_PC_PORT -dUSE_STDIO -dDEBUG_BUILD -j -zq -od -s -d2 -fpc -zu -1 -bt=dos -fo=.obj -ml
    Error(E14): Cannot execute (wcc): No such file or directory
    Error(E42): Last command making (D:\Downloads\FreeRTOS\Demo\PC\croutine.obj) returned a bad status
    Error(E02): Make execution terminated
    Execution complete

    ReplyDelete
  8. Make sure that openwatcom is correctly installed.
    --
    Amr

    ReplyDelete
  9. I got the same error. I ended up using freertos version 6 instead of 7.

    ReplyDelete
  10. I got the same error as stated above . I used FreeRTOS V7.4.0.
    Can you please tell why there is an error?

    ReplyDelete
  11. use open-watcom-c-win32-1.9.exe installer , instead of open-watcom-f77-win32-1.9.exe

    ReplyDelete