Cross-compiled gr-limesdr

There are hundreds of ways to encode data for transmission. The LiquidSDR file “flexframesync_example.c” is an example of using an error correction method. It packs the data - which you grab and transmit. On the receiving end, you capture and pass the data thru the unpack routine to get the original data back.

Okay, I will investigate about this. That file from LiquidSDR needs the basicTX.cpp from the LimeSuite? Or is it another way to do the same thing?

Thanks again!

You would need to put the encode section from in flexframesync_example.c to some thing like basicTX.cpp and the decode section from flexframesync_example.c into something like basicRX.cpp. This method is simple, but likely to be slow. LiquidSDR has many other encoding methods you could use - once you get things going and what some speed. I use the soapySDR routines, because they work with many SDRs including the lime devices. Here is a C-example

of a receiver using soapy. The names are different, but it does the same thing as basicRX.cpp.

1 Like

Thank you so much! I will keep trying with GNU Radio because I am quite close from the objective. It seems I cannot install python3 on PetaLinux 2020.2, so because of that gr-limesdr is giving problems during the make process, and I am looking for the reason. Still, I will study this possibility as well and put them both to work, then I will have to decide which one is better for the project.

I assume that you have tried the obvious -

sudo apt-get install python3

What does it do ?

Hello, I need python3 on PetaLinux, not on Linux. So if I want to add python3 I do it with petalinux-config -c rootfs, then I add all the components from python3. The thing is that when I try to run python3, I get this:

It makes me think that it is installed, but I can’t execute any of those. I don’t know why.

That is really strange. If I were in your position, I would do -

sudo apt-get remove gnuradio
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install gnuradio

then reboot and see if gnuradio-companion works. That process often clears strange problems.

I think we are misunderstanding each other.

You talk about gnuradio on Linux, right? Because I don’t install gnuradio like that on PetaLinux, and I don’t even have the apt-get command.

The screenshoot is on PetaLinux. If I do python3 on Linux it works.

My problem is that GNU Radio 3.8 works with python3, which I have on Linux but doesn’t work on my PetaLinux 2020.2. I have already managed to install GNU Radio 3.8, LimeSuite and gr-limesdr on my Linux machine. I have installed gnuradio 3.8 and LimeSuite on PetaLinux 2020.2, but I get an error cross-compiling gr-limesdr for the gr-3.8 branch.

In fact it was you who answered me with this:
“I says that you do not have “python3” installed at /opt/pkg/test/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/gnuradio/3.8.2.0-r0/recipe-sysroot-native/usr/bin/python3-native/python3 which is a strange place to look for it - unless you are using a virtualenv - perhaps you build a virtualenv using python2 not python3 and it needs python3.”

So I tried adding python3 but I can’t get it to work.

I hope I have explained myself better.

You system cannot correctly do something simple - it is time to refresh the system. I gave the instructions for how to do that on a “apt-get” based system - I did not know PetaLinux was using something different.

I get your point, but with PetaLinux there is no apt-get, and I haven’t found anything similar.
Anyways, I don’t know if it is a problem of the system, or just that I have not included the required packages, which I doubt.
I asked about this on the Xilinx forum, but I haven’t received a helpful answer.

I am studying the possibility of using liquid-dsp.
Do I have to cross-compile it for ARM or I just need to cross-compile the .c that I create?
I think it must be the first option, because if not the .h will not be found.
I cross-compiled LimeSuite to work with BasicTX.cpp so I think it is the same, but as it is not a cmake project, I don’t know where to add the cross-compiler.

If you are installing Liquid from scratch - here is the normal process -

if you system does not already have autoconf and automake installed - install them. You should be able to check with a “which autoconf” and “which automake” to see if you have them.

1). install autoconf-2.69 -

cd autoconf-2.69
configure --prefix=/usr/local
make
sudo make install

2). install automake-1.15

cd automake-1.15
configure --prefix=/usr/local
make
sudo make install

Once you have autoconf and automake installed -

  1. install liquid sdr -

cd liquid-dsp-1.3.0
./bootstrap.sh
configure --prefix=/usr/local
make -j 8
sudo make install

By the way - I have tried to install gnuradio from scratch 5 or 6 times and I have only got it to work once - something always gets in the way. What does a “which python3” give you ?

Hello

I have installed Liquid on my computer first. Right now I’m just studying how to work with it, and understanding the examples, which I have never worked with.

Thanks for the install instructions, I will use them as well.

About “which python3”, I get:
/usr/bin/python3

Hello, has gr-limesdr gr-3.8 changed?
I checked the github and it is still the same, but I get an error during cmake:

– Checking for module SWIG
– Disabling SWIG because version check failed.

But I am using PetaLinux SDK 2020.2 and if I do:

rodrirq@rodrirq-ubuntu:/opt/pkg/zynq-7010$ grep swig images/linux/rootfs.manifest
swig cortexa9t2hf_neon 3.0.12
swig-dev cortexa9t2hf_neon 3.0.12
swig-lic cortexa9t2hf_neon 3.0.12

So I don’t know if the version has changed or what.
Hope someone knows.

swig is required for all gr- programs. What does a "find / -name “*swig*” find - it is usually “/usr/bin/swig”

Hello, the thing is that I am cross-compiling, but within the PetaLinux SDK I have nativesdk-swig 3.0.12 or something like this, I don’t remember. But it is the same swig I was using, so I am quite confused about why it doesn’t get detected.

I managed to add swig, I added nativesdk-swig to /project-spec/meta-user/recipes-core/images/petalinux-image-minimal.bbappend. File which I had to create. The problem I had was that I used the wrong name.

The thing is that after adding swig, I get the error that I got weeks ago.
This is the output from cmake:

– Toolchain file defaulted to ‘/opt/pkg/sdk/sysroots/x86_64-petalinux-linux/usr/share/cmake/OEToolchainConfig.cmake’
– The CXX compiler identification is GNU 9.2.0
– The C compiler identification is GNU 9.2.0
– Check for working CXX compiler: /opt/pkg/sdk/sysroots/x86_64-petalinux-linux/usr/bin/arm-xilinx-linux-gnueabi/arm-xilinx-linux-gnueabi-g++
– Check for working CXX compiler: /opt/pkg/sdk/sysroots/x86_64-petalinux-linux/usr/bin/arm-xilinx-linux-gnueabi/arm-xilinx-linux-gnueabi-g++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– Check for working C compiler: /opt/pkg/sdk/sysroots/x86_64-petalinux-linux/usr/bin/arm-xilinx-linux-gnueabi/arm-xilinx-linux-gnueabi-gcc
– Check for working C compiler: /opt/pkg/sdk/sysroots/x86_64-petalinux-linux/usr/bin/arm-xilinx-linux-gnueabi/arm-xilinx-linux-gnueabi-gcc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Build type not specified: defaulting to release.
– Found LOG4CPP: /opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/liblog4cpp.so
– Found PkgConfig: /opt/pkg/sdk/sysroots/x86_64-petalinux-linux/usr/bin/pkg-config (found version “0.29.2”)
– Checking for module ‘gmp’
– No package ‘gmp’ found
– Found GMP: /opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/libgmpxx.so
– Checking for module ‘mpir >= 3.0’
– No package ‘mpir’ found
– Could NOT find MPIR (missing: MPIRXX_LIBRARY MPIR_LIBRARY MPIR_INCLUDE_DIR)
– Found MPLIB: /opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/libgmpxx.so
– Found Boost: /opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/cmake/Boost-1.71.0/BoostConfig.cmake (found suitable version “1.71.0”, minimum required is “1.71.0”) found components: date_time program_options filesystem system regex thread
– Found VOLK: Volk::volk
– User set python executable /opt/pkg/zynq-7010/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/gnuradio/3.8.2.0-r0/recipe-sysroot-native/usr/bin/python3-native/python3
– Found PythonInterp: /opt/pkg/zynq-7010/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/gnuradio/3.8.2.0-r0/recipe-sysroot-native/usr/bin/python3-native/python3
– Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is exact version “.”)
– Found Git: /usr/bin/git
– Extracting version information from git describe…
– LimeSuite version 20.10.0-g1480bfea found.
– Found Doxygen: /usr/bin/doxygen (found version “1.8.13”) found components: doxygen missing components: dot
– Using install prefix: /usr/local
– Building for version: 3.1.5.0 / 3.1.5
– No C++ unit tests… skipping

– Checking for module SWIG
– Found SWIG version 3.0.12.
– Found SWIG: /usr/bin/swig3.0
– Found PythonLibs: /opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/libpython3.7m.so (found version “3.7.6”)
– Configuring done
– Generating done
– Build files have been written to: /home/rodrirq/gr-limesdr/build

And this is the error:

/bin/sh: /opt/pkg/zynq-7010/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/gnuradio/3.8.2.0-r0/recipe-sysroot-native/usr/bin/python3-native/python3: No such file or directory
swig/CMakeFiles/limesdr_swig_swig_doc.dir/build.make:60: recipe for target ‘swig/limesdr_swig_doc.i’ failed
make[2]: *** [swig/limesdr_swig_doc.i] Error 127
CMakeFiles/Makefile2:287: recipe for target ‘swig/CMakeFiles/limesdr_swig_swig_doc.dir/all’ failed
make[1]: *** [swig/CMakeFiles/limesdr_swig_swig_doc.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…

I have python3 correctly installed on PetaLinux. I don’t know why swig gives that error.

python is a real mess - I have 8 versions on my machine in 4 different locations. You apparently have at least two version “/usr/bin/python3” and “/opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/python3” and it wants a third version in “/opt/pkg/zynq-7010/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/gnuradio/3.8.2.0-r0/recipe-sysroot-native/usr/bin/python3-native/”.

If you install python3 there you will get by this error, but it may be just a step to the next error.

You have multiple copies of the same programs and libraries in several locations -

/usr/

/opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/

/opt/pkg/zynq-7010/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/gnuradio/3.8.2.0-r0/recipe-sysroot-native/usr/

and cmake is picking those to use from all three location and some mixtures will not work.

If you are interested in using gnuradio-companion, try to install everything in its tree and make sure that your “PATH” is set correctly.

If gnuradio-companion is at “/opt/pkg/zynq-7010/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/gnuradio/3.8.2.0-r0/recipe-sysroot-native/usr/bin/gnuradio-companion” your cmake command for gr-limesdr should be

cmake -DCMAKE_INSTALL_PREFIX=/opt/pkg/zynq-7010/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/gnuradio/3.8.2.0-r0/recipe-sysroot-native/usr …/

along with what ever other options are used.

Okay, I get what you are saying.
I installed python3 for ubuntu on /usr/bin/python3.
Then, I installed gnuradio via meta-sdr, which includes python3 too.
And last, I installed python3 via petalinux-config -c rootfs.
About what you say of installing gr-limesdr where gnuradio-companion is… I have/opt/pkg/zynq-7010/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/gnuradio/3.8.2.0-r0/, but the folder recipes-sysroot-native does not exist. I have deploy-rpms, sstate-install-package_write_rpm and temp.
I have used whereis gnuradio-companion, but I only get the one I installed for Ubuntu, not the one from PetaLinux. Still when I boot PetaLinux it appears, so I don’t know where it is located.

If -

sudo find / -name gnuradio-companion

does not find it - you do not have a second copy.

Try it before and after you boot PetaLinux.

Please list the output that you get.