Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

FreeRTOS+IO posix driver

Posted by andrewholt on September 12, 2016

I am using FreeRTOS V9.0.0, and I am investigating how to create a driver for (say) a uart or i2c that presents the posix/UNIX/Linux style API (I'm sure you know the one open,close, read,write, ioctl).

If somebody can direct me to a simple example I would be grateful.

Regards, Andrew


FreeRTOS+IO posix driver

Posted by rtel on September 12, 2016

You could look at http://www.freertos.org/io - but it has some issues - namely it is too complex to port as it supports multiple transaction modes. Sticking to a single transaction mode would have been better.


FreeRTOS+IO posix driver

Posted by richard_damon on September 12, 2016

For a UART, it should be THAT hard, as it is inherently a straming device, so a POSIX stream isn't that bad of a match. The challange with open, is that you aren't just writting an open for the serial port, but there is just a single open function that needs to handle EVERY device you want to connect to, and this goes and impacts the entire I/O file lib. You can look at an open source implementation like newlib for an example of how to do this. That implementation was designed to be somewhat extensible with hooks to let you add devices to the library.

I2C might be a bit tougher if you are actually expecting to use read/write to talk to the device, as I2C isn't a simple streaming protocal, but is block based with device specific headers for each block. On the Raspberry Pi, I2C is hooked in via ioctl for all transactions, but since all the calls are now very much device specific, since you don't have a 'big' OS getting in your way, it would be much better to just use a native I2C driver that you directly call, and not add a ioctl translation layer in the middle.


FreeRTOS+IO posix driver

Posted by andrewholt on September 12, 2016

Hi thanks for the link. That shows how an application would use the driver, what I am looking for is an example of a driver implementation.


FreeRTOS+IO posix driver

Posted by tlafleur on September 12, 2016

In my many years of doing embedded real-time software, I have found that adding layers like Posix just get in the way of efficient and clean drivers. Yes on the outside it looks to be a great academic exercise with a clean API, but in reality it just add to much overhead, and is NOT tailored to the often needed bit manipulation interface that we see in real world real-time driver.

my two bit worth...

On Mon, Sep 12, 2016 at 7:18 AM, Andrew Holt andrewholt@users.sf.net wrote:

Hi thanks for the link. That shows how an application would use the

driver, what I am looking for is an example of a driver implementation.

FreeRTOS+IO posix driver

Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/freertos/discussion/382005/

To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

~~ _/) ~~~~ _/) ~~~~ _/) ~~~~ _/) ~~

Tom Lafleur

Attachments

alternate (1940 bytes)


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists