This repository contains the source code to build the firmware for the NanoVNA V2 (S-A-A-2).
See https://nanorfe.com/nanovna-v2.html for more info.
The original project is https://github.com/nanovna-v2/NanoVNA2-firmware this branch modify only clock referance for synthetizer
The XO mounted on board is a very poor performance, low stability frequncy, low frequency accuracy,high jitter.
For example the jitter measured with oscilloscope after 1uS of trigger is 5nS.
To improve performance i added an LDO to power the OCXO
Compare Phase noise with R&S Spectrum Analyzer:
Dark green is NanoVNA at 200MHz
On any recent Debian based installation:
sudo apt install gcc-arm-none-eabi
If you want to install the latest version of the gnu ARM toolchain:
- get the latest version from https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads . You can download it using your browser or a command line tool like
wget
:
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2
- untar it, eg. in
/opt/toolchains
:
sudo mkdir -p /opt/toolchains
sudo tar xvf -C /opt/toolchains gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2
- set your PATH environment variable:
export PATH=/opt/toolchains/gcc-arm-none-eabi-9-2020-q2-update/bin:$PATH
To upload the firmware on the NanoVNA2, you will need:
- Python 3
- pyserial
On a Debian based system, you can use:
sudo apt install python3-serial
The code is spread out over 3 repositories, 2 of which are submodules of the main NanoVNA-V2-firmware one: Questo copia il branch giusto.
git clone --branch 20201013 https://github.com/nanovna/NanoVNA-V2-firmware.git
//OLD git clone --recursive https://github.com/nanovna/NanoVNA-V2-firmware.git
cd NanoVNA-V2-firmware
##Aggiornamento Bootloader Conviene aggiornare il bootloader git checkout -- gd32f303cc_with_bootloader.ld
gh repo clone nanovna/libopencm3-gd32f3
-Change the file with texteditor 'NanoVNA-V2-firmware/libopencm3/Makefile' replace row 27 with:
SRCLIBDIR:=
##Controlli preliminari -Verificare che la cartelle sotto 'NanoVNA-V2-firmware/' 'libopencm3' e 'mculib' ci siano dei file.
-Verificare che il file 'NanoVNA-V2-firmware/libopencm3/Makefile' alla riga 27 ci sia questa stringa:
SRCLIBDIR:=
-Verificare che sia installo Python sotto /usr/bin/env altrimenti il compilatore restituirà '/usr/ /env: ‘python’: No such file directory bin or' Soluzione 1: apt -get install python3 Soluzione 2: 'whareis python3' e 'sudo ln -s /usr/bin/python3 /usr/bin/python'
Now you can build the firmware by running make in the firmware sources directory: Se si ricompila bisogna prima cancellare i file nella directory 'NanoVNA-V2-firmware/' i 'binary.bin','binary.elf' e 'binary.hex'
cd NanoVNA-V2-firmware
make BOARDNAME=board_v2_2 EXTRA_CFLAGS="-DSWEEP_POINTS_MAX=201 -DSAVEAREA_MAX=7"
Non testato:
make -j4 BOARDNAME=board_v2_2 EXTRA_CFLAGS="-DSWEEP_POINTS_MAX=201 -DSAVEAREA_MAX=7" LDSCRIPT=./gd32f303cc_with_bootloader.ld
There are two options to update the firmware when using the regular USB interface:
- Use NanoVNA-QT
- Command line For this to work the device must stay in the bootloader and enter DFU mode
Use the file present in this repo 'binary.bin'
Another option is using a debugger using the debug pins.
Switch the device off
Press and hold down the left button (the one closest to the Port 1 or the On/Off switch)
Switch the device on (screen stays white), release the button