0

I have a task that consists in implementing a driver for an RF module.

The RF module communicate with the blackFin609 microcontroller using UART.

In a first step i created a uClinux image and download it in the BlackFin609 using uBoot and now i have to add the driver module to the kernel.

This is my first experience with embedded linux so i have no idea on how to add a driver module to linux.

Could you please point me to an easy tutorial, i find a lot of long tuto but i don't know from where to start, thanks in advance

fedi
  • 368
  • 3
  • 7
  • 18
  • In Linux, UART drivers are typically under the **tty** subsystem (i.e. **drivers/tty/serial/**). Interfacing to a UART in Linux is best done through the userspace APIs, rather than trying to access the UART in kernelspace using a kernel module. Otherwise you're pretty much on your own developing a new UART driver dedicated to interfacing with this RF module (e.g. it would not be a portable driver). – sawdust Jun 15 '16 at 20:09
  • @sawdust, thank you for your answer, Ok, so you mean i have to implement a layer upper tty subsystem, could you please suggest me a nice step by step tutorial, i really get lost – fedi Jun 15 '16 at 22:48
  • I didn't write anything about *"a layer upper tty subsystem"*. The first task is define the userspace API for this device. What functionality/services do you expect from the device/kernel?. Next you define what I/O you need to perform with this RF module through the UART. Only then do you write code. – sawdust Jun 15 '16 at 23:54
  • I have to implement functions as configure, send_stream, receive_stream – fedi Jun 16 '16 at 06:00
  • @sawdust, A user space API is it equivalent to package ? – fedi Jun 16 '16 at 09:16
  • No, a package is merely a collection of (related) files made available by a distribution. An API is a programming interface, e.g. procedures/functions available for a specific application. The tty API uses standard open, read and write syscalls with the [termios](http://man7.org/linux/man-pages/man3/termios.3.html) routines. A userspace API for the RF module would define a new layer of routines that use the tty API on its back-end, and define/expose a new set of functions as required by the application. This collection of routines could be incorporated into its own library – sawdust Jun 16 '16 at 19:56

0 Answers0