How tor create a Makefile for linux port

Hi all,
I’m new to freertos forum and learning rtos. Long story somewhat shortened: I tried poking around on the TI website using TI-RTOS. But their document isn’t exactly for the newbie. But then I stumbled upon freertos and it’s opened up a whole new world! I’m really enjoying Richard Barry’s Tutorial Guide. It’s very informative, interesting, and easy to follow. I’ve been able to run a demo on my TI arm-based board (MSP432P4).

I would also like to run the Windows port, but my eyes glazed over at “download Visual Studio”. But hope sprung anew when I saw the MinGW port. Alas, again dashed, to a lesser extent - when I realized it’s really just another Windows port wrapped inside Eclipse. So I tried in vain running Eclpise to trying to create a Makefile from an existing project. Not much luck.

What I’d really like is a plain old Makefile so I can just run ‘make’ on the command line…either in UNIX (GNU-Linux) or cygwin…but, importantly, without any Windows dependencies like a cmd window widget thing.

So, to my questions: given my aversion to Windows, what do you think is the quickest path to running a linux-y purely command line port? Perhaps to modify a GCC make file from another port? Maybe export a makefile from Eclipse?

Thanks for the help…and for the great software,
Scott

LOL I think I just found my answer.
https://www.freertos.org/FreeRTOS-simulator-for-Linux.html.
I’m getting some compiler errors but maybe that’s another post:
PosixMessageQueueIPC.c:(.text+0x38): undefined reference to `mq_open’

-Scott

Hi Scott,

Thank you for your interest in FreeRTOS, i am sure you will enjoy it!

we actually do have a new linux port with networking supported, unfortunately the documentation is not quite there, it is on the way though.

you will need scons to build it, and a proper makefile is on the way as well

you can find the kernel port here: https://github.com/FreeRTOS/FreeRTOS-Kernel/tree/master/portable/ThirdParty/GCC/Posix

And the Demo here:

Hope this helps!

Alfred

The Networking port here:

Thanks for your help. I downloaded the posix port but having some compile issues:
#include <pcap/bpf.h>
^~~~~~~~~~~~

I tried adding a couple paths to src/SConscript but no luck, for example:
“FreeRTOS/Demo/Common/ethernet/lwip-1.4.0/ports/win32/WinPCap/pcap/”,
“FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Minimal_Windows_Simulator/WinPCap/pcap/”,

I think I probably have to understand the code and dir structure better.

Otherwise I did get William Davy’s Posix port to work. I ran into the classic “gcc options ordering issue” where you have to put the -l library option after other options so it can correctly compile-and-link:

gcc -lrt [options] //error!
gcc [options] -lrt //OK

If you have any suggestions on getting the posix kernal going let me know.
thanks!
Scott

At the risk of making you regret giving me your latest code, can you help me debug this: I was getting a linker error because I was unable to link pcap library. So I installed the pcap library (sudo apt install libpcap-dev).

So then I was able to compile, but I’m now getting a application error:

The following network interfaces are available:

Interface 1 - enp3s0
              (No description)

Interface 2 - wlp2s0
              (No description)

Interface 3 - any
              (Pseudo-device that captures on all interfaces)

etc,

The interface that will be opened is set by 
"configNETWORK_INTERFACE_TO_USE", which
should be defined in FreeRTOSConfig.h
Attempting to open interface number 1.
opening interface enp3s0
setting device modes of operation...
pcap activate error socket: Operation not permitted
Failed to open interface number 1.
application iddle hook network down

Maybe I have the wrong pcap library? Anyway, why do I need a network connection since I’m running it locally?

thank you,
Scott