Modifying libiio recipe

Hi , I have questions on how to effect some changes I want in libiio bbappend recipe in meta-adi zedboard.

I would like during petalinux-build for the build process to download a libiio of specific commit or to checkout that specific commit (can be through its SHA ID) then to build that and to include to the final Linux binaries. Another way can also be myself getting a local copy of libiio, checking out a specific commit of it, and specify the libiio bbappend recipe to use that local libiio during petalinux-build.  How to do that?

The context behind it is actually I was wondering why the libiio USB backend is not working in my recent 2 builds. Only iio_info -s command works in the host, and I haven't changed anything in the host side in terms of installed libiio in it. I pulled back some older petalinux images I have built around 3-4 weeks ago and they work in terms of USB backend. That 3-4 weeks ago are when I got the USB backend working c/o  but right now it won't.  The last builds that worked were during Sept 24 and Sept 30.  I'm thinking the recent libiio releases which are being downloaded by the meta-adi recipes might have some changes since then. As I've said, nothing changed in host side, my kernel has been localized since September (I don't know how it happened - maybe due to repeated builds - but it has the kernel source inside /components/yocto/workspace/sources/linux-xlnx and not inside build/ directory which I can modify and effect the changes without yocto patches) so I guess the only thing that could change is libiio. And so my goal for now is how to get libiio I'm using reverted to its earlier commits in the master, around September.



Inserted clarifications inside description.
[edited by: ubermensch at 3:05 AM (GMT -4) on 19 Oct 2021]

Top Replies

    •  Analog Employees 
    Oct 20, 2021 +1 verified
    I would like during petalinux-build for the build process to download a libiio of specific commit or to checkout that specific commit (can be through its SHA ID

    Hi,

    To checkout a specific…

  • 0
    •  Analog Employees 
    on Oct 19, 2021 9:31 AM

    Hi,

    The only changes to libiio since the 24th of september were related to the serial backend, IIOD, and scripts for our CI, so it does seem strange.

    Are you able to detect the USB context with "iio_info -S"? Is your problem similar to No IIO context found with iio_info and a Adalm-Pluto · Issue #752 · analogdevicesinc/libiio (github.com)?

    Cheers,

    -Paul

  • Hi ,

    So far, here are the responses I got:

    ~$ iio_info -a
    Library version: 0.23 (git tag: 92d6a35)
    Compiled with backends: local xml ip usb serial
    Using auto-detected IIO context at URI "usb:1.5.0"

    ~$ iio_info -u usb:1.5.0
    Library version: 0.23 (git tag: 92d6a35)
    Compiled with backends: local xml ip usb serial
    Unable to create IIO context usb:1.5.0: Invalid argument (22)

    ~$ iio_info -S
    Library version: 0.23 (git tag: 92d6a35)
    Compiled with backends: local xml ip usb serial
    Available contexts:
        0: 0456:b671 (Analog Devices Inc. Generic USB IIOD), serial=00000000 [usb:1.5.0]

    ~$ iio_info -u usb:1.5.0
    Library version: 0.23 (git tag: 92d6a35)
    Compiled with backends: local xml ip usb serial
    Unable to create IIO context usb:1.5.0: Invalid argument (22)

    ~$ iio_info -a
    Library version: 0.23 (git tag: 92d6a35)
    Compiled with backends: local xml ip usb serial
    Using auto-detected IIO context at URI "usb:1.5.0"

    ~$ iio_readdev -u usb:1.5.0 -b 16384 -s 16384 iio:device0 > samples.dat
    Unable to create IIO context usb:1.5.0: Invalid argument (22)

    iio_info -s/-S/-a still works, but once I use the usb URI that was given to me, then it fails to proceed, returning immediately with an "Invalid argument" error.  Same with iio_readdev command.  Previously during my September builds, these are all working.  I've also tried this on Windows and the same result happens.

    I haven't tested the ethernet network side since I don't have a network cable with me right now.

  • Update:

    It doesn't show up on Windows Device Manager either, despite the PlutoSDR-M2k-USB Win Driver and Windows libiio already installed.  Previously it appears as USB Device under Device Manager.

  • +1
    •  Analog Employees 
    on Oct 20, 2021 10:45 AM
    I would like during petalinux-build for the build process to download a libiio of specific commit or to checkout that specific commit (can be through its SHA ID

    Hi,

    To checkout a specific commit you need to change this line... You can just replace the whole line by  SRCREV = "your SHA ID". In this case, you don't really need to check if offline build is set or not because you'll never use AUTOREV which means it will automatically work also for offline builds. 

    - Nuno Sá

  • Thanks , it worked for me.  Haven't tested it for libiio but so far it seems my desired commit has been built.