Commit Graph

108 Commits

Author SHA1 Message Date
Daniel Agar dc787830b5 circleci run tests under code coverage (#6273)
* use regular optimization levels for the code coverage build.
 * the mixer test fails intermittently when built without optimization
2017-01-09 16:08:40 -05:00
Daniel Agar 48e7c784e7 remove px4_model targets from all 2017-01-06 11:56:27 +01:00
Stephan Brown 67a484ac34 Make parameter generation also depend on the scripts that run. Address some review comments. 2017-01-06 09:58:58 +01:00
mazahner 6fe9b8e543 use CmakeLists scope to generate te XML file
- the only difference really is, that scope (the configuration.cmake) is already passed
  to px_process_params via the argument --scope. The Paths in --scope are evaluated w.r.t
  the path to src provided via the -s /--src-path argument.
- if no --scope is proveided. the Old scheme by simply walking the full --src-path directory
  is applied
2017-01-04 09:29:52 +01:00
Daniel Agar a0837b88a5 cmake add clang santiziers
- PX4_ASAN=1 enable address sanitizer (was MEMORY_DEBUG)
 - PX4_TSAN=1 enable thread santiizer
 - PX4_UBSAN=1 enable undefined behaviour santizier (some options off)
2017-01-02 10:14:41 +01:00
Daniel Agar 1ceb0bebb5 sitl tests don't manually stop mavlink and dataman 2017-01-02 10:14:41 +01:00
Daniel Agar 34b2fb55e6 Makefile add clang-check and clang-tidy helpers 2017-01-02 10:14:41 +01:00
Daniel Agar dc9a71b674 WIP startup_shutdown test with ASAN on 2017-01-02 10:14:41 +01:00
Daniel Agar c9192e23e1 quiet git header output 2017-01-02 10:14:41 +01:00
Beat Küng ffe4688d0b px4_base.cmake: make sure px_update_git_header.py is executed in the source directory
otherwise the 'git describe' command can fail.
2016-12-21 14:09:41 +01:00
Lucas De Marchi 9ee478e1f7 cmake: fix update of git hashes
Since the git hashes were being generate by cmake it would only be
generated if the header file was not present. Simple test:

    $ make aerofc-v1_default
    $ touch a
    $ git add a
    $ git commit -m tmp
    $ make aerofc-v1_default

The file build_aerofc-v1_default/build_git_version.h should have the new
hashes and the correspondent .c/c.pp files should be rebuilt, but they
aren't.  The end result is that checking the version with "ver git" in
the nsh console will point to the wrong commit.

This moves the generation of the header to a separate tool and enforces
the command to be executed every time.
2016-12-21 14:09:41 +01:00
David Sidrane d6098c8226 Adding Nuttx Build infrastructure 2016-12-21 08:34:20 +01:00
Daniel Agar 1941dfca87 add tests code coverage
-closes #5862
2016-12-07 20:17:00 +01:00
José Roberto de Souza c49c3f469e aerofc: add upload command
AeroFC is updated by Aero board using the UART between AeroFC
and Aero board.

This script will copy firmware and px_uploader.py to Aero board and run
px_uploader.py with the correct paremeters. User only needs to have a
network connection (Ethernet over USB or WiFi) with Aero board to update
AeroFC firmware. The IP/hostname can be given by AERO_HOSTNAME
environment variable.
2016-11-28 09:21:12 +01:00
Julian Oes 109558cf1f cmake: fix git binary hash
The generated binary hash was off by one.
2016-11-23 12:42:06 +01:00
Michael Schaeuble ffaed18e67 Reduce the binary size Bebop
The firmware binary is to large to fit into the onboard memory of the Parrot
Bebop. It could be uploaded to the emmc, but for ease of use it would be nice
to have it in /usr/bin. To strip the binary seems to be the best option right now.
2016-10-18 23:56:56 +02:00
David Sidrane 979381fcfa Support passing defines from top level config makefile 2016-10-18 00:23:58 +02:00
nephen 0027333e6d add pci-Bitcraze to px4_base.cmake 2016-09-30 23:06:57 +02:00
Julian Oes b1708f3871 cmake: only optimize for size on NuttX
With this change only builds for NuttX which are very much flash size
constraint are optimized for size. All other builds (e.g. SITL,
Snapdragon, etc.) are left at the default for debugging or -O2 for the
usual use.
2016-09-30 08:11:51 +02:00
Beat Küng 670c93e726 cmake: add support for out-of-tree modules via EXTERNAL_MODULES_LOCATION variable 2016-09-27 15:10:23 +02:00
Dennis Shtatnov b9c5d117dd CF2: Linux USB uploading fix 2016-09-21 17:20:08 -04:00
Carlo Wood e93324785b list_vmd_make_targets and list_cmake_targets
* This allows one to run 'make posix list_vmd_make_targets' and get output like

>make posix list_vmd_make_targets
[...]
-- Build files have been written to:
/usr/src/debian/px4/Firmware/Firmware.git/build_posix_sitl_default
PX4 CONFIG: /usr/src/debian/px4/Firmware/Firmware.git/build_posix_sitl_default
Scanning dependencies of target list_vmd_make_targets
[100%] List of acceptable 'posix_sitl_default' <viewer_model_debugger> targets:
none
none_iris
none_iris_opt_flow
none_tailsitter
[...]
replay_solo_valgrind
replay_typhoon_h480_valgrind
[100%] Built target list_vmd_make_targets

Or, run 'make list_vmd_make_targets' from the build_posix_* directory.

* This adds the list_cmake_targets make target to print all
cmake targets that one can match with PX4_NO_OPTIMIZATION.
PX4_NO_OPTIMIZATION is ignored (do optimization as normal)
when the CONFIG isn't posix_sitl_*.

* Add comment in Makefile on how/where to find all targets.
2016-09-13 16:31:08 +02:00
Carlo Wood 77d356d275 Target specific optimization control.
This allows one to set a semi-colon separated list of regular
expressions in the environment variable PX4_NO_OPTIMIZATION
to control which (cmake generated) targets should be compiled
without optimization.

Suppressing optimization can be necessary for debugging in
a debugger, especially when trying to step through the code
or needing to print variables that otherwise are optimized out.

EXAMPLE

export PX4_NO_OPTIMIZATION="px4;^modules__uORB;^modules__systemlib$"

will result in the following messages during cmake configuration:

[...]
-- Disabling optimization for target 'platforms__posix__px4_layer'
because it matches the regexp 'px4' in env var PX4_NO_OPTIMIZATION
-- Disabling optimization for target 'modules__systemlib' because it
matches the regexp '^modules__systemlib$' in env var PX4_NO_OPTIMIZATION
-- Disabling optimization for target 'modules__uORB' because it matches
the regexp '^modules__uORB' in env var PX4_NO_OPTIMIZATION
-- Disabling optimization for target 'examples__px4_simple_app' because
it matches the regexp 'px4' in env var PX4_NO_OPTIMIZATION
-- Disabling optimization for target 'modules__uORB__uORB_tests' because
it matches the regexp '^modules__uORB' in env var PX4_NO_OPTIMIZATION
-- Disabling optimization for target 'px4' because it matches the regexp
'px4' in env var PX4_NO_OPTIMIZATION

Note that a list of all (currently used) target names can be printed
with the following command line from within the required build directory:

find . -wholename '*/CMakeFiles/*.dir/flags.make' | xargs dirname | xargs basename -a | sort -u | sed -e 's/.dir$//'
2016-09-13 16:31:08 +02:00
Carlo Wood 03d176d097 Bug fixes, typos, indentation.
Over time I made a few changes unrelated to what I'm really working on.
These changes are hereby committed first. The bug fixes are related to
what I'm doing in that I need them to be fixed for future commits.

Tools/sitl_run.sh: rename label to rcS_dir and fix usage help.
cmake/common/px4_base.cmake: Remove the check on OUT_UNPARSED_ARGUMENTS,
  and a few typos and indentation issues.
cmake/configs/posix_sitl_replay.cmake: Set the correct variable
  (config_sitl_rcS_dir) to the correct directory.
cmake/nuttx/px4_impl_nuttx.cmake: typos and indentation issues,
  and removal of a redundant FORCE (INTERNAL implies FORCE).
cmake/posix/px4_impl_posix.cmake: typos and indentation issues.
cmake/qurt/px4_impl_qurt.cmake: typos and indentation issues.
src/modules/mavlink/mavlink_ftp.cpp : possible strict-aliasing breakage.

NOTES

The second argument passed to sitl_run.sh is the value of
config_sitl_rcS_dir. This fact is missing from the usage help.
I renamed 'label' to 'rcS_dir' to better reflect this.
Also, for the 'replay' config the wrong variable was set causing
the call to sitl_run.sh to skip an argument and fail (ie the
debugger was passed as rcS_dir and so on).

The check on OUT_UNPARSED_ARGUMENTS in px4_parse_function_args
basically causes every passed IN variable to be REQUIRED and is
therefore a bug. The test for the presence of the REQUIRED arguments
follows directly after and is sufficient for this job. This bug went
unnoticed because currently every argument to OPTIONS, ONE_VALUE,
and MULTI_VALUE is actually passed to the function(s) calling
px4_parse_function_args (them being REQUIRED or not).

The changes in mavlink_ftp.cpp are to avoid a possible aliasing bug
and (mostly) to avoid the compiler warning/error: dereferencing type-
punned pointer will break strict-aliasing rules [-Werror=strict-aliasing].
2016-09-13 16:31:08 +02:00
mazahner 73014acf97 Only Compile and create dependencies for the Messages specified in msg/CMakeLists.txt
this lets a user select what msgs should be compiled for his project
Care must be taken though, to compile all orb_topcis that are required by the Rest of the Code.
Otherwise many compile errors will occur.

This commits adds by default the ./msg include path to reference to other msgs.
if an exisiting msg is used in another msg.
2016-08-25 22:30:13 +02:00
James Goppert 818840b576 Path cleanup, low impact changes (#5340)
* Low impact changes from path_cleanup branch.

This is a step towards minimizing the diff with path_cleanup branch.

* Update ecl.

* Revert matrix update.

* Revert ecl and matrix.

* Update sitl gazebo.

* Revert sitl_gazebo and matrix changes.
2016-08-18 15:37:23 -04:00
Lorenz Meier 102f5b54d7 Revert "Improvements to SITL to make paths more flexible. (#5181)"
This reverts commit 699b6a2cb3.
2016-08-05 21:29:49 +02:00
James Goppert 699b6a2cb3 Improvements to SITL to make paths more flexible. (#5181) 2016-08-05 06:23:59 -04:00
Beat Küng f8382a2713 upload scripts: add TAP for the uploader script 2016-07-12 16:00:33 +02:00
Lucas De Marchi 18330f7ab7 Move __STDC_FORMAT_MACROS to build system
__STDC_FORMAT_MACROS changes the behavior of inttypes.h to allow
defining format macros for printf-like functions. It needs to be defined
before any include is done, otherwise due to include chains and header
guards it may not take effect.

Instead of having to define it everywhere it is used, move the define to the
build system. Also update ecl and DriverFramework submodules to deal with the
changed definitions.
2016-07-10 16:31:36 +02:00
Daniel Agar 3f3a44fec5 cmake status message if MEMORY_DEBUG enabled 2016-06-22 13:51:39 +02:00
Julian Oes b24eded7a0 cmake: use module name if no main is available 2016-06-07 22:10:56 +02:00
Julian Oes cdd45a7b2d cmake: add define for module name 2016-06-07 22:10:56 +02:00
Michael Schäuble d9422e0296 Add Parrot Bebop as build target (#4698)
* Add parrot bebop build structure

* Add upload functionality to bebop build

* Add modules and commands to bebop build
2016-05-31 13:04:22 +02:00
Daniel Agar 5be1f3a856 ASan use normal optimization (MEMORY_DEBUG=1)
- see #4530
2016-05-22 10:27:29 +02:00
Daniel Agar 2487dbfc92 remove Wpacked and cleanup unused warning flags 2016-05-19 21:49:34 +02:00
Kabir Mohammed 529460d573 Fix RPi2 build system 2016-05-19 15:41:50 +02:00
Beat Küng 7f65e01d07 cmake: avoid GLOB for *.msg files and use an explicit .msg file enumeration
This makes sure that adding & removing of .msg files is handled properly
by the build system.
2016-05-17 09:08:13 +02:00
Beat Küng 6e7c605279 Tools/px_generate_uorb_topic*: combine the src & header generators into one script 2016-05-14 11:27:07 +02:00
Daniel Agar 76387b1693 uorb autogeneration 2016-05-14 11:27:07 +02:00
Daniel Agar a4c7fe50a7 travis-ci proper git version 2016-05-13 22:10:35 +02:00
Lorenz Meier e016f6ca38 Clang: Do not use new pointer option 2016-05-11 12:59:41 +02:00
Julian Oes 097840ef83 eagle: fix DSP build
The hexagon-clang is clang-3.5 and does not support -fcheck-new.
2016-05-11 09:32:05 +02:00
Beat Küng 7d733c5ccd cmake: add -fcheck-new to cxx_compile_flags
GCC assumes that operator new never returns null, but throws an exception
instead. This is defined by the C++ standard, and thus ok. But we disable
exceptions with -fno-exceptions, so we break this assumption. GCC then goes
ahead and removes some of our nullptr checks. This flag removes the
assumption.

This adds ~1.4kB to the binary size of the px4fmu-v4 target.
2016-05-10 21:23:53 +02:00
Lorenz Meier 1e7f19335d Build: Less verbose 2016-05-05 13:37:02 +02:00
Daniel Agar 7aa6e85563 enable Wshadow 2016-05-05 13:32:42 +02:00
David Sidrane a08cce27d7 Allow paramter culling to be tunred off 2016-05-05 08:00:26 +02:00
Lorenz Meier ff3e17df0d Systemlib: Add FW and OS versioning 2016-05-03 11:39:39 +02:00
Lorenz Meier 0c7a4fd66e Make parameter source file generation properly depend on board config 2016-05-01 13:47:41 +02:00
David Sidrane 64d43ad381 Scope parameter included in build by cmake/configs
Conflicts:
	Tools/px_generate_params.py
	src/lib/ecl
2016-05-01 13:47:41 +02:00