FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [September 2016 Threads] FreeRTOS+IO posix driverPosted 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 driverPosted 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 driverPosted 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 driverPosted 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 driverPosted 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
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|