[Buildroot] am335x_boneblack dts/b does not support adc

Peter Scheie pscheie at gmail.com
Mon Jun 27 21:20:44 UTC 2022


Hi,
I'm using BR to create an image for the Beaglebone Black and use libiio's
python binding to talk to the BBB's analog pins.  This does not work out of
the box for two reasons.

The first problem is that the default device tree file generated during
build, am335x-boneblack.dtb, doesn't seem to have support for the BBB's
ADC.  Not sure why.  To fix it, I built a custom dts that just #includes
am335x-boneblack.dts and then adds the ADC code the Beagle Board project
uses for their Debian distro (where the ADC does work), and then placed
that dts into BR2_LINUX_KERNEL_CUSTOM_DTS_PATH.

The second problem is that the iio source from Analog Devices has a bug in
that it uses ctypes' find_library('iio') inside a cdll() call in iio.py to
get the full name of the iio SO library (libiio.so.0).  This fails, with
find_library() returning None.  Folks on #beagle suggested find_library()
should not be used this way and instead 'libiio.so.0' should just be passed
directly to cdll(). I've made a patch that fixes this.

So, I've got a working BR image with ADC, but I'm wondering what the
procedure is for getting my fixes incorporated into BR so that the next
person who wants to use the ADC on the BBB doesn't have to go through the
same hassle.  The libiio problem ultimately should be fixed by the folks at
Analog Devices obviously, and I'll send them a message, but until that
happens having a patch already in BR would save some people a few
difficulties.  I don't know what the ultimate fix is for the device tree
problem.

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildroot.org/pipermail/buildroot/attachments/20220627/263acbb7/attachment.html>


More information about the buildroot mailing list