Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CN0534 production test script #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions cn0534/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Build directories
bin/
obj/

# Prerequisites
*.d

# Object files
*.o
*.ko
*.obj
*.elf

# Linker output
*.ilk
*.map
*.exp

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lo

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex

# Debug files
*.dSYM/
*.su
*.idb
*.pdb

# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

test.log
339 changes: 339 additions & 0 deletions cn0534/LICENSE

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions cn0534/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# CN0534 Production Script
This is version 1 of the CN0534 production test which uses Pluto as the test platform.

The main script is based on the `power_check.c` script found on the [plutosdr_scripts repository](https://github.com/analogdevicesinc/plutosdr_scripts) with modifications to accommodate features to test of CN0534.

Running first the build script is necessary. Prior to running, set the build environment first in the `./build_arm.sh`, change the CC_DIR to the path of the bin folder of the compiler.

For Linux, with the cross compiler set on the host pc and linked with the sysroot used by the pluto, run `./build_arm.sh`. The sysroot used should match to the firmware of pluto. As of this writing, pluto firmware v0.30 is used. The sysroot folder should be in the same directory as the `./build_arm.sh`. Also, [updating Pluto to AD9364 frequency range](https://wiki.analog.com/university/tools/pluto/users/customizing#updating_to_the_ad9364) is necessary to accommodate CN0534 frequency range.

![Build Folder Structure](images/build_folder_structure.png)

With this build, the binary file can now be stored in a flash drive together with the `runme0.sh` and `parameters.txt`. And upon pluto power up, the binary test file automatically starts and the test is now running.

![Flashdrive files](images/Flashdrive_files.png)

What this script will do:
1. Get test parameters from parameters.txt.
2. Run test in every test line.
3. Frequency and scale is set on Pluto and the received signal is measured.
4. The test checks for frequency tolerance, sfdr, RSSI and peak power.
5. CN0534 DS2 (red LED) should turn on once during the test.
6. After execution of the test, LED1 will be Solid ON if the EVAL CN0534-EBZ passes the necessary tests. .
7. If an error happens, or invalid measurements persist 3 retries, LED1 will be turned OFF if the EVAL-CN0534-EBZ fails the tests
30 changes: 30 additions & 0 deletions cn0534/build_arm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh
ROOTFS=$(pwd)/pluto-0.30.sysroot
CROSS_COMPILE="$3"
HOST=${HOST:-x86_64}
GCC_ARCH=arm-linux-gnueabihf

[ -n "$CROSS_COMPILE" ] || {
CROSS_COMPILE=${GCC_ARCH}-gcc
if type "${GCC_ARCH}-gcc" >/dev/null 2>&1 ; then
CROSS_COMPILE="${GCC_ARCH}-"
else
GCC_VERSION="8.3-2019.03"
GCC_DIR="gcc-arm-${GCC_VERSION}-${HOST}-${GCC_ARCH}"
GCC_TAR="$GCC_DIR.tar.xz"
GCC_URL="https://developer.arm.com/-/media/Files/downloads/gnu-a/${GCC_VERSION}/binrel/${GCC_TAR}"
if [ ! -d "$GCC_DIR" ] && [ ! -e "$GCC_TAR" ] ; then
wget "$GCC_URL"
fi
if [ ! -d "$GCC_DIR" ] ; then
tar -xvf $GCC_TAR || {
echo "'$GCC_TAR' seems invalid ; remove it and re-download it"
exit 1
}
fi
CROSS_COMPILE=$(pwd)/$GCC_DIR/bin/${GCC_ARCH}-gcc
fi
}


make CC=$CROSS_COMPILE CFLAGS="-mfloat-abi=hard --sysroot=${ROOTFS} -I./include -L${ROOTFS}/lib"
Binary file added cn0534/images/Flashdrive_files.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cn0534/images/build_folder_structure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions cn0534/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
TARGETS = power_check

override CFLAGS += -std=gnu99 -Wall -Wextra -MMD -MP
override LDFLAGS += -liio -lm -lfftw3 -lpthread

SRC_DIR ?=./src
BIN_DIR ?=./bin
OBJ_DIR ?=./obj

SRCS := $(shell find $(SRC_DIR) -name *.c)
OBJS := $(SRCS:%=$(OBJ_DIR)/%.o)
DEPS := $(OBJS:.o=.d)

MKDIR_P ?= mkdir -p

.PHONY: all clean


all: $(BIN_DIR)/$(TARGETS)

$(OBJ_DIR)/%.c.o : %.c
$(MKDIR_P) $(dir $@)
$(CC) -g $(CFLAGS) -c $< -o $@

$(BIN_DIR)/$(TARGETS): $(OBJS)
$(MKDIR_P) $(dir $@)
$(CC) -g $(OBJS) -o $@ $(CFLAGS) $(LDFLAGS)

clean:
rm -rf $(BIN_DIR) $(OBJ_DIR)

-include $(DEPS)
12 changes: 12 additions & 0 deletions cn0534/parameters.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#TX-LO frequency(Hz), tx scale, RX-LO frequency(Hz), min peak power, peak frequency tolerance (Hz), min sfdr(dBFS), min rssi, min peak
5725000000, 0.28, 5725000000, -24, 1000, 40, 38, -90
5725000000, 0.14, 5725000000, -30, 1000, 32, 44, -90
5725000000, 0.07, 5725000000, -36, 1000, 24, 50, -90
5875000000, 0.28, 5875000000, -24, 1000, 40, 38, -90
5875000000, 0.14, 5875000000, -30, 1000, 32, 44, -90
5875000000, 0.07, 5875000000, -36, 1000, 24, 50, -90
5800000000, 0.28, 5800000000, -24, 1000, 40, 38, -90
5800000000, 0.14, 5800000000, -30, 1000, 32, 44, -90
5800000000, 0.07, 5800000000, -36, 1000, 24, 50, -90
5800000000, 0.40, 5800000000, -32, 1000, 36, 45, -90
5800000000, 0.28, 5800000000, -24, 1000, 40, 38, -90
5 changes: 5 additions & 0 deletions cn0534/runme0.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

cd /media/sda1/

./power_check -a -c parameters.txt -l 1 -i
Loading