Driver templates, minimal kernel allocation, driver community, microcontroller driver?

I'm new to Embedded Linux driver development, developed Character, UART and simple USB drivers, and worked with SBC (Raspberry Pi 2). My main learning resources are: Essential Linux device drivers, Linux embedded design and development, YouTube and LDD3 tutorials. Due to my lack of real life experience, I have some questions that I would like to share:

  • Templates: are there any driver templates to speed up the coding process, eg. have regularly used structures and functions for modification and customization for specific drivers.

  • What is a suitable minimum distribution: What I am doing now is either create a kernel image using Buildroot and then insert the built-in USB driver into it, or insert the developed USB driver into Ubuntu. And for proper testing, I have to unload the default USB driver (usb_storage); otherwise I cannot check my module. So my question is about real development and getting a minimal kernel that has no drivers, and how do I include my module in it (to be part of it) when building with Buildroot?

  • What is the Embedded Linux driver developer community do you suggest for a detailed Q&A? those. in the future, if I want to ask about low level details like what this structure x is, or I get this error when using this y function ... is there a dedicated community? because everything I've found is for Linux in general, for kernel hacking or no experience.

  • What's the missing link in the chain? Application development for microcontrollers depends on Datasheet, User Guide, Registers, C, etc. Driver development for embedded Linux depends on C, Linux APIs, subsystems, etc. In most learning resources, I have never found a relationship between them. So, are they really separate? OR there is a missing link between them.

eg. for this I2C sensor http://www.robot-electronics.co.uk/htm/srf10tech.htm we have to manipulate it (send hexa and get values ​​from their registers). If we assume that we want to develop an I2C driver for it, then most likely we will need to do the same from the driver, which is explained in Essential Linux Device Drivers (page # 278). The main thing is that the I2C core hides many complexes and simplifies the driver development process.

However, I expect the real-life case to be not for a sensor, but rather a microcontroller or a complex device. So how are we going to manipulate the registers and peripherals of this microcontroller? Also, I haven't found a tutorial for such a case!

+3


source to share





All Articles