Add Kernel Module - ads1015 TorizonCore

I want to add ADC ads1015 Kernel Module , to my kernel.
I’m using 5.6-Tezzi-TorizonCore.
How Can I Do this?

Hi @joe.hiko ,

You can use TorizonCore Builder to create a custom image with the module, as detailed in TorizonCore Builder Tool - Customizing TorizonCore Images | Toradex Developer Center.

In your specific case the ADS1015 driver already seems to be enabled as a module in TorizonCore 5.6.0:

$ zcat /proc/config.gz | grep -i ads1015

So you shouldn’t need to change anything related to the driver.

Let me know if this helps you.

Best regards,
Lucas Akira

1 Like

Thank you for your response
I Have Added The ADS1015 Driver as external Kernel module as described in The guide you have mentioned . but no directory has been created in /sys/bus/iio/devices for the ADS1015 outputs.
beside That I have Checked The

zcat /proc/config.gz | grep -i ads1015

command and the output was : CONFIG_TI_ADS1015 is not set
by the way i am using : TorizonCore Upstream 5.6.0+build.13
could you please help with this .
Best Regards.

I see, you’re using TorizonCore Upstream, which doesn’t have CONFIG_TI_ADS1015 enabled. In my previous response I checked with the Downstream Kernel. Sorry for the confusion.

In this case I can ask the team here to include this driver in our future nightly TorizonCore builds. Just confirm the exact configurations to add like CONFIG_TI_ADS1015 and any other options if applicable.

Check with lsmod | grep ads1015 to see if the ADS1015 module is loaded. If it isn’t you won’t see any output.

If it is loaded but not working as expected then you probably also need to setup the device tree to enable your ADC. You can see this example on how to do it: ti,ads1015.yaml « adc « iio « bindings « devicetree « Documentation - kernel/git/torvalds/linux.git - Linux kernel source tree. Then you can use TorizonCore Builder to apply a Device Tree Overlay or an entire custom Device Tree to your image, as explained here: Device Tree Overlays on Torizon | Toradex Developer Center.

Hope that made things clearer for you.

Best regards,
Lucas Akira

1 Like

Thanks For your response.
Your guidance helped me a lot.
If I want to use torizon5.7 with downstream kernel, how can I Find and install that??
Best Regards.

Currently our TorizonCore releases for iMX6 and iMX7 modules use the Upstream Kernel, while the iMX8 modules use the Downstream Kernel from NXP. In my previous answer I did my check on a Colibri iMX8X.

If you want to use TorizonCore with the downstream Kernel on your Colibri iMX7, you would have to build it using Yocto Project/OpenEmbedded using the torizon distro, as detailed in this article: Build TorizonCore from Source With Yocto Project/OpenEmbedded | Toradex Developer Center.

However, given that you only need to add a Kernel module I wouldn’t recommend doing this, as building TorizonCore can take a lot of time and can get complex if things don’t work out-of-the-box.

I would instead suggest asking for it to be included in our nightly builds (just confirm to me the exact configs to add if doing so) or include it in an image using TorizonCore Builder.

Keep in mind that even if the ADS1015 driver is loaded your ADC won’t work if the Device Tree isn’t configured properly. If you need any assistance regarding this, please don’t hesitate to ask.

Best regards,
Lucas Akira

1 Like