Post Go back to editing

RE: AD5370 Compiled .so Linux Drivers

Hi,

I want to refloat this as I have not found anything in the forum. I want to use the AD5370 in Ubuntu (22.04) but I don't fully understand how to use the information provided in the link above. 

Namely, there is no "/sys/bus/iio" folder (I've read this is normal in Ubuntu) nor I have found examples on how to control the board.

Cheers

  • Hi  ,

    I haven't found any existing literatures for Linux drivers for AD5370. Let me try and look further and get back to you. However, you may try to get help on the driver's side through Linux Software Drivers forum.

    Best Regards,

    Den

  • Hi, 

    Still working on this. I have been able to compile the ad5360.c file but when I try to inserting using "insmod ad5360.ko" I get the following:

    insmod: ERROR: could not insert module ad5360.ko: Unknown symbol in module

    dmesg shows the following:

    [23743.574919] ad5360: Unknown symbol __iio_device_register (err -2)
    [23743.574953] ad5360: Unknown symbol devm_iio_device_alloc (err -2)
    [23743.574980] ad5360: Unknown symbol iio_device_unregister (err -2)

    To ensure my OS (Ubuntu 22.04) is not somehow interfering I am running everything on a virtual machine with Ubuntu 22.04 with a 6.2.0 kernel version.

    I am running the compilation at ".../iio/dac/" where I am downloading the ad5360.c file and using the following command:

    make -C /lib/modules/$(uname -r)/build M=$(pwd) modules

    I am running out of ideas...

  • Hi,

    These symbols are defined in the industrialio-core.c file. The kernel that you're using wasn't built with the CONFIG_IIO option. You can verify this by searching for "CONFIG_IIO" in the /lib/modules/$(uname -r)/build/.config file.

    You'll have to build and insert industrialio.ko in a similar way you did with your driver module before attempting to insert ad5360.ko.

    Thanks,

    Ciprian

  • Hi,

    Thanks for the quick reply. I have just built and install a kernel with CONFIG_IIO set to "yes" (checked it at the said file). This kernel is the 5.15.125 version. I am running on it atm. I'd expected a industrialio-core.ko file in the /drivers/iio folder but haven't found it. I do see a industrialio-core.o file. Am I doing something wrong?

    Best,

    Mariano

  • OK, thanks to your help I was able to load both drivers succesfully. Thanks. Now I am facing the problem the board (EVAL-AD5370EBZ) doesn't appear inside the folder /sys/bus/iio/devices. Is this expected?

  • You should find one iio device. It's a symlink to a directory named iio:device0, corresponding to your device (ad5360). Note that the index might be different if you have any other iio devices.

    The reason for which you can't find it is that your driver wasn't probed. There could be multiple reasons for that:

    - your device tree node for the device is wrong (different interface than what the hardware is connected to, different compatible string than what the driver is expected, etc)

    - your driver probe function gets called, but it fails before calling iio_device_register().

    - any hardware issues.

    This list is not complete and there could be other issues. You may check the dmesg log for any error messages corresponding to your device.

    Thanks,

    Ciprian

  • Hi Ciprian,

    Thanks for your reply.

    I did check into the dmesg log for any message. Nothing appeared in the log when inserting the modules (I don't know if this is expected) and the following when plugging the board (EVAL AD5370/2/3EBZ):

    [ 115.265439] usb 1-2: new high-speed USB device number 4 using xhci_hcd
    [ 115.415419] usb 1-2: New USB device found, idVendor=0456, idProduct=b20f, bcdDevice= 0.00
    [ 115.415432] usb 1-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0

    The /sys/bus/iio/devices folder is yet still empty.

    The devices appears under lsusb as:

    Bus 001 Device 007: ID 0456:b20f Analog Devices, Inc.

    But not under iio_info.

    I have tried this on two computers running Ubuntu already.

    Best,

    Mariano