Merge remote-tracking branch 'refs/remotes/ttrftech/master'

# Conflicts:
#	main.c
#	nanovna.h
This commit is contained in:
erikkaashoek 2019-09-15 12:01:26 +02:00
commit 14d0ca8d68
3 changed files with 31 additions and 26 deletions

View file

@ -2,7 +2,7 @@ version: 2
jobs: jobs:
build: build:
docker: docker:
- image: edy555/arm-embedded:4.9 - image: edy555/arm-embedded:8.2
steps: steps:
- checkout - checkout
- run: - run:
@ -25,7 +25,7 @@ jobs:
- build - build
publish-github-release: publish-github-release:
docker: docker:
- image: circleci/golang:1.8 - image: circleci/golang:1.10
steps: steps:
- attach_workspace: - attach_workspace:
at: . at: .

View file

@ -21,29 +21,23 @@ This repository contains source of NanoVNA firmware.
## Prepare ARM Cross Tools ## Prepare ARM Cross Tools
Requires gcc-4.9 to build firmware from source code. (Not work gcc-5.4 or lator, because of SRAM shortage that those runtime use more SRAM) **UPDATE**: Recent gcc version works to build NanoVNA, no need old version.
### MacOSX ### MacOSX
Install cross tools and firmware updating tool. Install cross tools and firmware updating tool.
$ brew tap px4/px4 $ brew tap px4/px4
$ brew install gcc-arm-none-eabi-49 $ brew install gcc-arm-none-eabi-80
$ brew install dfu-util $ brew install dfu-util
Otherwise, use toolchains included inside LPCxpresso. Like this.
$ PATH=$PATH:/Applications/lpcxpresso_7.8.0_426/lpcxpresso/tools/bin
### Linux (ubuntu) ### Linux (ubuntu)
Download arm cross tools from [here](https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update). Download arm cross tools from [here](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads).
This version is 32-bit binary, so additional lib32z1 and lib32ncurses5 package required.
$ wget https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 $ 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 -C /usr/local gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 $ sudo tar xfj -C /usr/local gcc-arm-none-eabi-8-2018-q4-major-linux.tar.bz2
$ PATH=/usr/local/gcc-arm-none-eabi-4_9-2015q3/bin:$PATH $ PATH=/usr/local/gcc-arm-none-eabi-8-2018-q4-major/bin:$PATH
$ sudo apt install -y lib32z1 lib32ncurses5
$ sudo apt install -y dfu-util $ sudo apt install -y dfu-util
## Fetch source code ## Fetch source code
@ -62,19 +56,23 @@ Just make in the directory.
### Build firmware using docker ### Build firmware using docker
You can build firmware using [this docker image](https://cloud.docker.com/u/edy555/repository/docker/edy555/arm-embedded) without installing arm toolchain. Using [this docker image](https://cloud.docker.com/u/edy555/repository/docker/edy555/arm-embedded) without installing arm toolchain.
$ cd NanoVNA $ cd NanoVNA
$ docker run -it --rm -v $(PWD):/work edy555/arm-embedded:4.9 make $ docker run -it --rm -v $(PWD):/work edy555/arm-embedded:8.2 make
## Flash firmware ## Flash firmware
Boot MCU in DFU mode. To do this, jumper BOOT0 pin at powering device. First, make device enter DFU mode by one of following methods.
Then, burn firmware using dfu-util via USB.
* 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 $ dfu-util -d 0483:df11 -a 0 -s 0x08000000:leave -D build/ch.bin
Or do simply Or simply use make.
$ make flash $ make flash
@ -94,6 +92,12 @@ Hardware design material is disclosed to prevent bad quality clone. Please let m
* [PCB Photo](/doc/nanovna-pcb-photo.jpg) * [PCB Photo](/doc/nanovna-pcb-photo.jpg)
* [Block Diagram](/doc/nanovna-blockdiagram.png) * [Block Diagram](/doc/nanovna-blockdiagram.png)
* Kit available from https://ttrf.tk/kit/nanovna * Kit available from https://ttrf.tk/kit/nanovna
* Credit: @edy555
[EOF] ## Credit
* [@edy555](https://github.com/edy555)
### Contributors
* [@hugen79](https://github.com/hugen79)
* [@cho45](https://github.com/cho45)

11
ui.c
View file

@ -386,9 +386,7 @@ touch_position(int *x, int *y)
void void
show_version(void) show_version(void)
{ {
int status;
int x = 5, y = 5; int x = 5, y = 5;
int i;
adc_stop(ADC1); adc_stop(ADC1);
ili9341_fill(0, 0, 320, 240, 0); ili9341_fill(0, 0, 320, 240, 0);
@ -407,9 +405,12 @@ show_version(void)
ili9341_drawstring_5x7("Port Info: " PORT_INFO, x, y += 10, 0xffff, 0x0000); ili9341_drawstring_5x7("Port Info: " PORT_INFO, x, y += 10, 0xffff, 0x0000);
ili9341_drawstring_5x7("Platform: " PLATFORM_NAME, x, y += 10, 0xffff, 0x0000); ili9341_drawstring_5x7("Platform: " PLATFORM_NAME, x, y += 10, 0xffff, 0x0000);
do { while (true) {
status = touch_check(); if (touch_check() == EVT_TOUCH_PRESSED)
} while(status != EVT_TOUCH_PRESSED); break;
if (btn_check() & EVT_BUTTON_SINGLE_CLICK)
break;
}
touch_start_watchdog(); touch_start_watchdog();
} }