Sunday 29 October 2017

Building the PlutoSDR Firmware Image

Building the PlutoSDR Firmware Image

This is done on a Ubuntu 17.10

Attention: At the moment the build fails under Ubuntu 17.10, because of the flex package.

>>> host-flex 2.6.4 Building
PATH="/home/dimce/src/plutosdr-bsp/buildroot/output/host/bin:/home/dimce/src/plutosdr-bsp/buildroot/output/host/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/Xilinx/SDK/2017.2/gnu/arm/lin/bin" PKG_CONFIG="/home/dimce/src/plutosdr-bsp/buildroot/output/host/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_LIBDIR="/home/dimce/src/plutosdr-bsp/buildroot/output/host/lib/pkgconfig:/home/dimce/src/plutosdr-bsp/buildroot/output/host/share/pkgconfig"  /usr/bin/make -j9  -C /home/dimce/src/plutosdr-bsp/buildroot/output/build/host-flex-2.6.4/
make[2]: Entering directory '/home/dimce/src/plutosdr-bsp/buildroot/output/build/host-flex-2.6.4'
Making all in src
make[3]: Entering directory '/home/dimce/src/plutosdr-bsp/buildroot/output/build/host-flex-2.6.4/src'
/usr/bin/make  all-am
make[4]: Entering directory '/home/dimce/src/plutosdr-bsp/buildroot/output/build/host-flex-2.6.4/src'
./stage1flex   -o stage1scan.c ./scan.l
Makefile:1688: recipe for target 'stage1scan.c' failed
make[4]: *** [stage1scan.c] Segmentation fault (core dumped)
make[4]: Leaving directory '/home/dimce/src/plutosdr-bsp/buildroot/output/build/host-flex-2.6.4/src'
Makefile:538: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '/home/dimce/src/plutosdr-bsp/buildroot/output/build/host-flex-2.6.4/src'
Makefile:526: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/dimce/src/plutosdr-bsp/buildroot/output/build/host-flex-2.6.4'
package/pkg-generic.mk:227: recipe for target '/home/dimce/src/plutosdr-bsp/buildroot/output/build/host-flex-2.6.4/.stamp_built' failed
make[1]: *** [/home/dimce/src/plutosdr-bsp/buildroot/output/build/host-flex-2.6.4/.stamp_built] Error 2
make[1]: Leaving directory '/home/dimce/src/plutosdr-bsp/buildroot'
Makefile:36: recipe for target 'buildroot/output/images/rootfs.cpio.gz' failed
make: *** [buildroot/output/images/rootfs.cpio.gz] Error 2

Xilinx Toolchain

Download the latest version (2017.2 at the moment!) of Vivado which will be used for writing/editing/modelising/whatever all the files. You need to download a Full Installer, whenever it's a Web installer or not (depends of the amount of free space you have). You can download it there.


Download a WebPack License on the Licensing Site (From "node-locked" part).


Installing Vivado

Prepare the install directory

$ sudo mkdir /opt/Xilinx
$ sudo chown <user-name> /opt/Xilinx
$ chmod u+rwX /opt/Xilinx

Go to the folder where you downloaded the installer

$ chmod +x ./Xilinx_Vivado_SDK_2017.2_0616_1_Lin64.bin
$ ./Xilinx_Vivado_SDK_2017.2_0616_1_Lin64.bin


Follow the installation wizard and don’t forget to select “Software Development Kit” on the installation customization page. (Vivado System Edition + SDK)




If you have to choose which boards you want to install, you can choose to install everything, it's the best way for not forgetting anything... Or choose to install all the tools and only the Zynq 7 board.
If not, it's just perfect isn't it?

Import your license

Launching Vivado

Source the architecture shell file:

$ source /opt/Xilinx/Vivado/2017.2/settings64.sh

Then launch it:

$ ./bin/vivado

Linux development host


Prepare the host

$ sudo apt-get install git make u-boot-tools build-essential fakeroot libncurses5-dev libssl-dev ccache dfu-util mtools util-linux

Genimage tool


Get and install from here.

Install additional package:

$ sudo apt-get install libconfuse-common libconfuse-dev libconfuse1
1. Download
2. Extract

$ ./configure
$ make
$ sudo make install

Build Instructions

cd src
git clone https://github.com/PlutoSDR/plutosdr-bsp.git
cd plutosdr-bsp
export CROSS_COMPILE=arm-xilinx-linux-gnueabi-
export PATH=$PATH:/opt/Xilinx/SDK/2017.2/gnu/arm/lin/bin
make git-update-all
make update
make


Updating your local repository

make git-pull

Updating buildroot config (zynq_pluto_defconfig file)

make update-buildroot-config

Updating buildroot third-party packages (packages directory)

make update-buildroot-packages





PlutoSDR Notes

PlutoSDR Notes

Serial Port to PlutoSDR

$ screen /dev/ttyUSB0 96000
User name is: root
Password is: analog

Enable dual-core on plutosdr

Commands to perform on PlutoSDR:

# cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 0 (v7l)
BogoMIPS : 666.66
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc09
CPU revision : 0

Hardware : Xilinx Zynq Platform
Revision : 0003
Serial : 0000000000000000
does show a single core CPU

# fw_setenv maxcpus
# pluto_reboot reset

# cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 0 (v7l)
BogoMIPS : 666.66
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc09
CPU revision : 0

processor : 1
model name : ARMv7 Processor rev 0 (v7l)
BogoMIPS : 666.66
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc09
CPU revision : 0

Hardware : Xilinx Zynq Platform
Revision : 0003
Serial : 0000000000000000

Enable dual-core on plutosdr

Hack RX range from 300 MHz - 3.8 GHz to reach 70 MHz to 6 GHz

Commands to perform on PlutoSDR:

# fw_setenv attr_name compatible
# fw_setenv attr_val ad9364
# pluto_reboot reset

GQRX on Ubuntu 17.10

This is done from a fresh install of Ubuntu that is updated with sudo apt-get update and sudo apt-get upgrade. First lets do a little preparatory work from the terminal.

sudo apt-get install git cmake rtl-sdr librtlsdr0 librtlsdr-dev miri-sdr libmirisdr0 libmirisdr-dev

Now for GQRX
sudo add-apt-repository -y ppa:bladerf/bladerf
sudo add-apt-repository -y ppa:ettusresearch/uhd
sudo add-apt-repository -y ppa:myriadrf/drivers
sudo add-apt-repository -y ppa:myriadrf/gnuradio
sudo add-apt-repository -y ppa:gqrx/gqrx-sdr
sudo apt-get update
sudo apt-get install gqrx-sdr gr-iio

Now that is done. Lets install the upstream driver for gr-osmosdr which has PlutoSDR included.

mkdir src
sd src
git clone https://github.com/csete/gr-osmosdr-gqrx
cd gr-osmosdr-gqrx/
git checkout plutosdr
mkdir build
cd build/
cmake ../
make
sudo make install
sudo ldconfig
Now when you open GQRX and have your PlutoSDR plugged in it should show up. You Done Did It. 

Wednesday 7 December 2016

Chinese Power Meter

Chinese Power Meter


Module 1

Claiming: 8GHz 1-8000Mhz OLED display RF Power Meter -45 +5 dBm + Sofware RF Attenuation Value digital meter
Was delivered with an nice looking USB cable



Based on:
STM8????
CH340G USB --> serial converter
AMS1117 3.3V



Power detector most probaly AD8318 (not able to recognize)

Module 2

Claiming: AD8317 (1-10000MHz) RF Power Meter Logarithmic Detector Controller 1MHz to 10GHz for AmplifierS fm HF VHF UHF



Marking on the chip is Q1 IR, so it should be an AD8317


Mini-Circuits PWR-SEN-6G+

Mini-Circuits PWR-SEN-6G+

This post is about the Mini-Circuits USB power sensor


Inside view of the power head


Components





CY7C63743    CYPRESS enCoRe™ USB Combination Low-Speed USB and PS/2 Peripheral Controller


24LC512    512K I2C™ Serial EEPROM (Address: 0xA8)



ADR431    Ultralow Noise XFET Voltage References with Current Sink and Source Capability

AD7414    ±0.5°C Accurate, 10-Bit Digital Temperature Sensor, I2C


AD7791    Low Power, Buffered 24-Bit Sigma-Delta ADC, SPI

SMS7630-079LF    SKYWORKS RF Schottky Diode
(not 100% sure! Marking: Anode)


How does it work?




The 5 resistors at the input form a combined 3dB resistive pad and RF termination. The RF diode (SMS7630-079LF) rectifies the signal, the capacitors on the DC side form a broadband shortcircuit for RF. Having the different capacitance values in the arrangement shown above (the pF very close to the diode) is very important for a flat frequency response.


USB Interface and Software

USB Interface information:

Bus 002 Device 009: ID 0fc5:1222 Delcom Engineering I/O Development Board
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x0fc5 Delcom Engineering
  idProduct          0x1222 I/O Development Board
  bcdDevice            0.11
  iManufacturer           1 MINI-CIRCUITS 
  iProduct                2 USB POWER SENSOR
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           18
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              250mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         0 (Defined at Interface level)
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
Device Status:     0x0002
  (Bus Powered)
  Remote Wakeup Enabled

The uC is a Delcom USB Generation I controller (802670 USB G1 LS 16 IO CHIP SOIC24) which does require custom Delcom IO driver. Generation II uses USB HID driver instead.