11925 Commits

Author SHA1 Message Date
Mark Charlebois
894611df04 Linux: Fixed argc check in sensors_main
Was checking for argc < 1, and should be argc < 2.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:34:12 -07:00
Mark Charlebois
058d4408cc Linux: removed debug output from shell
The command shell was spewing debug infor about the command and
parameters. Removed the debug output.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:34:12 -07:00
Mark Charlebois
e3efe71444 Linux: I2C implementation with simulator stub
If PX4_I2C_SIMULATE is set to 1, then the actual I2C device will
not be opened and all transfers will succeed.

If PX4_I2C_SIMULATE is false and transfer() is called, then the
appropriate ioctl is make on the actual device.

if I2C::ioctl is called via px4_ioctl() then the command fails and
a warning is printed to use I2C::transfer

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:34:12 -07:00
Mark Charlebois
78dd177e86 Linux: removed documentation of parameter
The parameter is not present in the linux implementation so removed
the documentation for the parameter.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:34:12 -07:00
Mark Charlebois
ccd18929fc Linux: changed CDev to VDev for virtual device implementation
To avoid confusion when a real device and a virtual device is
being used, changed CDev to VDev for Linux.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:34:12 -07:00
Mark Charlebois
8c8f57b5b4 Fixed std::isfinite vs isfinite differences
Added PX4_ISFINITE(x) to px4_defines.h to handle the differences on
NuttX and Linux.

This change also picked up some file renaming for virtual character devices

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:34:12 -07:00
Lorenz Meier
07b16ffa01 Enable estimators in config 2015-04-20 11:27:17 -07:00
Lorenz Meier
7bdaec9ff0 att + pos EKF: Enable execution on Linux 2015-04-20 11:27:17 -07:00
Lorenz Meier
b4d52327e8 att EKF: Enable execution on Linux 2015-04-20 11:21:52 -07:00
Lorenz Meier
a2a113ee28 Ported mc_att_control 2015-04-20 11:18:43 -07:00
Mark Charlebois
509f7f9fdb Linux: changed to use submodule version of eigen vs system version
Eigen no longer needs to be installed on the build machine as it is
downloaded as a submodule.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:17:21 -07:00
Mark Charlebois
3ab76caa78 Linux: Changed non-fatal px4_errx to warnx
px4_errx kills the process, so if possible we want to end the thread
but not the process. Using warnx and return exits gracefully.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:17:21 -07:00
Mark Charlebois
994065ef47 Linux: dont check stacksize in sdlog2
stacksize check in sdlog2 fails for x86_64

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:17:21 -07:00
Mark Charlebois
1805c21226 Linux: default to clang build
The build will now fail if clang is not found. To force the use
of GCC, use:

   make USE_GCC=1

The toolchain makefile was modified so it no longer checks for
various versions of clang if USE_GCC=1 is passed.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:16:26 -07:00
Mark Charlebois
8b985331a4 Linux: align pointers on 64bit
__param_start and __param end need to be 8 byte aligned on
64bit machines. Changed linker script to 8 byte align __param
section.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:16:26 -07:00
Mark Charlebois
e3f137ce23 Fixed gcc 4.8 warnings
Disabled gcc warnings that are tripped by Eigen.

Removed signal code that is not needed in Linux port and was
causing gcc warnings.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:16:26 -07:00
Mark Charlebois
eabc44afbe Linux: Added work queue support and unit test
PX4 uses NuttX data structures throughout so those data structures
were preserved and used to implement high and low priority queues.

A unit test for the work queues was added.

The polling rate of the queues are set in px4_config.h in
CONFIG_SCHED_WORKPERIOD. The units are milliseconds.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:16:26 -07:00
Mark Charlebois
dffb8bb62c MuORB: handle case on no args passed
if only uorb is called with no other args it crashes.

Handle the case where no args are passed.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:16:26 -07:00
Mark Charlebois
cf71db74d7 Support to specify build time OS target
Now run:

make PX4_TARGET_OS=nuttx

or

make PX4_TARGET_OS=linux

To test the linux build and make sure that the required directories
exist, run:

make linuxrun

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:16:26 -07:00
Mark Charlebois
aedf6fe628 Linux: Added preliminary work queue support
Based on NuttX work queue code.

Not yet functional.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:16:26 -07:00
Mark Charlebois
056d5f9075 Linux: Added wqueue files from NuttX
Import copies of work queue releated filed from NuttX.

These are the original files.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:16:26 -07:00
Mark Charlebois
340beac672 Linux: I2C virtual device
Create and open I2C virtual device and support I2C_RDWR ioctl

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:16:26 -07:00
Mark Charlebois
192d70e570 Linux: removed separate path for dataman file for Linux
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:16:26 -07:00
Mark Charlebois
bb7c8163b9 Linux: commented out tests
The src/platform/linux/tests modules were commented out in the
config file.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:16:26 -07:00
Mark Charlebois
31edc08cea Linux: added missing -pthread flag
LDFLAGS was missing -pthread

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:16:26 -07:00
Mark Charlebois
2cd44a24ea Linux: Added linker script support for param and added mc_att_control
Added linker script to resolve __param_start and __param_end.

Added mc_att_control to list of supported builtins.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:16:26 -07:00
Mark Charlebois
977036faf9 Linux: changed param to nit use errx or exit
Thread based implementaton can't call errx or exit

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:16:26 -07:00
Mark Charlebois
526b0e68eb Linux: modified shell to not show _main suffix
The builtin commands all have _main suffix by convention so
no need to show _main. Also nsh calls the commmands without the
_main suffix.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:15:13 -07:00
Mark Charlebois
1f84c348fc fix for segv if topic has not been published
If the topic has not been published, orb_copy returns a
negative number which causes update() to memset the data
contents to zero.

In some instances data is a null pointer. This causes a
segment violation crash.

Added a check for data != 0

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:15:12 -07:00
Mark Charlebois
653c14fcbb Linux: Handle nullptr passed to I2C constructor
I2C class derives from CDev class which requires a devname
but in at least some instances, a nullptr is passed for devname.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:15:12 -07:00
Mark Charlebois
1b4b8bb856 Linux: in printf cast uint64_t to unsigned long long
When printing a uint64_t type using %llu, this works on a 32bit
system, but on a 64bit machine uint64_t is an unsigned long.

The compiler complains about unmatching types.

The time times in PX4 should likely have been unsigned long long
and not uint64_t as that type changes per architecture.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:15:12 -07:00
Mark Charlebois
83df879f90 Linux: fixes for compilation with gcc-4.8 on IFC6410
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:15:12 -07:00
Mark Charlebois
62eb403e4d Linus: print format fixes to build with clang on IFC6410
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:15:12 -07:00
Mark Charlebois
5f3496353c Linux: added support for sdlog2
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:15:12 -07:00
Mark Charlebois
13d84ef17b Linux: I2C opens /dev/i2c-x
For now it uses the bus number as the id. Not sure how this should
actually be mapped.

Seems like the I2C devices come up in random order and have random
id but that a specific device can be found in the /sys/bus/i2c
interface.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:13:24 -07:00
Mark Charlebois
df53defca6 Linux: Add support for blinkm to test I2C layering
Running the blinkm device to test I2C

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:13:24 -07:00
Mark Charlebois
cd30b4d5ca Linux: added I2C class
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:13:24 -07:00
Mark Charlebois
90818363eb Linux: fix for undefined BO in mavlink_main_linux.cpp
if termios.h is included before mathlib.h then BO is undefined.
Since mathlib.h is not needed it was removed but I still don't
know why this error occurs.

Also added -lrt to link flags for clock_gettime

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:13:24 -07:00
Mark Charlebois
1cdc44828d Linux - revert to preferentially use clang over gcc
Removed hardcoded requirement to use gcc

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:13:24 -07:00
Mark Charlebois
11e971eaa0 Linux: min gcc version is 4.8.1
PX4 will not build with gcc-4.6.

If you are running Ubuntu 12.04 still (you poor old sod) follow the directions at

http://ubuntuhandbook.org/index.php/2013/08/install-gcc-4-8-via-ppa-in-ubuntu-12-04-13-04/

to install gcc-4.8.1

Alternatively you can install clang 3.4.1 for Ubuntu 12.04 from

http://llvm.org/releases/3.4.1/clang+llvm-3.4.1-x86_64-unknown-ubuntu12.04.tar.xz

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:13:24 -07:00
Mark Charlebois
2feeecdab1 Linux: Added config and stubs to compile I2C device for Linux
Not yet functional. Full implementation will provide an IOCTL interface to
do bi-directional transfer. will model the interface after Linux.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:13:24 -07:00
Mark Charlebois
598b05fcba Linux: run threads without SCHED_FIFO if not privileged
When running the process without sufficient privilege to use
real time scheduling, warn the user and run with SCHED_OTHER.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:07:00 -07:00
Mark Charlebois
4a6bd4ddc0 Linux: replaced getopt in ms5611_linux.cpp
ms5611 uses getopt to parse args but the static variable
optind was not being properly updated.

Replaced use of external getopt call with simple parser;

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:07:00 -07:00
Mark Charlebois
ac0df5c61d Linux: added HRT test, moved tests to linux/tests
Also fixed naming of mavlink files for NuttX build.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:07:00 -07:00
Mark Charlebois
99399115f2 Linux: Minor fixes of error caught by gcc-4.9.1
- Missing static declarations for functions not used outside a file.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:07:00 -07:00
Mark Charlebois
88a0081112 Linux: Added support for gcc-4.9.1
Fixed bug with missing quote in #error found by gcc 4.9.1

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:07:00 -07:00
Mark Charlebois
d013ac0927 Support for building more modules with Linux
Added more queue support to linux/px4_layer.

Use virt char devices for ms5611, and mavlink.

Added more HRT functionality. uORB latency test
now fails. Likely due to bad HRT impl for Linux.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:07:00 -07:00
Mark Charlebois
2abfb7a5be Linux: added queue files for dataman support
The dataman module now works under linux using /tmp/dataman as the
file path. Two files from NuttX were added to the Linux impl for
single linked queue handling.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:00:18 -07:00
Mark Charlebois
fd7863270e Nuttx: fixed missing changes from AppMgr to AppState
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:00:18 -07:00
Mark Charlebois
7b0783a070 Added MuORB based on virtual CDev implementation
uORB module now compiles and runs for Linux using the
virtual CDev implementation.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:00:18 -07:00