Using ‘FreeRTOS’ in STM32 DISCOVERY board

Recently I have been learning bits about RTOS (Real Time Operating System). I decided to try one on the STM32-DISCOVERY board. There are many RTOSs that can be used for this task. But I wanted a very simple RTOS which could quickly get me started. I’ve heard about FreeRTOS and decided to use it as an experiment.


FreeRTOS is a very well documented RTOS. It is also free and open. It has many demonstrations(examples) and it even has general steps required to port the system to different compilers, processors and evaluation kits. To get things started quickly I wanted a compiling Keil project. I found a full project here which is compiling and can be directly put to the DISCOVERY board.

But the version of RTOS used in the sample project above is not the latest. (At the time of writing the post the RTOS version is FreeRTOS V8.1.2) I wanted to use the latest FreeRTOS and wanted to learn how to develop the project from scratch. I believe following guidelines and steps would help anyone who would require to create a FreeRTOS project in Keil for the DISCOVERY board.st

Things you need to download. (Links are embedded and are working at the time of writing)

  1. FreeRTOS package.
  2. STM32F4 Standard Peripheral Driver Library
  3. DISCOVERY board GPIO library. (Used in the main.c)
  4. Keil uVision IDE ( I will soon post a GCC port as well )