From 7d744fa330ce214abf22ebcfc53a89fd531c10fa Mon Sep 17 00:00:00 2001 From: Michael Keller Date: Sat, 24 Oct 2020 21:03:19 +1300 Subject: [PATCH] Merge pull request #10289 from haslinghuis/fix_tests_errors --- docs/development/Building in Ubuntu.md | 23 ++++++++++++++--------- src/test/Makefile | 16 +++++++++++++++- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/docs/development/Building in Ubuntu.md b/docs/development/Building in Ubuntu.md index 664adc813..fffedecd2 100644 --- a/docs/development/Building in Ubuntu.md +++ b/docs/development/Building in Ubuntu.md @@ -76,16 +76,21 @@ sudo dpkg -i gcc-arm-none-eabi_4-8-2014q2-0saucy9_amd64.deb Make sure to remove `obj/` and `make clean`, before building again. -## Updating and rebuilding +### Building Betaflight Configurator -Navigate to the local betaflight repository and use the following steps to pull the latest changes and rebuild your version of betaflight: +See [Betaflight Configurator Development](https://github.com/betaflight/betaflight-configurator#development) for how to build the Betaflight Configurator. + +### Flashing a target with Betaflight Configurator on Ubuntu 20.04 + +In most Linux distributions the user won't have access to serial interfaces by default. Flashing a target requires configuration of usb for dfu mode. To add this access right type the following command in a terminal: + + $ sudo usermod -a -G dialout $USER + $ sudo usermod -a -G plugdev $USER + $ sudo apt-get remove modemmanager + $ (echo '# DFU (Internal bootloader for STM32 MCUs)' + echo 'ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="plugdev"') | sudo tee /etc/udev/rules.d/45-stdfu-permissions.rules > /dev/null + +Please log out and log in to active the settings. You should now be able to flash your target using Betaflight Configurator. -```bash -cd src/betaflight -git reset --hard -git pull -make clean TARGET=NAZE -make -``` Credit goes to K.C. Budd, AKfreak for testing, and pulsar for doing the long legwork that yielded this very short document. diff --git a/src/test/Makefile b/src/test/Makefile index 6dc53735f..b95ab1df8 100644 --- a/src/test/Makefile +++ b/src/test/Makefile @@ -446,11 +446,25 @@ COMMON_FLAGS = \ -O0 \ -DUNIT_TEST \ -isystem $(GTEST_DIR)/inc \ - -MMD -MP + -MMD -MP \ + -Wno-c99-extensions \ + -Wno-reorder CC_VERSION = $(shell $(CC) -dumpversion) CXX_VERSION = $(shell $(CXX) -dumpversion) +# Please revisit versions when new clang version arrive. Supported versions: { Linux: 7 - 10; OSX: 7- 12 } +# Travis reports CC_VERSION of 4.2.1 +CC_VERSION_MAJOR := $(firstword $(subst ., ,$(CC_VERSION))) +CC_VERSION_CHECK_MIN := 4 +CC_VERSION_CHECK_MAX := 10 +ifdef MACOSX +CC_VERSION_CHECK_MAX := 12 +endif +ifeq ($(shell expr $(CC_VERSION_MAJOR) \< $(CC_VERSION_CHECK_MIN) \| $(CC_VERSION_MAJOR) \> $(CC_VERSION_CHECK_MAX)),1) + $(error $(CC) $(CC_VERSION) is not supported. On most systems the correct compiler will be available as 'clang-10' and 'clang++-10, but Betaflight invokes 'clang' and 'clang++' to accommodate some operating systems that do not have proper clang compilers available. Please modify your system so that an appropriate version of clang is invoked as 'clang' and 'clang++'.) +endif + ifeq ($(shell $(CC) -v 2>&1 | grep -q "clang version" && echo "clang"),clang) # Please revisit versions when new clang version arrive. Supported versions: { Linux: 7 - 10; OSX: 7- 12 } -- 2.11.4.GIT