LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-26-2020, 02:40 AM   #1
staticex
LQ Newbie
 
Registered: Apr 2020
Posts: 2

Rep: Reputation: Disabled
Learning drivers - ADXL34X as module


Hello, I am trying to learn driver development and am trying to load the adxl34x driver as a module to a beaglebone black. So far I have done the following:

1) been through the adxl34x driver code in the buildroot kernel directory to get some very small understanding of some of the things that are happening.

2) in buildroot, add the adxl34x & adxl34x-i2c components as modules, and deploy the new buildroot build to the beaglebone

3) connect adxl345 chip and confirm it is working by i2cdetect on i2c-2 (it is shown as address 0x53)

4) been through the https://wiki.analog.com/resources/to...t-misc/adxl345 page and tried to follow the instructions to load the module:
Code:
modprobe evdev
modprobe adxl34x
have also tried (which is not mentioned in the wiki):
Code:
echo adxl34x 0x53 > /sys/bus/i2c/devices/i2c-2/new_device
After trying all of this and playing around for a few days, there is nothing I can find to be able to read from the device:
Nothing in /sys/class/input/
Nothing in /sys/class/devices/platform/
Nothing in /dev/input/
After modprobe adxl34x, /sys/module/adxl34x is created however.
I have also done various 'find's on the entire system to look for clues...

5) the wiki mentions that a device tree entry is required for the adxl34x. I have converted the .dtb's in the buildroot /output/images/ directory back to .dts's to check, and they do not have entries for "adxl34x". If this is required, shouldn't buildroot be doing this automatically?

So... please can someone tell me what simple steps i am missing, what I am misunderstanding, or what manuals I need to read?
Do I need to edit the .dts to include an entry for adxl34x?

Any help will be very much appreciated!
Thanks
 
Old 04-26-2020, 07:25 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,296

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
One item I don't see there is some list of what the hardware capabilities are. As a hardware guy I know a bad driver can make a chip next to useless, a good driver can make the chip behave as if turbocharged.

Early CPUs had complete Assemblers with mnemonics and hex, referred to as the 'instruction set' Logic chips typically have a truth table. Ofte now, they say "we use "XXX" instruction set, and you may have mentioned it. I just didn't notice it.
 
Old 04-26-2020, 01:56 PM   #3
staticex
LQ Newbie
 
Registered: Apr 2020
Posts: 2

Original Poster
Rep: Reputation: Disabled
Apologies, I could have explained that a little clearer.

I am pretty sure the driver is good as it is part of the kernel, and has been written by analog devices for their chip. I have added it by using buildroot:
Code:
make linux-menuconfig
and set it to be a module.

According to the analog devices wiki once the module is loaded, an input device should appear in /dev/ which can be read, and there should be an entry in /sys/ which will allow calibration, etc, but this does not appear to be happening.

I have run out of ideas other than editing the device tree source file. However I am surprised that buildroot would not automatically reconfigure the device tree when adding a module through the menuconfigs?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: From e-learning to m-learning: Open education's next move LXer Syndicated Linux News 0 07-30-2019 05:13 PM
LXer: Machine Learning, Deep Learning 101 LXer Syndicated Linux News 0 07-20-2016 11:00 AM
Coding bootcamp learning platform and privacy issues with online learning. Need Advice ! slothbin Programming 2 04-01-2016 08:33 AM
[SOLVED] RHCSA learning... RHEL6 or CENT OS for learning shejin983 Linux - Server 4 10-27-2012 09:16 AM
E-learning learning, VLS want to help other learn? scheidel21 General 0 04-06-2010 11:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration