How can I build FreeRTOS on Linux?

I’m very new to FreeRTOS. I would like to build a simple test example but the tutorial use Atmel Studio to build the project. Unfortunately AS is not supported on Linux so I’m a little bit stuck. I assume it uses arm gcc or something similar under the hood in order to build projects.

How can I build a simple example without Atmel Studio? I have no experience with manual building so detailed descriptions (or links) would be appreciated.

Thank you in advance :slight_smile:

Hello @Belushi,

We already have a demo which runs on a Linux machine. Do note that this is a simulator demo which means it doesn’t run on actual hardware. You can find that here: FreeRTOS_Plus_TCP_Echo_Posix.
You can clone the repository INCLUDING submodules by running this git command:

git clone --recurse-submodules https://github.com/FreeRTOS/FreeRTOS ./FreeRTOS

And once you go into that directory, just execute make command and it should build an executable for you.

I think it’s safe to say, things are better to be done with official tools. Ah, I love Linux, but sadly many tools are Windows only. If you insist on Linux, the best option would be Wine, which runs Windows app directly on Linux.

Building involes this configuration and that setting etc. It’s some complexity here.

Kind Regards,

Hi, in the next repo you’ll find the FreeeRTOS Linux port and nothing else so you can try and test the OS right away without any hardware nor fancy things. Bulding instructions are found in the README.txt file.

https://bitbucket.org/fjrg76/freertosv202107.00_linux_port_only/src/master/

It includes a very simple demo so you don’t get lost into the details:

// FreeRTOS/Demo/my_demo/main_blinky.c

#include <stdio.h>
#include <pthread.h>
#include <stdbool.h>

#include "FreeRTOS.h"
#include "task.h"

#include "console.h"

void ledTask( void* pvParameters )
{
   TickType_t lastWakeUp = xTaskGetTickCount();
   bool ledState = false;

   while( 1 )
   {
      console_print( (ledState = !ledState ) ? "Led ON\n" : "Led OFF\n" );
      vTaskDelayUntil( &lastWakeUp, pdMS_TO_TICKS( 1000 ) );
   }
}

void MainApp( void )
{
   xTaskCreate(
         ledTask,
         "LED",
         configMINIMAL_STACK_SIZE,
         NULL,
         tskIDLE_PRIORITY,
         NULL );

   vTaskStartScheduler();

   for( ; ; )
   {
   }
}

Greetings!

We build our project using Eclipse IDE with GCC as the compiler. Some of us build the project under Windows, others build it under Linux.

Atmel Studio was superseded by Microchip Studio, but Microchip told me last month that they no longer support either.