HAMNET-Access-Protocol/HNAP4PlutoSDR

Update Pluto-Firmware to v0.32

Closed this issue · 2 comments

Pluto base fw v0.32 was released today.
As it contains various fixes (e.g. targeting #8) , we should update, too.

https://github.com/analogdevicesinc/plutosdr-fw/releases/tag/v0.32

@lukasostendorf are there scripts and/or documentation available on how to create the custom Pluto sysroot used for building our firmware?

There is no existing documentation yet. I just downloaded the new sysroot and documented the process of customizing ist. The steps will follow, but I do not know where its best to put this explanation. I will also create script that automates everything.

Create a custom sysroot

We need to install the following libraries and their header files in order to successfully cross-compile: single precision fftw3 (required for liquid-dsp), libfec, liquid-dsp, libconfig

Download the current sysroot for the plutosdr-fw image from here. Unpack it and set the environment variable PLUTO_SYSROOT_DIR to the path of the sysroot folder.

For the following steps, you must have a cross-compiling toolchain installed. See the manual for how to get one.

Next, download and install libfftw3. We tell configure to build the single precision version (--enable-float) and to build a shared librariy (--enable-shared).

wget http://www.fftw.org/fftw-3.3.8.tar.gz
tar -xzf fftw-3.3.8.tar.gz

./fftw-3.3.8/configure arm --enable-float --enable-shared --host=arm-linux-gnueabihf --prefix="$PLUTO_SYSROOT_DIR/usr/" CC="arm-linux-gnueabihf-gcc --sysroot=$PLUTO_SYSROOT_DIR/"
make fftw-3.3.8/ install

Download and install libconfig

wget https://hyperrealm.github.io/libconfig/dist/libconfig-1.7.2.tar.gz
tar -xzf libconfig-1.7.2.tar.gz
./libconfig-1.7.2/configure --host=arm-linux-gnueabihf --prefix="$PLUTO_SYSROOT_DIR/usr/" CC="arm-linux-gnueabihf-gcc --sysroot=$PLUTO_SYSROOT_DIR/"
make libconfig-1.7.2/ install

Install libfec. It is part of this repository.

cd libfec
./libfec/configure arm --host=arm-linux-gnueabihf --prefix="$PLUTO_SYSROOT_DIR/usr/" CC="arm-linux-gnueabihf-gcc --sysroot=$PLUTO_SYSROOT_DIR/"
# Configure somehow does not correctly identify malloc and realloc
# and redefines them in the generated config.h script as rpl_malloc.
# This makes the code unusable, therefore we delete this:
sed -i '/rpl_realloc/d' config.h
sed -i '/rpl_malloc/d' config.h

make libfec/ install

Install liquid-dsp. This has to happen after you installed fftw3 and libfec, cause liquid-dsp links against those libs.

cd liquid-dsp
./bootstrap.sh
./configure arm --host=arm-linux-gnueabihf  --prefix="$PLUTO_SYSROOT_DIR/usr/" CC="arm-linux-gnueabihf-gcc --sysroot=$PLUTO_SYSROOT_DIR"
make install