From b072034bdc6947b332bc1fc4c4c3fd1ca1cdf898 Mon Sep 17 00:00:00 2001 From: TT Date: Sat, 14 Sep 2019 11:50:22 +0900 Subject: [PATCH 1/5] update gcc version to build --- .circleci/config.yml | 2 +- README.md | 33 +++++++++++++++------------------ 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5617c21..a53f8bb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: docker: - - image: edy555/arm-embedded:4.9 + - image: edy555/arm-embedded:8.2 steps: - checkout - run: diff --git a/README.md b/README.md index 93072f8..4928bed 100644 --- a/README.md +++ b/README.md @@ -21,29 +21,23 @@ This repository contains source of NanoVNA firmware. ## 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 Install cross tools and firmware updating tool. $ brew tap px4/px4 - $ brew install gcc-arm-none-eabi-49 + $ brew install gcc-arm-none-eabi-80 $ 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) -Download arm cross tools from [here](https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update). -This version is 32-bit binary, so additional lib32z1 and lib32ncurses5 package required. +Download arm cross tools from [here](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads). - $ 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 - $ sudo tar xfj -C /usr/local gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 - $ PATH=/usr/local/gcc-arm-none-eabi-4_9-2015q3/bin:$PATH - $ sudo apt install -y lib32z1 lib32ncurses5 + $ 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-8-2018-q4-major-linux.tar.bz2 + $ PATH=/usr/local/gcc-arm-none-eabi-8-2018-q4-major/bin:$PATH $ sudo apt install -y dfu-util ## Fetch source code @@ -62,19 +56,23 @@ Just make in the directory. ### 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 - $ 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 -Boot MCU in DFU mode. To do this, jumper BOOT0 pin at powering device. -Then, burn firmware using dfu-util via USB. +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 do simply +Or simply use make. $ make flash @@ -95,5 +93,4 @@ Hardware design material is disclosed to prevent bad quality clone. Please let m * [Block Diagram](/doc/nanovna-blockdiagram.png) * Kit available from https://ttrf.tk/kit/nanovna * Credit: @edy555 - [EOF] From cd8b3716744171535ed9e5ef3f8ec694487526b7 Mon Sep 17 00:00:00 2001 From: TT Date: Sat, 14 Sep 2019 11:54:07 +0900 Subject: [PATCH 2/5] doc: add contributors --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4928bed..26e43ed 100644 --- a/README.md +++ b/README.md @@ -92,5 +92,12 @@ Hardware design material is disclosed to prevent bad quality clone. Please let m * [PCB Photo](/doc/nanovna-pcb-photo.jpg) * [Block Diagram](/doc/nanovna-blockdiagram.png) * 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) From 118f3b3758220bbe95f8fca378c8a01953d176e5 Mon Sep 17 00:00:00 2001 From: TT Date: Sat, 14 Sep 2019 13:42:22 +0900 Subject: [PATCH 3/5] ui: close version on lever click --- ui.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ui.c b/ui.c index 0012db5..7eb8576 100644 --- a/ui.c +++ b/ui.c @@ -386,9 +386,7 @@ touch_position(int *x, int *y) void show_version(void) { - int status; int x = 5, y = 5; - int i; adc_stop(ADC1); 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("Platform: " PLATFORM_NAME, x, y += 10, 0xffff, 0x0000); - do { - status = touch_check(); - } while(status != EVT_TOUCH_PRESSED); + while (true) { + if (touch_check() == EVT_TOUCH_PRESSED) + break; + if (btn_check() & EVT_BUTTON_SINGLE_CLICK) + break; + } touch_start_watchdog(); } From c388832ef0a4b3c8b007a346ae52114c6038f1cf Mon Sep 17 00:00:00 2001 From: TT Date: Sat, 14 Sep 2019 14:30:38 +0900 Subject: [PATCH 4/5] Revert "add command battery" This reverts commit be45653c2b4bb0b4c59807197747e9c54d2b2908. --- main.c | 13 ------------- nanovna.h | 2 -- 2 files changed, 15 deletions(-) diff --git a/main.c b/main.c index 96401a4..4bafd45 100644 --- a/main.c +++ b/main.c @@ -1603,18 +1603,6 @@ static void cmd_touchtest(BaseSequentialStream *chp, int argc, char *argv[]) } -static void cmd_battery(BaseSequentialStream *chp, int argc, char *argv[]) -{ - (void)argc; - (void)argv; - - adc_stop(ADC1); - int v = adc_vbat_read(ADC1); - chprintf(chp, "%d\r\n", v); - touch_start_watchdog(); -} - - static void cmd_frequencies(BaseSequentialStream *chp, int argc, char *argv[]) { int i; @@ -1797,7 +1785,6 @@ static const ShellCommand commands[] = { "test", cmd_test }, { "touchcal", cmd_touchcal }, { "touchtest", cmd_touchtest }, - { "battery", cmd_battery }, { "pause", cmd_pause }, { "resume", cmd_resume }, { "cal", cmd_cal }, diff --git a/nanovna.h b/nanovna.h index 626eac4..655e78e 100644 --- a/nanovna.h +++ b/nanovna.h @@ -315,8 +315,6 @@ int config_recall(void); void clear_all_config_prop_data(void); -int16_t adc_vbat_read(ADC_TypeDef *adc); - /* * ui.c */ From 5c53824d36ad53b45ce69b2a75edb08e3a71dc74 Mon Sep 17 00:00:00 2001 From: TT Date: Sat, 14 Sep 2019 20:15:27 +0900 Subject: [PATCH 5/5] update golang 1.10 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a53f8bb..bdaaf48 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,7 +25,7 @@ jobs: - build publish-github-release: docker: - - image: circleci/golang:1.8 + - image: circleci/golang:1.10 steps: - attach_workspace: at: .