FreeRTOS and POSIX

The Portable Operating System Interface (POSIX) was developed to provide a unified interface for interacting with operating systems, making code more portable between systems.

At the time of writing, FreeRTOS has a beta implementation for a subset of the POSIX API. The POSIX headers that have been (partly) ported are listed here:

  • errno.h
  • fcntl.h
  • mqueue.h
  • mqueue.h
  • sched.h
  • semaphore.h
  • signal.h
  • sys/types.h
  • time.h
  • unistd.h

Generally speaking, threading, queues, mutexes, semaphores, timers, sleep, and some clock functions are implemented by the port. This feature set sometimes covers enough of a real-world use case to enable porting applications that have been written to be POSIX-compliant to an MCU supporting FreeRTOS. Keep in mind that FreeRTOS does not supply a filesystem on its own without additional middleware, so any application requiring filesystem access will need some additional components before it will be functional.

Let's take a look at what a minimal application using the POSIX API looks like.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.117.109