Commit Graph

64 Commits

Author SHA1 Message Date
Julian Oes 75657dc2eb cmake: add __DF_ defines with comments 2016-10-18 08:07:14 +02:00
Carlo Wood c6a2641507 Fix some pthread related linker stuff. (#5504)
The px4_os_add_flags defined in cmake/posix/px4_impl_posix.cmake did
add (threading) libraries to added_exe_linker_flags, which subsequently
end up in CMAKE_EXE_LINKER_FLAGS and then have no effect because those
flags are passed to the linker before any of the object files and static
libraries.

Those libraries are already added correctly in the corresponding
src/firmware/*/CMakeLists.txt files (for qurt, nuttx AND posix).

I left in the non-library linker flag '-pthread' for the bebop board,
although it seems very weird to me that this is needed (is it?).
If that is needed then it seems weird to link manually (that is,
src/firmware/*/CMakeLists.txt) with -lpthread.

For linux/g++ -pthread is added to the CXXFLAGS as it should be:
this causes the compiler to define _REENTRANT which is needed
for (the interface of) certain libraries to become thread-safe.
Offically one also can just pass -pthread to the linker, which then
causes the right libraries to be linked, but just linking with
-lpthread -lm -lrt works too.

I ran into this while adding support for libcwd, which explicitly
complains that _REENTRANT isn't defined when trying to link with
the thread-safe version of libcwd (-lcwd_r) and then tells you
to use -pthread.
2016-09-26 22:53:41 +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
Lorenz Meier 25182108f9 Ensure NuttX build depends on defconfig 2016-08-27 12:56:31 +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
Lorenz Meier 332f669d9b Add tap-v1 config 2016-07-06 13:34:35 +02:00
Daniel Agar 7badf645b3 fix missing stack check instrument_flags (#4593) 2016-05-20 21:17:54 -04:00
Daniel Agar 5da9e7e653 cmake nuttx copy with rsync 2016-05-19 21:49:34 +02:00
Daniel Agar b0b2cfaa65 cmake nuttx stackcheck fix for current master 2016-05-19 21:49:34 +02:00
David Sidrane 4e26c7fcd4 Use the value of nuttx CONFIG_ARMV7M_STACKCHECK to configure PX4 build for HW stack checking 2016-05-19 21:49:34 +02:00
David Sidrane d7daab9620 Move the build log to nuttx directory 2016-05-11 14:59:36 +02:00
Mark Charlebois 8cb8987bcd Use DriverFramework as a PX4 module (#4415)
* Use DriverFramework as a PX4 module

Targets wanting to use DriverFramework must add

   lib/DriverFramework/framework

to their config file.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>

* Removed spurious code

No need to add if check before for loop

Signed-off-by: Mark Charlebois <charlebm@gmail.com>

* Added DriverFramework to NuttX configs

Added lib/DriverFramework/firmware to nuttx configs

Signed-off-by: Mark Charlebois <charlebm@gmail.com>

* Updated src/lib/DriverFramework

* Removed DF_TARGET and __DF_${OS} defines

These are now handled inside DriverFramework

Signed-off-by: Mark Charlebois <charlebm@gmail.com>

* Updated DriverFramework

Signed-off-by: Mark Charlebois <charlebm@gmail.com>

* Restored __DF_${OS}

The include files in DriverFramwork need to know the target OS.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2016-05-03 10:03:28 +02:00
Daniel Agar 0b54bb99f9 NuttX quiet build
cmake combine NuttX copy and export

-NuttX wasn't recopying if it fails to compile
2016-04-17 16:02:28 -04:00
James Goppert 967e4dd127 Modified cmake to use STACK_MAX and STACK_MAIN 2016-04-14 13:36:36 -04:00
Felix Hu bd580e09bf supports MindPXv2 borad which is a product from AirMind. 2016-03-30 19:45:39 +02:00
lchish 6e1f54e2ff Add missing stm32f4discovery make targets 2015-12-29 11:57:29 +01:00
Lorenz Meier f0a4979da6 Merged master into driver_framework 2015-12-01 12:34:02 +01:00
David Sidrane a67097731a Renamed pax4fmu-v3 to pax4fmu-v4 2015-11-28 09:13:15 +01:00
David Sidrane f3b7585a89 Wip FMUV3 2015-11-28 09:13:15 +01:00
Mark Charlebois c4438bf50a Fix to move DriverFramework includes to common
Nuttx now gets to link phase. But there are two unresolved symbols:

arm-none-eabi/include/c++/4.7.4/bits/basic_string.h:1128: undefined reference to `std::string::assign(char const*, unsigned int)'
arm-none-eabi/include/c++/4.7.4/bits/stl_list.h:1534: undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-11-19 09:35:18 -08:00
Mark Charlebois 7111e9d4c9 Removed -lstdc++ for nuttx build
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-11-18 20:18:22 -08:00
Mark Charlebois 52957ab0cc Don't add DriverFramework dir for NuttX
I am unable to get the nuttx build dependencies set up so that
it builds the export dir before it builds df_driver_framework.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-11-18 20:14:48 -08:00
Mark Charlebois 1bcb93180b Set flags for building the proper DriverFramework target
The DF_TARGET cmake variable needs to be set to (linux, darwin, qurt, nuttx)
The define __DF_LINUX or __DF_QURT needs to be set.
The __DF_DARWIN target is untested

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-11-16 23:24:59 -08:00
Daniel Agar e2fda01545 nuttx only show stderr
-failures will still be displayed, but we don't need to see normal
successful compile output
2015-10-14 12:19:39 -04:00
Daniel Agar 75b3564789 cmake better nuttx copy 2015-10-14 12:13:33 -04:00
Daniel Agar a45fe63430 bin_to_obj.py fix windows regex size match 2015-10-14 01:56:18 -04:00
Daniel Agar 3f0653e824 bin_to_obj.py don't use full path to visibility.h 2015-10-14 01:56:18 -04:00
Daniel Agar 2c1e999e1a cmake remove rsync dep 2015-10-14 01:56:15 -04:00
Lorenz Meier 428297fd6f Revert "Remove rsync dependency"
This reverts commit 5b9a19aa65.
2015-10-10 22:25:14 +02:00
Lorenz Meier 5b9a19aa65 Remove rsync dependency 2015-10-10 17:45:31 +02:00
Thomas Gubler 2bbb1ad35f python3 fixes 2015-10-10 11:03:04 +02:00
Daniel Agar f13daa7314 cmake fix NuttX copy
-on the 2nd run this was copying NuttX to NuttX/Nuttx
2015-10-06 18:28:30 -04:00
Daniel Agar 330bacd229 cmake nuttx slightly quieter 2015-10-06 18:28:29 -04:00
Daniel Agar 7749d1cb1c cmake fix export paths for ninja
-make nuttx build a bit quieter
2015-10-06 18:28:29 -04:00
James Goppert 4dd59cd09a Fixed param dependencies. 2015-10-06 15:20:38 -04:00
Lorenz Meier d0ca0ff837 Added FMUv1 config 2015-10-03 17:25:49 +02:00
James Goppert 501f3cf2df Fix for tracking nuttx config changes. 2015-09-20 10:29:13 +02:00
James Goppert 2101ffbeca Removed extra print message. 2015-09-19 18:15:17 -04:00
James Goppert bd33d546e3 Fixed extra dir. 2015-09-19 18:10:57 -04:00
James Goppert 7b6dff7cdc Fix for romfs generation. 2015-09-19 17:57:54 -04:00
James Goppert cd98cfe555 cmake: ROMFS build overhaul. 2015-09-19 13:44:02 -04:00
James Goppert 8165cd2171 Fixed romfs dependency. 2015-09-19 11:36:20 -04:00
James Goppert cc053bffcd Added px4io bin to ROMFS. 2015-09-19 09:58:10 -04:00
James Goppert 676a3d230c Work on px4io firmware building. 2015-09-13 23:20:00 -04:00
James Goppert a58416235d Re-enable autostart. 2015-09-13 17:35:15 -04:00
James Goppert 3203f9ac9e Improvements to make support, added debug target. 2015-09-13 14:39:19 -04:00
Lorenz Meier c19fa0c822 Revert "Revert "Disable autostart for now so usb works.""
This reverts commit 998acf4d08.
2015-09-12 12:06:45 +02:00