Jump to content

Looking for Help with the Development of Custom Kernel Modules for Armbian


Recommended Posts

Posted

Hello Everyone 🤗,

 

I'm not too familiar with Armbian or ARM-based platforms in general. I'm working on an endeavour that calls for creating a unique kernel module, thus any advice or materials you could offer would be really helpful.

This is a quick synopsis of the assignment and the difficulties I'm having:

Project Synopsis:


I'm using Armbian Buster on an Orange Pi 4. My objective is to create a unique kernel module that communicates with a particular piece of hardware—a temperature sensor attached to the I2C bus. The module's job is to read sensor data and provide user-space applications with access to it.

Actions To Date:
 

  • Kernel Source and Toolchain: On my development computer running Ubuntu 20.04, I had no trouble downloading the Armbian kernel source and installed the cross-compilation toolchain.
  • Skeleton of a Basic Module: I've created a simple "Hello, World" kernel modules and installed it into the Orange Pi with success.
  • I2C Bus Communication: I've worked with communication over the I2C bus in user-space before using programs like i2c-tools, but it's been difficult to translate this to a kernel module.

 

Obstacles:

 

  1. Using the I2C Bus to Communicate: I'm having trouble figuring out how to use my kernel module to access and interact with the I2C bus. The majority of the materials I've come across are either out-of-date or hardware-specific.
  2. Correct Module Integration: Making sure that my module can be loaded and unloaded securely and without causing instability in the system, as well as that it is correctly linked with the kernel.
  3. Handling Errors and Troubleshooting: Methods that work well for debugging kernels modules, particularly for hardware communication problems.

 

Queries:

 

  • Could you please direct me to any tutorials or recommended resources that are particular to Armbian and kernels module development?🤔
  • What are the most effective ways to communicate with an Armbian kernel module over the I2C bus? 🤔
  • Existing modules or sample projects in the Armbian the environment that I could look at to gain more insight into this sap sac process? 🤔

 

I am eager to know your insights. Thank you 🙏 in advance.

Posted
28.07.2024 в 11:20, James60 сказал:

Project Synopsis:


I'm using Armbian Buster on an Orange Pi 4. My objective is to create a unique kernel module that communicates with a particular piece of hardware—a temperature sensor attached to the I2C bus. The module's job is to read sensor data and provide user-space applications with access to it.

Orange Pi 4 -> SOC rk3399 -> The driver for the bus on this SOC drivers/i2c/busses/i2c-rk3x.c

Documentation/i2c

Check the status of this driver in the kernel on a running OS:

grep -n I2C_RK3X /boot/config*

 

There are nine i2c controllers on this SOC and they are described in this file.

As far as I can tell from the rk3399-orangepi.dts file, the first five controllers (i2c0-i2c4) are already occupied (in use).

 

Is your temperature sensor unique?

Why do you want to write a unique driver for it?

 

In any case, you must enable (activate) a free bus controller, for example i2c7 or i2c8 in the dts file for the temperature sensor driver used.

In the Armbian OS, you can do this using an overlay.

examples for allwinner SOC.

overlay for rockchip64

 

With respect

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines