Very Tiny Palmtop Vector Network Analyzer
Find a file
DiSlord d2431f0cdc Increase screen render (in some cases up to 2x speedup), decrease stack usage (code size less on 1500 bytes)
Write simple profiling definitions
 START_PROFILE
 STOP_PROFILE
Use it for detect sys tick amount and output to screen

main.c
 Reduce VNA_SHELL_MAX_LENGTH to 48, and made shell_line as static (reduce stack usage)
 Remove BaseSequentialStream *chp from command calls (use static shell_stream), it reduce code size and stack usage
 Use VNA_SHELL_FUNCTION definition for all commands
 Remove chMtxLock(&mutex);chMtxUnlock(&mutex); from commands, and define command flag for use it in calls
 Apply default scale from trace_info on trace change
 Led blink outside from main sweep cycle (better look, and less noise)
 Some size fixes

chprintf.c
 Implement small memory stream object, only put function and plot_printf(char *str, int size, const char *fmt, ...)
 Use it in all code (little increase speed, and huge decrease size)

 Restore USE_EXCEPTIONS_STACKSIZE = 0x180 (possible not need, but not good tested)

plot.c
 Made huge screen render profile (add some comments)
 Not use cell clipping on draw cell data (use constants increase speed, decrease stack usage (not need put it to stack))
 Clip cell if need only on screen flush
 Use new plot_printf, remove chsnprintf usage

Apply code style
============================================================================================================
Interesting fact
Usage memset(spi_buffer, DEFAULT_BG_COLOR, (h*CELLWIDTH)*sizeof(uint16_t)); dramatically decrease render speed
possibly it fill buffer by 8 bit data, so slow
Usage
  uint32_t *p = (uint32_t *)spi_buffer;
  while (count--) {
    p[0] = DEFAULT_BG_COLOR|(DEFAULT_BG_COLOR<<16);
    p[1] = DEFAULT_BG_COLOR|(DEFAULT_BG_COLOR<<16);
    p[2] = DEFAULT_BG_COLOR|(DEFAULT_BG_COLOR<<16);
    p[3] = DEFAULT_BG_COLOR|(DEFAULT_BG_COLOR<<16);
    p+=4;
  }
gives x10 speed perfomance

Draw polar and smit grid very slow (but i don`t know how increase it except use bitmaps, but it need about 5-8k flash size and file prepare)
On long lines render slow down, but clipping use more calculation, and not give good result
Need made stack usage check
2020-02-24 22:47:52 +03:00
.circleci update golang 1.10 2019-09-14 20:15:27 +09:00
.vscode env: add tasks.json for vscode 2019-10-14 09:03:14 +09:00
ChibiOS@669d4bbc8d revert chibios fix 2019-09-03 08:06:59 +09:00
doc add schematics, block diagram and pcb photo, update README.md 2017-02-03 21:25:02 +09:00
NANOVNA_STM32_F072 move enter dfu to submenu of config 2019-09-06 21:11:44 +09:00
python doc: update notebook example 2019-11-17 20:26:43 +09:00
.gdbinit add hard_fault handler 2017-01-22 13:03:40 +09:00
.gitignore env: ignore png files 2019-10-14 09:03:26 +09:00
.gitmodules env: replace git submodule url as http to prevent failure to fetch without github account 2019-09-26 09:06:43 +09:00
adc.c show battery indicator (requires implementing D2 on board) 2019-09-10 01:01:24 +09:00
chconf.h Disable unused ChibiOS features: 2020-01-30 21:58:18 +03:00
chprintf.c Increase screen render (in some cases up to 2x speedup), decrease stack usage (code size less on 1500 bytes) 2020-02-24 22:47:52 +03:00
dsp.c remove buffer used only in dump command 2019-10-22 09:36:41 +09:00
ffconf.h initial commit 2016-09-05 07:29:43 +09:00
fft.h fix #92 : 'for' loop initial declarations 2019-11-17 11:16:36 +09:00
flash.c Increase main thread stack size (if used as shell, if run some commands get stack limit, example "trace 0 x" command) 2020-02-23 15:45:37 +03:00
Font5x7.c Increase screen render (in some cases up to 2x speedup), decrease stack usage (code size less on 1500 bytes) 2020-02-24 22:47:52 +03:00
halconf.h Change Font size (more readable) 2020-01-19 11:16:18 +03:00
ili9341.c Add definition of spi_buffer size 2020-02-23 17:13:52 +03:00
main.c Increase screen render (in some cases up to 2x speedup), decrease stack usage (code size less on 1500 bytes) 2020-02-24 22:47:52 +03:00
Makefile Increase screen render (in some cases up to 2x speedup), decrease stack usage (code size less on 1500 bytes) 2020-02-24 22:47:52 +03:00
mcuconf.h Change Font size (more readable) 2020-01-19 11:16:18 +03:00
nanovna.h Increase screen render (in some cases up to 2x speedup), decrease stack usage (code size less on 1500 bytes) 2020-02-24 22:47:52 +03:00
numfont20x22.c Big code redisign (increase CELL draw size, more faster screen render), also save about 4-5kB flash size 2020-02-22 10:50:54 +03:00
plot.c Increase screen render (in some cases up to 2x speedup), decrease stack usage (code size less on 1500 bytes) 2020-02-24 22:47:52 +03:00
prog.sh initial commit 2016-09-05 07:29:43 +09:00
README.md Update README.md 2020-01-27 07:28:10 +09:00
si5351.c fix: remove upper limit of signed int32 for frequency setting 2020-01-18 12:07:21 +09:00
si5351.h add argument rdiv in si5351 setupMultisynth 2017-02-02 05:18:29 +09:00
STM32F072xB.ld add save and restore dac value in flash 2017-01-02 22:03:20 +09:00
tlv320aic3204.c chore: update codec control 2019-10-21 20:25:44 +09:00
ui.c Increase screen render (in some cases up to 2x speedup), decrease stack usage (code size less on 1500 bytes) 2020-02-24 22:47:52 +03:00
usbcfg.c initial commit 2016-09-05 07:29:43 +09:00
usbcfg.h initial commit 2016-09-05 07:29:43 +09:00

NanoVNA - Very tiny handheld Vector Network Analyzer

GitHub release CircleCI

About

NanoVNA is very tiny handheld Vector Network Analyzer (VNA). It is standalone with lcd display, portable device with battery. This project aim to provide an RF gadget but useful instrument for enthusiast.

This repository contains source of NanoVNA firmware.

Prepare ARM Cross Tools

UPDATE: Recent gcc version works to build NanoVNA, no need old version.

MacOSX

Install cross tools and firmware updating tool.

$ brew tap px4/px4
$ brew install gcc-arm-none-eabi-80
$ brew install dfu-util

Linux (ubuntu)

Download arm cross tools from here.

$ wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2018q4/gcc-arm-none-eabi-8-2018-q4-major-linux.tar.bz2
$ sudo tar xfj gcc-arm-none-eabi-8-2018-q4-major-linux.tar.bz2 -C /usr/local
$ PATH=/usr/local/gcc-arm-none-eabi-8-2018-q4-major/bin:$PATH
$ sudo apt install -y dfu-util

Fetch source code

Fetch source and submodule.

$ git clone https://github.com/ttrftech/NanoVNA.git
$ cd NanoVNA
$ git submodule update --init --recursive

Build

Just make in the directory.

$ make

Build firmware using docker

Using this docker image and without installing arm toolchain, you can build the firmware.

$ cd NanoVNA
$ docker run -it --rm -v $(PWD):/work edy555/arm-embedded:8.2 make

Flash firmware

First, make device enter DFU mode by one of following methods.

  • Jumper BOOT0 pin at powering device
  • Select menu Config->DFU (needs recent firmware)

Then, flash firmware using dfu-util via USB.

$ dfu-util -d 0483:df11 -a 0 -s 0x08000000:leave -D build/ch.bin

Or simply use make.

$ make flash

Companion Tools

There are seveal numbers of great companion PC tools from third-party.

Documentation

Reference

Note

Hardware design material is disclosed to prevent bad quality clone. Please let me know if you would have your own unit.

Authorized Distributor

Credit

Contributors